Fix for ABS legalization on PPC buildbot.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 19 Mar 2019 18:55:46 +0000 (18:55 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 19 Mar 2019 18:55:46 +0000 (18:55 +0000)
llvm-svn: 356498

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
llvm/lib/Target/PowerPC/PPCISelLowering.cpp

index e25294cf1741ebe3fced10572569591f6b8ccb77..f14b2e4cfabf98153084fb29477412c2366f9a11 100644 (file)
@@ -2665,6 +2665,7 @@ void DAGTypeLegalizer::WidenVectorResult(SDNode *N, unsigned ResNo) {
   // any other unary ops.
   LLVM_FALLTHROUGH;
 
+  case ISD::ABS:
   case ISD::BITREVERSE:
   case ISD::BSWAP:
   case ISD::CTLZ:
index 2b1003663b6ed0fb04b459b37470fd3e005c21a2..aa3fc7c315bba6910adf38f9574999c0b5592de1 100644 (file)
@@ -551,8 +551,6 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,
       // add/sub are legal for all supported vector VT's.
       setOperationAction(ISD::ADD, VT, Legal);
       setOperationAction(ISD::SUB, VT, Legal);
-      if (VT.getSizeInBits() == 128)
-        setOperationAction(ISD::ABS, VT, Custom);
 
       // Vector instructions introduced in P8
       if (Subtarget.hasP8Altivec() && (VT.SimpleTy != MVT::v1i128)) {
@@ -638,6 +636,9 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,
       }
     }
 
+    for (auto VT : {MVT::v2i64, MVT::v4i32, MVT::v8i16, MVT::v16i8})
+      setOperationAction(ISD::ABS, VT, Custom);
+
     // We can custom expand all VECTOR_SHUFFLEs to VPERM, others we can handle
     // with merges, splats, etc.
     setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v16i8, Custom);