[PATCH] D34639: Fix DebugLoc propagation for unreachable LoadInst
Weiming Zhao via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 9 06:14:14 PDT 2017
weimingz added a comment.
In https://reviews.llvm.org/D34639#791030, @davide wrote:
> testcase?
updated with testcase.
================
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());
----------------
davide wrote:
> 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).
we have an internal pass that will report potentially invalid memory accesses.
https://reviews.llvm.org/D34639
More information about the llvm-commits
mailing list