[PATCH] D66216: [ValueTracking] Fix recurrence detection to check both PHI operands.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 16 02:20:47 PDT 2019
This revision was automatically updated to reflect the committed changes.
fhahn marked an inline comment as done.
Closed by commit rG75be1a9e5821: [ValueTracking] Fix recurrence detection to check both PHI operands. (authored by fhahn).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66216/new/
https://reviews.llvm.org/D66216
Files:
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Transforms/InstCombine/phi-known-bits-operand-order.ll
Index: llvm/test/Transforms/InstCombine/phi-known-bits-operand-order.ll
===================================================================
--- llvm/test/Transforms/InstCombine/phi-known-bits-operand-order.ll
+++ llvm/test/Transforms/InstCombine/phi-known-bits-operand-order.ll
@@ -19,8 +19,8 @@
; CHECK-NEXT: br i1 [[COND_V]], label [[FOR_COND11:%.*]], label [[FOR_COND26]]
; CHECK: for.cond11:
; CHECK-NEXT: [[I_1:%.*]] = phi i32 [ [[START]], [[IF_THEN]] ], [ [[STEP:%.*]], [[FOR_COND11]] ]
-; CHECK-NEXT: [[CMP13:%.*]] = icmp slt i32 [[I_1]], 100
-; CHECK-NEXT: [[STEP]] = add nsw i32 [[I_1]], 1
+; CHECK-NEXT: [[CMP13:%.*]] = icmp ult i32 [[I_1]], 100
+; CHECK-NEXT: [[STEP]] = add nuw nsw i32 [[I_1]], 1
; CHECK-NEXT: br i1 [[CMP13]], label [[FOR_COND11]], label [[WHILE_END]]
; CHECK: for.cond26:
; CHECK-NEXT: br label [[WHILE_COND]]
Index: llvm/lib/Analysis/ValueTracking.cpp
===================================================================
--- llvm/lib/Analysis/ValueTracking.cpp
+++ llvm/lib/Analysis/ValueTracking.cpp
@@ -1373,7 +1373,7 @@
else if (LR == I)
L = LL;
else
- break;
+ continue; // Check for recurrence with L and R flipped.
// Ok, we have a PHI of the form L op= R. Check for low
// zero bits.
computeKnownBits(R, Known2, Depth + 1, Q);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66216.215546.patch
Type: text/x-patch
Size: 1397 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190816/1be9ed37/attachment.bin>
More information about the llvm-commits
mailing list