[PATCH] D155718: [InstCombine] Remove unneeded isa<PHINode> check in foldOpIntoPhi
Dhruv Chawla via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 20 01:24:10 PDT 2023
0xdc03 updated this revision to Diff 542364.
0xdc03 added a comment.
- Invert the patch stack
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155718/new/
https://reviews.llvm.org/D155718
Files:
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Analysis/ValueTracking/known-power-of-two-urem.ll
Index: llvm/test/Analysis/ValueTracking/known-power-of-two-urem.ll
===================================================================
--- llvm/test/Analysis/ValueTracking/known-power-of-two-urem.ll
+++ llvm/test/Analysis/ValueTracking/known-power-of-two-urem.ll
@@ -15,12 +15,11 @@
; CHECK: cond.true.false:
; CHECK-NEXT: br label [[COND_TRUE_END]]
; CHECK: cond.true.end:
-; CHECK-NEXT: [[PHI:%.*]] = phi i64 [ 2, [[COND_TRUE_TRUE]] ], [ 4, [[COND_TRUE_FALSE]] ]
+; CHECK-NEXT: [[PHI:%.*]] = phi i64 [ 1, [[COND_TRUE_TRUE]] ], [ 3, [[COND_TRUE_FALSE]] ]
; CHECK-NEXT: br label [[COND_END]]
; CHECK: cond.end:
-; CHECK-NEXT: [[PHI1:%.*]] = phi i64 [ 4096, [[ENTRY:%.*]] ], [ [[PHI]], [[COND_TRUE_END]] ]
-; CHECK-NEXT: [[TMP0:%.*]] = add nsw i64 [[PHI1]], -1
-; CHECK-NEXT: [[UREM:%.*]] = and i64 [[TMP0]], [[SIZE:%.*]]
+; CHECK-NEXT: [[PHI1:%.*]] = phi i64 [ 4095, [[ENTRY:%.*]] ], [ [[PHI]], [[COND_TRUE_END]] ]
+; CHECK-NEXT: [[UREM:%.*]] = and i64 [[PHI1]], [[SIZE:%.*]]
; CHECK-NEXT: ret i64 [[UREM]]
;
entry:
Index: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
===================================================================
--- llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -1297,7 +1297,6 @@
continue;
}
- if (isa<PHINode>(InVal)) return nullptr; // Itself a phi.
if (NonSimplifiedBB) return nullptr; // More than one non-simplified value.
NonSimplifiedBB = InBB;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155718.542364.patch
Type: text/x-patch
Size: 1551 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230720/28bd2ab8/attachment.bin>
More information about the llvm-commits
mailing list