[DX] Fix missing preserved analysis
authorChris Bieneman <chris.bieneman@me.com>
Wed, 19 Oct 2022 17:09:43 +0000 (12:09 -0500)
committerChris Bieneman <chris.bieneman@me.com>
Wed, 19 Oct 2022 17:11:03 +0000 (12:11 -0500)
The ShaderFlagsAnalysisWrapper needs to be marked to preserve all
analyssis.

Fixes #58474 (https://github.com/llvm/llvm-project/issues/58474)

llvm/lib/Target/DirectX/DXILShaderFlags.h
llvm/test/CodeGen/DirectX/UAVMetadata.ll

index 216d8a3..4f51873 100644 (file)
@@ -91,6 +91,10 @@ public:
     Flags = ComputedShaderFlags::computeFlags(M);
     return false;
   }
+
+  void getAnalysisUsage(AnalysisUsage &AU) const override {
+    AU.setPreservesAll();
+  }
 };
 
 } // namespace dxil
index 4fd3f5e..c513587 100644 (file)
@@ -1,7 +1,6 @@
 ; RUN: opt -S -dxil-metadata-emit < %s | FileCheck %s
 ; RUN: opt -S --passes="print-dxil-resource" < %s 2>&1 | FileCheck %s --check-prefix=PRINT
-; FIX-ME: llc %s --filetype=asm -o - < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,PRINT
-; See: https://github.com/llvm/llvm-project/issues/58474
+; RUN: llc %s --filetype=asm -o - < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,PRINT
 
 target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64"
 target triple = "dxil-pc-shadermodel6.0-compute"