[llvm] [DirectX] Fix the writing of ConstantExpr GEPs to DXIL bitcode (PR #154446)

Farzon Lotfi via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 26 09:59:50 PDT 2025


================
@@ -343,9 +343,7 @@ bool DataScalarizerVisitor::visitGetElementPtrInst(GetElementPtrInst &GEPI) {
 
   GOp->replaceAllUsesWith(NewGEP);
 
-  if (auto *CE = dyn_cast<ConstantExpr>(GOp))
-    CE->destroyConstant();
-  else if (auto *OldGEPI = dyn_cast<GetElementPtrInst>(GOp))
+  if (auto *OldGEPI = dyn_cast<GetElementPtrInst>(GOp))
----------------
farzonl wrote:

ah I see this is clearer when you don't combine the +/- diffs

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


More information about the llvm-commits mailing list