From 68e5d084f1a51e71b38aceb8ccc12734adcce9ef Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Wed, 18 Jan 2006 08:08:38 +0000 Subject: If a call return type is i1, insert a truncate from X86::AL to i1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25415 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 1d71891..6a65614 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -531,6 +531,8 @@ X86TargetLowering::LowerCCCCallTo(SDOperand Chain, const Type *RetTy, case MVT::i8: RetVal = DAG.getCopyFromReg(Chain, X86::AL, MVT::i8, InFlag); Chain = RetVal.getValue(1); + if (RetTyVT == MVT::i1) + RetVal = DAG.getNode(ISD::TRUNCATE, MVT::i1, RetVal); break; case MVT::i16: RetVal = DAG.getCopyFromReg(Chain, X86::AX, MVT::i16, InFlag); @@ -1057,6 +1059,8 @@ X86TargetLowering::LowerFastCCCallTo(SDOperand Chain, const Type *RetTy, case MVT::i8: RetVal = DAG.getCopyFromReg(Chain, X86::AL, MVT::i8, InFlag); Chain = RetVal.getValue(1); + if (RetTyVT == MVT::i1) + RetVal = DAG.getNode(ISD::TRUNCATE, MVT::i1, RetVal); break; case MVT::i16: RetVal = DAG.getCopyFromReg(Chain, X86::AX, MVT::i16, InFlag); -- cgit v1.1