forked from OSchip/llvm-project
Pass boolean constants into function calls more efficiently, generating:
mov DWORD PTR [%ESP + 4], 1 instead of: mov %EAX, 1 mov DWORD PTR [%ESP + 4], %EAX llvm-svn: 13494
This commit is contained in:
parent
66219abac7
commit
e2d382e1a4
|
@ -1405,6 +1405,12 @@ void ISel::doCall(const ValueRecord &Ret, MachineInstr *CallMI,
|
|||
unsigned ArgReg;
|
||||
switch (getClassB(Args[i].Ty)) {
|
||||
case cByte:
|
||||
if (Args[i].Val && isa<ConstantBool>(Args[i].Val)) {
|
||||
addRegOffset(BuildMI(BB, X86::MOV32mi, 5), X86::ESP, ArgOffset)
|
||||
.addImm(Args[i].Val == ConstantBool::True);
|
||||
break;
|
||||
}
|
||||
// FALL THROUGH
|
||||
case cShort:
|
||||
if (Args[i].Val && isa<ConstantInt>(Args[i].Val)) {
|
||||
// Zero/Sign extend constant, then stuff into memory.
|
||||
|
|
Loading…
Reference in New Issue