[llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed May 12 11:35:06 PDT 2004
Changes in directory llvm/lib/Target/X86:
InstSelectSimple.cpp updated: 1.250 -> 1.251
---
Log message:
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
---
Diffs of the changes: (+7 -1)
Index: llvm/lib/Target/X86/InstSelectSimple.cpp
diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.250 llvm/lib/Target/X86/InstSelectSimple.cpp:1.251
--- llvm/lib/Target/X86/InstSelectSimple.cpp:1.250 Mon May 10 10:15:55 2004
+++ llvm/lib/Target/X86/InstSelectSimple.cpp Wed May 12 11:35:04 2004
@@ -1207,7 +1207,7 @@
// copy.
if (ConstantInt *CI = dyn_cast<ConstantInt>(Val)) {
int TheVal = CI->getRawValue() & 0xFFFFFFFF;
- BuildMI(BB, X86::MOV32ri, 1, targetReg).addImm(TheVal);
+ BuildMI(BB, X86::MOV32ri, 1, targetReg).addImm(TheVal);
return;
}
}
@@ -1405,6 +1405,12 @@
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.
More information about the llvm-commits
mailing list