From 99f701673d1f91274e3535f4570a0e750034bf31 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 --- llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp | 9 +++++++++ llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp index 633af3e..283e703 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp +++ b/llvm/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/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h index ba42d20..7981949 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h +++ b/llvm/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, -- 2.7.4