diff options
| author | Davide Italiano <davide@freebsd.org> | 2018-06-08 20:42:36 +0000 |
|---|---|---|
| committer | Davide Italiano <davide@freebsd.org> | 2018-06-08 20:42:36 +0000 |
| commit | 189c2cf1142239bf1e344cd090143a15127f268a (patch) | |
| tree | a067312d5a591c8344aac3a5fb89f3148525bc66 /llvm/lib/Transforms | |
| parent | dcf0097962e4506aec59fbbd01c874527d2e061d (diff) | |
| download | bcm5719-llvm-189c2cf1142239bf1e344cd090143a15127f268a.tar.gz bcm5719-llvm-189c2cf1142239bf1e344cd090143a15127f268a.zip | |
[InstCombine] Skip dbg.value(s) when looking at stack{save,restore}.
Fixes PR37713.
llvm-svn: 334317
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index 7526b2ea2c9..ca2b38dce28 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -3521,8 +3521,15 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { // happen when variable allocas are DCE'd. if (IntrinsicInst *SS = dyn_cast<IntrinsicInst>(II->getArgOperand(0))) { if (SS->getIntrinsicID() == Intrinsic::stacksave) { - if (&*++SS->getIterator() == II) + // Skip over debug info instructions. + // FIXME: This should be an utility in Instruction.h + auto It = SS->getIterator(); + It++; + while (isa<DbgInfoIntrinsic>(*It)) + It++; + if (&*It == II) { return eraseInstFromFunction(CI); + } } } |

