[tools][run-cts] Add a --use-ir flag helper

I can never remember the full --flag spell that's required to enable this.

Change-Id: I2f3c7159d32a59cbf2f9c907083d84faa06dfbb6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/187440
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: James Price <jrprice@google.com>
diff --git a/tools/src/cmd/run-cts/node/cmd.go b/tools/src/cmd/run-cts/node/cmd.go
index 4edea34..fd08484 100644
--- a/tools/src/cmd/run-cts/node/cmd.go
+++ b/tools/src/cmd/run-cts/node/cmd.go
@@ -54,6 +54,7 @@
 	validate             bool
 	dumpShaders          bool
 	fxc                  bool
+	useIR                bool
 	unrollConstEvalLoops bool
 	genCoverage          bool
 	compatibilityMode    bool
@@ -101,6 +102,7 @@
 	flag.StringVar(&c.flags.adapterName, "adapter", "", "name (or substring) of the GPU adapter to use")
 	flag.BoolVar(&c.flags.dumpShaders, "dump-shaders", false, "dump WGSL shaders. Enables --verbose")
 	flag.BoolVar(&c.flags.fxc, "fxc", false, "Use FXC instead of DXC. Disables 'use_dxc' Dawn flag")
+	flag.BoolVar(&c.flags.useIR, "use-ir", false, "Use Tint's IR generator code path")
 	flag.BoolVar(&c.flags.unrollConstEvalLoops, "unroll-const-eval-loops", unrollConstEvalLoopsDefault, "unroll loops in const-eval tests")
 	flag.BoolVar(&c.flags.genCoverage, "coverage", false, "displays coverage data")
 	flag.StringVar(&c.flags.coverageFile, "export-coverage", "", "write coverage data to the given path")
@@ -203,6 +205,7 @@
 		AllowUnsafeAPIs: true,
 		DumpShaders:     c.flags.dumpShaders,
 		UseFXC:          c.flags.fxc,
+		UseIR:           c.flags.useIR,
 	})
 
 	if c.flags.dumpShaders {
diff --git a/tools/src/dawn/node/node.go b/tools/src/dawn/node/node.go
index fbacee1..b6ab345 100644
--- a/tools/src/dawn/node/node.go
+++ b/tools/src/dawn/node/node.go
@@ -82,6 +82,7 @@
 	AllowUnsafeAPIs bool
 	DumpShaders     bool
 	UseFXC          bool
+	UseIR           bool
 }
 
 func (f *Flags) SetOptions(opts Options) error {
@@ -109,6 +110,9 @@
 	if opts.UseFXC {
 		f.Set("disable-dawn-features=use_dxc")
 	}
+	if opts.UseIR {
+		f.Set("enable-dawn-features=use_tint_ir")
+	}
 	f.GlobListFlags("enable-dawn-features=", ",")
 
 	return nil