tint: Add transform to disable uniformity analysis

This is done via a new extension, which in the future could also be
used by shader authors as an escape hatch while we are still refining
the analysis.

The transform is run by the sanitizers for all of the non-WGSL
backends.

Bug: tint:880
Change-Id: Ibe90d7437d34c741a91eda65dff6d21d8469b9c7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88464
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/writer/hlsl/generator_impl.cc b/src/tint/writer/hlsl/generator_impl.cc
index 7ee5337..814d6a0 100644
--- a/src/tint/writer/hlsl/generator_impl.cc
+++ b/src/tint/writer/hlsl/generator_impl.cc
@@ -52,6 +52,7 @@
 #include "src/tint/transform/calculate_array_length.h"
 #include "src/tint/transform/canonicalize_entry_point_io.h"
 #include "src/tint/transform/decompose_memory_access.h"
+#include "src/tint/transform/disable_uniformity_analysis.h"
 #include "src/tint/transform/expand_compound_assignment.h"
 #include "src/tint/transform/fold_trivial_single_use_lets.h"
 #include "src/tint/transform/localize_struct_array_assignment.h"
@@ -139,6 +140,8 @@
     transform::Manager manager;
     transform::DataMap data;
 
+    manager.Add<transform::DisableUniformityAnalysis>();
+
     {  // Builtin polyfills
         transform::BuiltinPolyfill::Builtins polyfills;
         // TODO(crbug.com/tint/1449): Some of these can map to HLSL's `firstbitlow`
@@ -246,6 +249,10 @@
         if (decl->Is<ast::Alias>()) {
             continue;  // Ignore aliases.
         }
+        if (decl->Is<ast::Enable>()) {
+            // Currently we don't have to do anything for using a extension in HLSL.
+            continue;
+        }
 
         // Emit a new line between declarations if the type of declaration has
         // changed, or we're about to emit a function
@@ -285,11 +292,6 @@
                 }
                 return EmitFunction(func);
             },
-            [&](const ast::Enable*) {
-                // Currently we don't have to do anything for using a extension in
-                // HLSL
-                return true;
-            },
             [&](Default) {
                 TINT_ICE(Writer, diagnostics_)
                     << "unhandled module-scope declaration: " << decl->TypeInfo().name;