[llvm] [DirectX] Eliminate resource global variables from module (PR #114105)
Cooper Partin via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 31 09:49:32 PDT 2024
================
@@ -204,6 +204,22 @@ class OpLowerer {
CleanupCasts.clear();
}
+ // Remove the resource global associated with the handleFromBinding call instruction
+ // and their uses as they aren't needed anymore.
+ void removeResourceGlobals(CallInst *CI) {
+ for (User *User : make_early_inc_range(CI->users())) {
+ if(StoreInst *Store = dyn_cast<StoreInst>(User)) {
+ if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Store->getOperand(1))) {
----------------
coopp wrote:
What is special about operand 1? in `Store->getOperand(1)`?
https://github.com/llvm/llvm-project/pull/114105
More information about the llvm-commits
mailing list