[PATCH] D57568: [SCEV] Don't bother preserving LCSSA in SCEV
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 1 01:36:59 PST 2019
mkazantsev updated this revision to Diff 184693.
mkazantsev retitled this revision from "[SCEV] Optimize getting SCEV of one-input Phis" to "[SCEV] Don't bother preserving LCSSA in SCEV".
mkazantsev edited the summary of this revision.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57568/new/
https://reviews.llvm.org/D57568
Files:
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/solve-quadratic-i1.ll
test/Analysis/ScalarEvolution/solve-quadratic-overflow.ll
test/Transforms/LoopStrengthReduce/funclet.ll
Index: test/Transforms/LoopStrengthReduce/funclet.ll
===================================================================
--- test/Transforms/LoopStrengthReduce/funclet.ll
+++ test/Transforms/LoopStrengthReduce/funclet.ll
@@ -45,7 +45,7 @@
; CHECK-LABEL: define void @f(
; CHECK: cleanuppad within none []
-; CHECK-NEXT: ptrtoint i8* %phi2 to i32
+; CHECK-NEXT: br
define void @g() personality i32 (...)* @_except_handler3 {
entry:
@@ -87,7 +87,7 @@
; CHECK-LABEL: define void @g(
; CHECK: blah:
; CHECK-NEXT: catchpad within %cs []
-; CHECK-NEXT: ptrtoint i8* %phi2 to i32
+; CHECK-NEXT: br
define void @h() personality i32 (...)* @_except_handler3 {
@@ -130,7 +130,7 @@
; CHECK-LABEL: define void @h(
; CHECK: blug:
; CHECK: catchpad within %cs []
-; CHECK-NEXT: ptrtoint i8* %phi2 to i32
+; CHECK-NEXT: br
define void @i() personality i32 (...)* @_except_handler3 {
entry:
@@ -170,7 +170,7 @@
}
; CHECK-LABEL: define void @i(
-; CHECK: ptrtoint i8* %phi2 to i32
+; CHECK-NOT: ptrtoint i8* %phi2 to i32
define void @test1(i32* %b, i32* %c) personality i32 (...)* @__CxxFrameHandler3 {
entry:
Index: test/Analysis/ScalarEvolution/solve-quadratic-overflow.ll
===================================================================
--- test/Analysis/ScalarEvolution/solve-quadratic-overflow.ll
+++ test/Analysis/ScalarEvolution/solve-quadratic-overflow.ll
@@ -12,11 +12,11 @@
; CHECK-NEXT: %v3 = mul i16 %v2, %v2
; CHECK-NEXT: --> {1,+,3,+,2}<%b1> U: full-set S: full-set Exits: 0 LoopDispositions: { %b1: Computable }
; CHECK-NEXT: %v5 = phi i16 [ %v2, %b1 ]
-; CHECK-NEXT: --> %v5 U: [-256,0) S: [-256,0)
+; CHECK-NEXT: --> {-1,+,-1}<%b1> U: [-256,0) S: [-256,0)
; CHECK-NEXT: %v6 = phi i16 [ %v3, %b1 ]
-; CHECK-NEXT: --> %v6 U: full-set S: full-set
+; CHECK-NEXT: --> {1,+,3,+,2}<%b1> U: full-set S: full-set
; CHECK-NEXT: %v7 = sext i16 %v5 to i32
-; CHECK-NEXT: --> (sext i16 %v5 to i32) U: [-256,0) S: [-256,0)
+; CHECK-NEXT: --> {-1,+,-1}<nsw><%b1> U: [-256,0) S: [-256,0)
; CHECK-NEXT: Determining loop execution counts for: @f0
; CHECK-NEXT: Loop %b1: backedge-taken count is 255
; CHECK-NEXT: Loop %b1: max backedge-taken count is 255
Index: test/Analysis/ScalarEvolution/solve-quadratic-i1.ll
===================================================================
--- test/Analysis/ScalarEvolution/solve-quadratic-i1.ll
+++ test/Analysis/ScalarEvolution/solve-quadratic-i1.ll
@@ -57,9 +57,9 @@
; CHECK-NEXT: %v6 = add nuw nsw i32 %v1, 1
; CHECK-NEXT: --> {4,+,1}<nuw><nsw><%b1> U: [4,7) S: [4,7) Exits: 6 LoopDispositions: { %b1: Computable }
; CHECK-NEXT: %v7 = phi i32 [ %v1, %b1 ]
-; CHECK-NEXT: --> %v7 U: [3,6) S: [3,6)
+; CHECK-NEXT: --> {3,+,1}<nuw><nsw><%b1> U: [3,6) S: [3,6)
; CHECK-NEXT: %v8 = phi i16 [ %v3, %b1 ]
-; CHECK-NEXT: --> %v8 U: full-set S: full-set
+; CHECK-NEXT: --> {3,+,4,+,1}<%b1> U: full-set S: full-set
; CHECK-NEXT: Determining loop execution counts for: @f1
; CHECK-NEXT: Loop %b3: <multiple exits> Unpredictable backedge-taken count.
; CHECK-NEXT: Loop %b3: Unpredictable max backedge-taken count.
Index: lib/Analysis/ScalarEvolution.cpp
===================================================================
--- lib/Analysis/ScalarEvolution.cpp
+++ lib/Analysis/ScalarEvolution.cpp
@@ -5344,8 +5344,7 @@
// risks breaking LCSSA form. Instcombine would normally zap these, but
// it doesn't have DominatorTree information, so it may miss cases.
if (Value *V = SimplifyInstruction(PN, {getDataLayout(), &TLI, &DT, &AC}))
- if (LI.replacementPreservesLCSSAForm(PN, V))
- return getSCEV(V);
+ return getSCEV(V);
// If it's not a loop phi, we can't handle it yet.
return getUnknown(PN);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57568.184693.patch
Type: text/x-patch
Size: 3780 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190201/10fc7207/attachment.bin>
More information about the llvm-commits
mailing list