[PATCH] D34639: Fix DebugLoc propagation for unreachable LoadInst

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 12:45:49 PDT 2017


davide added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:988-990
+    StoreInst *SI = new StoreInst(UndefValue::get(LI.getType()),
+                                  Constant::getNullValue(Op->getType()), &LI);
+    SI->setDebugLoc(LI.getDebugLoc());
----------------
Also, I'm a little confused why you need to preserve the debug location of a block you're going to wipe out shortly after? (i.e. after SimplifyCFG will run again).


Repository:
  rL LLVM

https://reviews.llvm.org/D34639





More information about the llvm-commits mailing list