From 76e0ff6b5d7eb15d9d315d560400e06f8777ba50 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 28 Jun 2018 17:27:09 +0000 Subject: [PATCH] [WebAssembly] Add getSetCCResultType placeholder override to handle vector compare results. Necessary to get the rL335821 bugfix (which was reverted at rL335871) un-reverted. llvm-svn: 335884 --- lib/Target/WebAssembly/WebAssemblyISelLowering.cpp | 9 +++++++++ lib/Target/WebAssembly/WebAssemblyISelLowering.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp index 633af3e8752..283e703e1f6 100644 --- a/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp +++ b/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp @@ -429,6 +429,15 @@ bool WebAssemblyTargetLowering::isIntDivCheap(EVT VT, return true; } +EVT WebAssemblyTargetLowering::getSetCCResultType(const DataLayout &DL, + LLVMContext &C, + EVT VT) const { + if (VT.isVector()) + return VT.changeVectorElementTypeToInteger(); + + return TargetLowering::getSetCCResultType(DL, C, VT); +} + //===----------------------------------------------------------------------===// // WebAssembly Lowering private implementation. //===----------------------------------------------------------------------===// diff --git a/lib/Target/WebAssembly/WebAssemblyISelLowering.h b/lib/Target/WebAssembly/WebAssemblyISelLowering.h index ba42d20a2c7..79819493ac6 100644 --- a/lib/Target/WebAssembly/WebAssemblyISelLowering.h +++ b/lib/Target/WebAssembly/WebAssemblyISelLowering.h @@ -64,6 +64,9 @@ class WebAssemblyTargetLowering final : public TargetLowering { bool *Fast) const override; bool isIntDivCheap(EVT VT, AttributeList Attr) const override; + EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, + EVT VT) const override; + SDValue LowerCall(CallLoweringInfo &CLI, SmallVectorImpl &InVals) const override; bool CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF,