[PATCH] D68004: [InstCombine] Fix call guard difference with dbg
Davide Italiano via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 22 13:39:07 PST 2019
This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc32f0ff92f02: [InstCombine] Fix call guard difference with dbg (authored by davide).
Changed prior to commit:
https://reviews.llvm.org/D68004?vs=223828&id=230717#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68004/new/
https://reviews.llvm.org/D68004
Files:
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/InstCombine/call-guard.ll
Index: llvm/test/Transforms/InstCombine/call-guard.ll
===================================================================
--- llvm/test/Transforms/InstCombine/call-guard.ll
+++ llvm/test/Transforms/InstCombine/call-guard.ll
@@ -1,4 +1,5 @@
; RUN: opt < %s -instcombine -S | FileCheck %s
+; RUN: opt < %s -instcombine -S -debugify-each | FileCheck %s
declare void @llvm.experimental.guard(i1, ...)
Index: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
===================================================================
--- llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -4060,12 +4060,12 @@
// Is this guard followed by another guard? We scan forward over a small
// fixed window of instructions to handle common cases with conditions
// computed between guards.
- Instruction *NextInst = II->getNextNode();
+ Instruction *NextInst = II->getNextNonDebugInstruction();
for (unsigned i = 0; i < GuardWideningWindow; i++) {
// Note: Using context-free form to avoid compile time blow up
if (!isSafeToSpeculativelyExecute(NextInst))
break;
- NextInst = NextInst->getNextNode();
+ NextInst = NextInst->getNextNonDebugInstruction();
}
Value *NextCond = nullptr;
if (match(NextInst,
@@ -4077,10 +4077,10 @@
return eraseInstFromFunction(*NextInst);
// Otherwise canonicalize guard(a); guard(b) -> guard(a & b).
- Instruction* MoveI = II->getNextNode();
+ Instruction *MoveI = II->getNextNonDebugInstruction();
while (MoveI != NextInst) {
auto *Temp = MoveI;
- MoveI = MoveI->getNextNode();
+ MoveI = MoveI->getNextNonDebugInstruction();
Temp->moveBefore(II);
}
II->setArgOperand(0, Builder.CreateAnd(CurrCond, NextCond));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68004.230717.patch
Type: text/x-patch
Size: 1848 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191122/f80811f6/attachment.bin>
More information about the llvm-commits
mailing list