From 1060b9e23b8f9d2802835896947ec281ba3b4f6b Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Sat, 4 Jan 2020 17:06:47 -0500 Subject: GlobalISel: Correct result type for G_FCMP in lowerFPTOUI Using the final result type doesn't make any sense. Use the natural default boolean type for the select condition. --- llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp index 52c43f0cc93..bb3ece32c1a 100644 --- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp @@ -3996,8 +3996,10 @@ LegalizerHelper::lowerFPTOUI(MachineInstr &MI, unsigned TypeIdx, LLT Ty) { MachineInstrBuilder ResHighBit = MIRBuilder.buildConstant(DstTy, TwoPExpInt); MachineInstrBuilder Res = MIRBuilder.buildXor(DstTy, ResLowBits, ResHighBit); + const LLT S1 = LLT::scalar(1); + MachineInstrBuilder FCMP = - MIRBuilder.buildFCmp(CmpInst::FCMP_ULT, DstTy, Src, Threshold); + MIRBuilder.buildFCmp(CmpInst::FCMP_ULT, S1, Src, Threshold); MIRBuilder.buildSelect(Dst, FCMP, FPTOSI, Res); MI.eraseFromParent(); -- cgit v1.2.3