From 607be386e7ee1d11a58fe68bf9336de2b2fb9fde Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Wed, 19 Oct 2022 12:09:43 -0500 Subject: [PATCH] [DX] Fix missing preserved analysis 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 | 4 ++++ llvm/test/CodeGen/DirectX/UAVMetadata.ll | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Target/DirectX/DXILShaderFlags.h b/llvm/lib/Target/DirectX/DXILShaderFlags.h index 216d8a3..4f51873a 100644 --- a/llvm/lib/Target/DirectX/DXILShaderFlags.h +++ b/llvm/lib/Target/DirectX/DXILShaderFlags.h @@ -91,6 +91,10 @@ public: Flags = ComputedShaderFlags::computeFlags(M); return false; } + + void getAnalysisUsage(AnalysisUsage &AU) const override { + AU.setPreservesAll(); + } }; } // namespace dxil diff --git a/llvm/test/CodeGen/DirectX/UAVMetadata.ll b/llvm/test/CodeGen/DirectX/UAVMetadata.ll index 4fd3f5e..c513587 100644 --- a/llvm/test/CodeGen/DirectX/UAVMetadata.ll +++ b/llvm/test/CodeGen/DirectX/UAVMetadata.ll @@ -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" -- 2.7.4