[llvm] r187658 - Fixes ARM LNT bot from SLP change in O3

Renato Golin renato.golin at linaro.org
Fri Aug 2 10:10:04 PDT 2013


Author: rengolin
Date: Fri Aug  2 12:10:04 2013
New Revision: 187658

URL: http://llvm.org/viewvc/llvm-project?rev=187658&view=rev
Log:
Fixes ARM LNT bot from SLP change in O3

This patch fixes the multiple breakages on ARM test-suite after the SLP
vectorizer was introduced by default on O3. The problem was an illegal
vector type on ARMTTI::getCmpSelInstrCost() <3 x i1> which is not simple.

The guard protects this code from breaking (cause of the problems) but
doesn't fix the issue that is generating the odd vector in the first
place, which also needs to be investigated.

Modified:
    llvm/trunk/lib/Target/ARM/ARMTargetTransformInfo.cpp
    llvm/trunk/test/Analysis/CostModel/ARM/select.ll

Modified: llvm/trunk/lib/Target/ARM/ARMTargetTransformInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetTransformInfo.cpp?rev=187658&r1=187657&r2=187658&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetTransformInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetTransformInfo.cpp Fri Aug  2 12:10:04 2013
@@ -411,12 +411,14 @@ unsigned ARMTTI::getCmpSelInstrCost(unsi
 
     EVT SelCondTy = TLI->getValueType(CondTy);
     EVT SelValTy = TLI->getValueType(ValTy);
-    int Idx = ConvertCostTableLookup<MVT>(NEONVectorSelectTbl,
-                                          array_lengthof(NEONVectorSelectTbl),
-                                          ISD, SelCondTy.getSimpleVT(),
-                                          SelValTy.getSimpleVT());
-    if (Idx != -1)
-      return NEONVectorSelectTbl[Idx].Cost;
+    if (SelCondTy.isSimple() && SelValTy.isSimple()) {
+      int Idx = ConvertCostTableLookup<MVT>(NEONVectorSelectTbl,
+                                            array_lengthof(NEONVectorSelectTbl),
+                                            ISD, SelCondTy.getSimpleVT(),
+                                            SelValTy.getSimpleVT());
+      if (Idx != -1)
+        return NEONVectorSelectTbl[Idx].Cost;
+    }
 
     std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(ValTy);
     return LT.first;

Modified: llvm/trunk/test/Analysis/CostModel/ARM/select.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CostModel/ARM/select.ll?rev=187658&r1=187657&r2=187658&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/CostModel/ARM/select.ll (original)
+++ llvm/trunk/test/Analysis/CostModel/ARM/select.ll Fri Aug  2 12:10:04 2013
@@ -63,5 +63,13 @@ define void @casts() {
   ; CHECK: cost of 1 {{.*}} select
   %v19 = select <2 x i1>  undef, <2 x double> undef, <2 x double> undef
 
+  ; odd vectors get legalized and should have similar costs
+  ; CHECK: cost of 1 {{.*}} select
+  %v20 = select <1 x i1>  undef, <1 x i32> undef, <1 x i32> undef
+  ; CHECK: cost of 1 {{.*}} select
+  %v21 = select <3 x i1>  undef, <3 x float> undef, <3 x float> undef
+  ; CHECK: cost of 4 {{.*}} select
+  %v22 = select <5 x i1>  undef, <5 x double> undef, <5 x double> undef
+
   ret void
 }





More information about the llvm-commits mailing list