[SystemZ] Handle vectors in getSetCCResultType
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Wed, 6 Nov 2013 12:16:02 +0000 (12:16 +0000)
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Wed, 6 Nov 2013 12:16:02 +0000 (12:16 +0000)
I don't have a standalone testcase for this, but it should allow r193676
to be reapplied.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194148 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SystemZ/SystemZISelLowering.cpp
lib/Target/SystemZ/SystemZISelLowering.h

index 380ce62363f43a3fff915850bc6393d9bc9270a5..4a5fb42cbefc974d202ce5ef9110f2c68a8afc86 100644 (file)
@@ -279,8 +279,13 @@ SystemZTargetLowering::SystemZTargetLowering(SystemZTargetMachine &tm)
   MaxStoresPerMemsetOptSize = 0;
 }
 
-bool
-SystemZTargetLowering::isFMAFasterThanFMulAndFAdd(EVT VT) const {
+EVT SystemZTargetLowering::getSetCCResultType(LLVMContext &, EVT VT) const {
+  if (!VT.isVector())
+    return MVT::i32;
+  return VT.changeVectorElementTypeToInteger();
+}
+
+bool SystemZTargetLowering::isFMAFasterThanFMulAndFAdd(EVT VT) const {
   VT = VT.getScalarType();
 
   if (!VT.isSimple())
index 820b6803823da284fbec895e950e14f3ab309086..c6dcca6982a6892871b2b154861e925c12f8ac23 100644 (file)
@@ -198,9 +198,7 @@ public:
   virtual MVT getScalarShiftAmountTy(EVT LHSTy) const LLVM_OVERRIDE {
     return MVT::i32;
   }
-  virtual EVT getSetCCResultType(LLVMContext &, EVT) const LLVM_OVERRIDE {
-    return MVT::i32;
-  }
+  virtual EVT getSetCCResultType(LLVMContext &, EVT) const LLVM_OVERRIDE;
   virtual bool isFMAFasterThanFMulAndFAdd(EVT VT) const LLVM_OVERRIDE;
   virtual bool isFPImmLegal(const APFloat &Imm, EVT VT) const LLVM_OVERRIDE;
   virtual bool isLegalAddressingMode(const AddrMode &AM, Type *Ty) const