Remove the TINT_IR_ICE macro.

This was only ever used in the MSL backend and I think we have better
ways to do what this was doing now (by dumping the validation log
messages before running the printer.

Change-Id: I9061ea349278e27e4de3b0d39fd22b919a502782
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/248674
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Auto-Submit: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/lang/core/ir/BUILD.bazel b/src/tint/lang/core/ir/BUILD.bazel
index e613089..4567416 100644
--- a/src/tint/lang/core/ir/BUILD.bazel
+++ b/src/tint/lang/core/ir/BUILD.bazel
@@ -128,7 +128,6 @@
     "exit_switch.h",
     "function.h",
     "function_param.h",
-    "ice.h",
     "if.h",
     "instruction.h",
     "instruction_result.h",
diff --git a/src/tint/lang/core/ir/BUILD.cmake b/src/tint/lang/core/ir/BUILD.cmake
index a321e7f..7343968 100644
--- a/src/tint/lang/core/ir/BUILD.cmake
+++ b/src/tint/lang/core/ir/BUILD.cmake
@@ -102,7 +102,6 @@
   lang/core/ir/function.h
   lang/core/ir/function_param.cc
   lang/core/ir/function_param.h
-  lang/core/ir/ice.h
   lang/core/ir/if.cc
   lang/core/ir/if.h
   lang/core/ir/instruction.cc
diff --git a/src/tint/lang/core/ir/BUILD.gn b/src/tint/lang/core/ir/BUILD.gn
index 3acba56..621d52f 100644
--- a/src/tint/lang/core/ir/BUILD.gn
+++ b/src/tint/lang/core/ir/BUILD.gn
@@ -103,7 +103,6 @@
     "function.h",
     "function_param.cc",
     "function_param.h",
-    "ice.h",
     "if.cc",
     "if.h",
     "instruction.cc",
diff --git a/src/tint/lang/core/ir/ice.h b/src/tint/lang/core/ir/ice.h
deleted file mode 100644
index f798073..0000000
--- a/src/tint/lang/core/ir/ice.h
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2023 The Dawn & Tint Authors
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the copyright holder nor the names of its
-//    contributors may be used to endorse or promote products derived from
-//    this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef SRC_TINT_LANG_CORE_IR_ICE_H_
-#define SRC_TINT_LANG_CORE_IR_ICE_H_
-
-#include "src/tint/lang/core/ir/disassembler.h"
-
-/// Emit an ICE message with the disassembly of `mod` attached.
-#define TINT_IR_ICE(mod) TINT_ICE() << tint::core::ir::Disassembler(mod).Plain() << "\n"
-
-#endif  // SRC_TINT_LANG_CORE_IR_ICE_H_
diff --git a/src/tint/lang/msl/writer/printer/printer.cc b/src/tint/lang/msl/writer/printer/printer.cc
index c359d5b..a95be18 100644
--- a/src/tint/lang/msl/writer/printer/printer.cc
+++ b/src/tint/lang/msl/writer/printer/printer.cc
@@ -36,6 +36,7 @@
 #include "src/tint/lang/core/constant/splat.h"
 #include "src/tint/lang/core/fluent_types.h"
 #include "src/tint/lang/core/ir/access.h"
+#include "src/tint/lang/core/ir/binary.h"
 #include "src/tint/lang/core/ir/bitcast.h"
 #include "src/tint/lang/core/ir/break_if.h"
 #include "src/tint/lang/core/ir/constant.h"
@@ -48,11 +49,11 @@
 #include "src/tint/lang/core/ir/exit_if.h"
 #include "src/tint/lang/core/ir/exit_loop.h"
 #include "src/tint/lang/core/ir/exit_switch.h"
-#include "src/tint/lang/core/ir/ice.h"
 #include "src/tint/lang/core/ir/if.h"
 #include "src/tint/lang/core/ir/let.h"
 #include "src/tint/lang/core/ir/load.h"
 #include "src/tint/lang/core/ir/load_vector_element.h"
+#include "src/tint/lang/core/ir/loop.h"
 #include "src/tint/lang/core/ir/module.h"
 #include "src/tint/lang/core/ir/multi_in_block.h"
 #include "src/tint/lang/core/ir/next_iteration.h"
@@ -639,7 +640,7 @@
                 out << "threadgroup ";
                 break;
             default:
-                TINT_IR_ICE(ir_) << "unhandled variable address space";
+                TINT_ICE() << "unhandled variable address space";
         }
 
         EmitType(out, ptr->UnwrapPtr());
@@ -1300,7 +1301,7 @@
                 out << "constant";
                 break;
             default:
-                TINT_IR_ICE(ir_) << "unhandled address space: " << sc;
+                TINT_ICE() << "unhandled address space: " << sc;
         }
     }
 
@@ -1404,7 +1405,7 @@
         } else {
             auto count = arr->ConstantCount();
             if (!count) {
-                TINT_IR_ICE(ir_) << core::type::Array::kErrExpectedConstantCount;
+                TINT_ICE() << core::type::Array::kErrExpectedConstantCount;
             }
             out << count.value();
         }
@@ -1449,7 +1450,7 @@
     /// @param tex the texture to emit
     void EmitTextureType(StringStream& out, const core::type::Texture* tex) {
         if (DAWN_UNLIKELY(tex->Is<core::type::ExternalTexture>())) {
-            TINT_IR_ICE(ir_) << "Multiplanar external texture transform was not run.";
+            TINT_ICE() << "Multiplanar external texture transform was not run.";
         }
 
         if (tex->IsAnyOf<core::type::DepthTexture, core::type::DepthMultisampledTexture>()) {
@@ -1478,7 +1479,7 @@
                 out << "cube_array";
                 break;
             default:
-                TINT_IR_ICE(ir_) << "invalid texture dimensions";
+                TINT_ICE() << "invalid texture dimensions";
         }
         if (tex->IsAnyOf<core::type::MultisampledTexture, core::type::DepthMultisampledTexture>()) {
             out << "_ms";
@@ -1502,7 +1503,7 @@
                 } else if (storage->Access() == core::Access::kWrite) {
                     out << "access::write";
                 } else {
-                    TINT_IR_ICE(ir_) << "invalid access control for storage texture";
+                    TINT_ICE() << "invalid access control for storage texture";
                 }
             },
             [&](const core::type::MultisampledTexture* ms) {
@@ -1564,8 +1565,8 @@
             if (!explicit_layout && is_host_shareable) {
                 if (DAWN_UNLIKELY(ir_offset < msl_offset)) {
                     // Unimplementable layout
-                    TINT_IR_ICE(ir_) << "Structure member offset (" << ir_offset
-                                     << ") is behind MSL offset (" << msl_offset << ")";
+                    TINT_ICE() << "Structure member offset (" << ir_offset
+                               << ") is behind MSL offset (" << msl_offset << ")";
                 }
 
                 // Generate padding if required
@@ -1598,7 +1599,7 @@
             if (auto builtin = attributes.builtin) {
                 auto name = BuiltinToAttribute(builtin.value());
                 if (name.empty()) {
-                    TINT_IR_ICE(ir_) << "unknown builtin";
+                    TINT_ICE() << "unknown builtin";
                 }
                 out << " [[" << name << "]]";
             }
@@ -1610,7 +1611,7 @@
             if (auto location = attributes.location) {
                 auto& pipeline_stage_uses = str->PipelineStageUses();
                 if (DAWN_UNLIKELY(pipeline_stage_uses.Count() != 1)) {
-                    TINT_IR_ICE(ir_) << "invalid entry point IO struct uses";
+                    TINT_ICE() << "invalid entry point IO struct uses";
                 }
 
                 if (pipeline_stage_uses.Contains(core::type::PipelineStageUsage::kVertexInput)) {
@@ -1628,7 +1629,7 @@
                         out << " [[index(" << blend_src.value() << ")]]";
                     }
                 } else {
-                    TINT_IR_ICE(ir_) << "invalid use of location decoration";
+                    TINT_ICE() << "invalid use of location decoration";
                 }
             }
 
@@ -1639,7 +1640,7 @@
             if (auto interpolation = attributes.interpolation) {
                 auto name = InterpolationToAttribute(interpolation->type, interpolation->sampling);
                 if (name.empty()) {
-                    TINT_IR_ICE(ir_) << "unknown interpolation attribute";
+                    TINT_ICE() << "unknown interpolation attribute";
                 }
                 out << " [[" << name << "]]";
             }
@@ -1670,9 +1671,9 @@
                 // Calculate new MSL offset
                 auto size_align = MslPackedTypeSizeAndAlign(ty);
                 if (DAWN_UNLIKELY(msl_offset % size_align.align)) {
-                    TINT_IR_ICE(ir_) << "Misaligned MSL structure member " << mem_name << " : "
-                                     << ty->FriendlyName() << " offset: " << msl_offset
-                                     << " align: " << size_align.align;
+                    TINT_ICE() << "Misaligned MSL structure member " << mem_name << " : "
+                               << ty->FriendlyName() << " offset: " << msl_offset
+                               << " align: " << size_align.align;
                 }
                 msl_offset += size_align.size;
             }
@@ -1769,7 +1770,7 @@
 
                 auto count = a->ConstantCount();
                 if (!count) {
-                    TINT_IR_ICE(ir_) << core::type::Array::kErrExpectedConstantCount;
+                    TINT_ICE() << core::type::Array::kErrExpectedConstantCount;
                 }
                 emit_values(*count);
             },