From: Evan Cheng Date: Wed, 18 Jan 2006 08:08:38 +0000 (+0000) Subject: If a call return type is i1, insert a truncate from X86::AL to i1. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=68e5d084f1a51e71b38aceb8ccc12734adcce9ef;p=oota-llvm.git 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 --- diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 1d71891dc50..6a656142f7d 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);