[llvm] 8d1342f - [LV] Remove redundant access to Legal::getReductionVars() (NFC).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 24 12:15:59 PDT 2021


Author: Florian Hahn
Date: 2021-03-24T19:15:14Z
New Revision: 8d1342f79db3cbbebfa67dc89374673642ad03fb

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

LOG: [LV] Remove redundant access to Legal::getReductionVars() (NFC).

The reduction descriptor is retrieved earlier and stored in a variable
RdxDesc already.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 34caa9acd4da..1ecb34b55b7f 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -4291,7 +4291,6 @@ void InnerLoopVectorizer::fixReduction(PHINode *Phi, VPTransformState &State) {
       // cheaper for the select to remain in the loop than be sunk out of it,
       // and so use the select value for the phi instead of the old
       // LoopExitValue.
-      RecurrenceDescriptor RdxDesc = Legal->getReductionVars()[Phi];
       if (PreferPredicatedReductionSelect ||
           TTI->preferPredicatedReductionSelect(
               RdxDesc.getOpcode(), Phi->getType(),


        


More information about the llvm-commits mailing list