[llvm-branch-commits] [llvm] 512a64d - [test] Fix scev-expander-preserve-lcssa.ll under NPM

Arthur Eubanks via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 10 09:50:47 PST 2020


Author: Arthur Eubanks
Date: 2020-12-10T09:46:08-08:00
New Revision: 512a64de6a977891b52b59c765f7775e0c8ad6cf

URL: https://github.com/llvm/llvm-project/commit/512a64de6a977891b52b59c765f7775e0c8ad6cf
DIFF: https://github.com/llvm/llvm-project/commit/512a64de6a977891b52b59c765f7775e0c8ad6cf.diff

LOG: [test] Fix scev-expander-preserve-lcssa.ll under NPM

The NPM runs loop passes over loops in forward program order, rather
than the legacy loop PM's reverse program order. This seems to produce
better results as shown here.

I verified that changing the loop order to reverse program order results
in the same IR with the NPM.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D92817

Added: 
    

Modified: 
    llvm/test/Transforms/IndVarSimplify/scev-expander-preserve-lcssa.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/IndVarSimplify/scev-expander-preserve-lcssa.ll b/llvm/test/Transforms/IndVarSimplify/scev-expander-preserve-lcssa.ll
index d26d3b23b772..6c275f3bca48 100644
--- a/llvm/test/Transforms/IndVarSimplify/scev-expander-preserve-lcssa.ll
+++ b/llvm/test/Transforms/IndVarSimplify/scev-expander-preserve-lcssa.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -indvars -S -indvars -verify-loop-lcssa %s | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes=indvars,indvars -S -verify-loop-lcssa %s | FileCheck %s
 
 ; Make sure SCEVExpander does not crash and introduce unnecessary LCSSA PHI nodes.
 ; The tests are a collection of cases with crashes when preserving LCSSA PHI
@@ -113,13 +113,10 @@ define void @test2(i16 %x)  {
 ; CHECK:       for.body84.preheader:
 ; CHECK-NEXT:    br label [[FOR_BODY84:%.*]]
 ; CHECK:       for.body84:
-; CHECK-NEXT:    [[I_144:%.*]] = phi i32 [ [[INC:%.*]], [[IF_END106:%.*]] ], [ 0, [[FOR_BODY84_PREHEADER]] ]
 ; CHECK-NEXT:    [[C_2:%.*]] = call i1 @cond()
-; CHECK-NEXT:    br i1 [[C_2]], label [[IF_END106]], label [[RETURN_LOOPEXIT:%.*]]
+; CHECK-NEXT:    br i1 [[C_2]], label [[IF_END106:%.*]], label [[RETURN_LOOPEXIT:%.*]]
 ; CHECK:       if.end106:
-; CHECK-NEXT:    [[INC]] = add nuw nsw i32 [[I_144]], 1
-; CHECK-NEXT:    [[CMP82:%.*]] = icmp slt i32 [[INC]], [[I_0_LCSSA2]]
-; CHECK-NEXT:    br i1 [[CMP82]], label [[FOR_BODY84]], label [[RETURN_LOOPEXIT]]
+; CHECK-NEXT:    br i1 false, label [[FOR_BODY84]], label [[RETURN_LOOPEXIT]]
 ; CHECK:       return.loopexit:
 ; CHECK-NEXT:    br label [[RETURN]]
 ; CHECK:       return.loopexit1:


        


More information about the llvm-branch-commits mailing list