[llvm] c60e0b6 - [LSR] Another minor code style improvement [nfc]

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 08:09:10 PDT 2023


Author: Philip Reames
Date: 2023-03-17T08:09:01-07:00
New Revision: c60e0b66ad24feaa2159e3022cb2de8c36c308d5

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

LOG: [LSR] Another minor code style improvement [nfc]

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 73b8a40866f9..805e4c0ec4b5 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -6800,8 +6800,7 @@ canFoldTermCondOfLoop(Loop *L, ScalarEvolution &SE, DominatorTree &DT,
                            "terminating condition folding.\n");
       continue;
     }
-    const SCEV *S = SE.getSCEV(&PN);
-    const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(S);
+    const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(SE.getSCEV(&PN));
     // Only speculate on affine AddRec
     if (!AddRec || !AddRec->isAffine()) {
       LLVM_DEBUG(dbgs() << "SCEV of phi '" << PN


        


More information about the llvm-commits mailing list