[polly] r206577 - Really fix the load case.

Tobias Grosser tobias at grosser.es
Fri Apr 18 02:46:35 PDT 2014


Author: grosser
Date: Fri Apr 18 04:46:35 2014
New Revision: 206577

URL: http://llvm.org/viewvc/llvm-project?rev=206577&view=rev
Log:
Really fix the load case.

Commit r206510 falsely advertised to fix the load cases, even though it only
fixed the store case. This commit adds the same fix for the load case including
the missing test coverage.

Modified:
    polly/trunk/lib/CodeGen/BlockGenerators.cpp
    polly/trunk/test/Cloog/CodeGen/vector_load_from_bitcast.ll

Modified: polly/trunk/lib/CodeGen/BlockGenerators.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/BlockGenerators.cpp?rev=206577&r1=206576&r2=206577&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/BlockGenerators.cpp (original)
+++ polly/trunk/lib/CodeGen/BlockGenerators.cpp Fri Apr 18 04:46:35 2014
@@ -526,6 +526,10 @@ void VectorBlockGenerator::generateLoad(
 
   const MemoryAccess &Access = Statement.getAccessFor(Load);
 
+  // Make sure we have scalar values available to access the pointer to
+  // the data location.
+  extractScalarValues(Load, VectorMap, ScalarMaps);
+
   Value *NewLoad;
   if (Access.isStrideZero(isl_map_copy(Schedule)))
     NewLoad = generateStrideZeroLoad(Load, ScalarMaps[0]);

Modified: polly/trunk/test/Cloog/CodeGen/vector_load_from_bitcast.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Cloog/CodeGen/vector_load_from_bitcast.ll?rev=206577&r1=206576&r2=206577&view=diff
==============================================================================
--- polly/trunk/test/Cloog/CodeGen/vector_load_from_bitcast.ll (original)
+++ polly/trunk/test/Cloog/CodeGen/vector_load_from_bitcast.ll Fri Apr 18 04:46:35 2014
@@ -15,8 +15,13 @@ for:
   %re115 = bitcast float* %ptr2 to float*
 ; CHECK: %val_p_vec_p = bitcast float** %p_ptr1 to <1 x float*>*
 
-  store float undef, float* %re115, !tbaa !2816
-; CHECK: store <4 x float> undef, <4 x float>* %vector_ptr
+  %scevgep3 = getelementptr float* %val, i32 %indvar
+  %scevgep162163 = bitcast float* %scevgep3 to float*
+  %ptr5 = load float* %scevgep162163, !tbaa !2816
+; CHECK: load <4 x float>
+  %add = fadd float undef, %ptr5
+  store float %add, float* %re115, !tbaa !2816
+; CHECK: store <4 x float>
 
   %indvar.next = add nsw i32 %indvar, 1
   %exitcond = icmp ne i32 %indvar.next, 4





More information about the llvm-commits mailing list