[llvm] [DirectX] Eliminate resource global variables from module (PR #114105)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 1 11:20:55 PDT 2024


================
@@ -0,0 +1,94 @@
+; RUN: opt -S -passes='early-cse<memssa>' %s -o %t
+; RUN: FileCheck --check-prefixes=CSE,CHECK %s < %t
+; finish compiling to verify that dxil-op-lower removes the globals entirely
+; RUN: opt -S -dxil-op-lower %t -o - | FileCheck --check-prefixes=LLC,CHECK %s
+; RUN: llc -mtriple=dxil-pc-shadermodel6.0-compute  --filetype=asm -o - %t | FileCheck --check-prefixes=LLC,CHECK %s
+; RUN: llc -mtriple=dxil-pc-shadermodel6.6-compute  --filetype=asm -o - %t | FileCheck --check-prefixes=LLC,CHECK %s
+
+; Ensure that EarlyCSE is able to eliminate unneeded loads of resource globals across typedBufferLoad.
+; Also that DXILOpLowering eliminates the globals entirely.
+
+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"
----------------
bogner wrote:

This is the default datalayout for the triple. Best to remove it since it doesn't really affect anything

https://github.com/llvm/llvm-project/pull/114105


More information about the llvm-commits mailing list