Generate more efficient code for casting booleans to integers (no sign extension required)

llvm-svn: 13439
This commit is contained in:
Chris Lattner 2004-05-09 22:28:45 +00:00
parent 8ccfc21a0f
commit d18c637a37

View File

@ -3051,7 +3051,7 @@ void ISel::emitCastOperation(MachineBasicBlock *BB,
{ X86::MOVZX16rr8, X86::MOVZX32rr8, X86::MOVZX32rr16, X86::MOV32rr } // u { X86::MOVZX16rr8, X86::MOVZX32rr8, X86::MOVZX32rr16, X86::MOV32rr } // u
}; };
bool isUnsigned = SrcTy->isUnsigned(); bool isUnsigned = SrcTy->isUnsigned() || SrcTy == Type::BoolTy;
BuildMI(*BB, IP, Opc[isUnsigned][SrcClass + DestClass - 1], 1, BuildMI(*BB, IP, Opc[isUnsigned][SrcClass + DestClass - 1], 1,
DestReg).addReg(SrcReg); DestReg).addReg(SrcReg);