[llvm] r181942 - LoopVectorize: Move call of canHoistAllLoads to canVectorizeWithIfConvert

Arnold Schwaighofer aschwaighofer at apple.com
Wed May 15 15:38:14 PDT 2013


Author: arnolds
Date: Wed May 15 17:38:14 2013
New Revision: 181942

URL: http://llvm.org/viewvc/llvm-project?rev=181942&view=rev
Log:
LoopVectorize: Move call of canHoistAllLoads to canVectorizeWithIfConvert

We only want to check this once, not for every conditional block in the loop.

No functionality change (except that we don't perform a check redudantly
anymore).

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

Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=181942&r1=181941&r2=181942&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Wed May 15 17:38:14 2013
@@ -2432,6 +2432,10 @@ bool LoopVectorizationLegality::canVecto
       return false;
   }
 
+  // Check that we can actually speculate the hoistable loads.
+  if (!LoadSpeculation.canHoistAllLoads())
+    return false;
+
   // We can if-convert this loop.
   return true;
 }
@@ -3369,10 +3373,6 @@ bool LoopVectorizationLegality::blockCan
     }
   }
 
-  // Check that we can actually speculate the hoistable loads.
-  if (!LoadSpeculation.canHoistAllLoads())
-    return false;
-
   return true;
 }
 





More information about the llvm-commits mailing list