From 0178a25fc5155b2a01791eb11b48d1b8286f8a83 Mon Sep 17 00:00:00 2001 From: Renato Golin Date: Fri, 2 Aug 2013 17:10:04 +0000 Subject: [PATCH] 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. llvm-svn: 187658 --- llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp | 14 ++++++++------ llvm/test/Analysis/CostModel/ARM/select.ll | 8 ++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp index 5cc64de..34576ba 100644 --- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp +++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp @@ -411,12 +411,14 @@ unsigned ARMTTI::getCmpSelInstrCost(unsigned Opcode, Type *ValTy, EVT SelCondTy = TLI->getValueType(CondTy); EVT SelValTy = TLI->getValueType(ValTy); - int Idx = ConvertCostTableLookup(NEONVectorSelectTbl, - array_lengthof(NEONVectorSelectTbl), - ISD, SelCondTy.getSimpleVT(), - SelValTy.getSimpleVT()); - if (Idx != -1) - return NEONVectorSelectTbl[Idx].Cost; + if (SelCondTy.isSimple() && SelValTy.isSimple()) { + int Idx = ConvertCostTableLookup(NEONVectorSelectTbl, + array_lengthof(NEONVectorSelectTbl), + ISD, SelCondTy.getSimpleVT(), + SelValTy.getSimpleVT()); + if (Idx != -1) + return NEONVectorSelectTbl[Idx].Cost; + } std::pair LT = TLI->getTypeLegalizationCost(ValTy); return LT.first; diff --git a/llvm/test/Analysis/CostModel/ARM/select.ll b/llvm/test/Analysis/CostModel/ARM/select.ll index 34ed1ee..21eef83 100644 --- a/llvm/test/Analysis/CostModel/ARM/select.ll +++ b/llvm/test/Analysis/CostModel/ARM/select.ll @@ -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 } -- 2.7.4