[llvm-commits] [llvm] r158462 - in /llvm/trunk: lib/Transforms/Scalar/ScalarReplAggregates.cpp test/Transforms/ScalarRepl/2011-06-08-VectorExtractValue.ll

Pete Cooper peter_cooper at apple.com
Thu Jun 14 11:32:52 PDT 2012


Author: pete
Date: Thu Jun 14 13:32:52 2012
New Revision: 158462

URL: http://llvm.org/viewvc/llvm-project?rev=158462&view=rev
Log:
Revert r158454: Allow SROA to look at a vector type...  Its breaking the vectorise buildbot

This reverts commit 12c1f86ffa731e2952c80d2cc577000c96b8962c.

Modified:
    llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
    llvm/trunk/test/Transforms/ScalarRepl/2011-06-08-VectorExtractValue.ll

Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=158462&r1=158461&r2=158462&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Thu Jun 14 13:32:52 2012
@@ -1764,12 +1764,6 @@
     if (Offset >= AT->getNumElements() * EltSize)
       return false;
     Offset %= EltSize;
-  } else if (VectorType *VT = dyn_cast<VectorType>(T)) {
-    EltTy = VT->getElementType();
-    EltSize = TD->getTypeAllocSize(EltTy);
-    if (Offset >= VT->getNumElements() * EltSize)
-      return false;
-    Offset %= EltSize;
   } else {
     return false;
   }
@@ -1937,16 +1931,9 @@
     Offset -= Layout->getElementOffset(Idx);
     IdxTy = Type::getInt32Ty(T->getContext());
     return Idx;
-  } else if (ArrayType *AT = dyn_cast<ArrayType>(T)) {
-    T = AT->getElementType();
-    uint64_t EltSize = TD->getTypeAllocSize(T);
-    Idx = Offset / EltSize;
-    Offset -= Idx * EltSize;
-    IdxTy = Type::getInt64Ty(T->getContext());
-    return Idx;
   }
-  VectorType *VT = cast<VectorType>(T);
-  T = VT->getElementType();
+  ArrayType *AT = cast<ArrayType>(T);
+  T = AT->getElementType();
   uint64_t EltSize = TD->getTypeAllocSize(T);
   Idx = Offset / EltSize;
   Offset -= Idx * EltSize;

Modified: llvm/trunk/test/Transforms/ScalarRepl/2011-06-08-VectorExtractValue.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ScalarRepl/2011-06-08-VectorExtractValue.ll?rev=158462&r1=158461&r2=158462&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/ScalarRepl/2011-06-08-VectorExtractValue.ll (original)
+++ llvm/trunk/test/Transforms/ScalarRepl/2011-06-08-VectorExtractValue.ll Thu Jun 14 13:32:52 2012
@@ -10,7 +10,8 @@
 
 ; CHECK: main
 ; CHECK-NOT: alloca
-; CHECK: extractelement <2 x float> zeroinitializer, i32 0
+; CHECK: %[[A:[a-z0-9]*]] = and i128
+; CHECK: %[[B:[a-z0-9]*]] = trunc i128 %[[A]] to i32
 
 define void @main() uwtable ssp {
 entry:
@@ -27,7 +28,8 @@
 
 ; CHECK: test1
 ; CHECK-NOT: alloca
-; CHECK: extractelement <2 x float> zeroinitializer, i32 0
+; CHECK: %[[A:[a-z0-9]*]] = and i128
+; CHECK: %[[B:[a-z0-9]*]] = trunc i128 %[[A]] to i32
 
 define void @test1() uwtable ssp {
 entry:
@@ -41,8 +43,9 @@
 
 ; CHECK: test2
 ; CHECK-NOT: alloca
-; CHECK: %[[A:[a-z0-9]*]] = extractelement <2 x float> zeroinitializer, i32 0
-; CHECK: fadd float %[[A]], 1.000000e+00
+; CHECK: and i128
+; CHECK: or i128
+; CHECK: trunc i128
 ; CHECK-NOT: insertelement
 ; CHECK-NOT: extractelement
 
@@ -59,17 +62,3 @@
   %r = fadd float %r1, %r2
   ret float %r
 }
-
-; CHECK: test3
-; CHECK: %[[A:[a-z0-9]*]] = extractelement <2 x float> <float 2.000000e+00, float 3.000000e+00>, i32 1
-; CHECK: ret float %[[A]]
-
-define float @test3() {
-entry:
-  %ai = alloca { <2 x float>, <2 x float> }, align 8
-  store { <2 x float>, <2 x float> } {<2 x float> <float 0.0, float 1.0>, <2 x float> <float 2.0, float 3.0>}, { <2 x float>, <2 x float> }* %ai, align 8
-  %tmpcast = bitcast { <2 x float>, <2 x float> }* %ai to [4 x float]*
-  %arrayidx = getelementptr inbounds [4 x float]* %tmpcast, i64 0, i64 3
-  %f = load float* %arrayidx, align 4
-  ret float %f
-}





More information about the llvm-commits mailing list