[PATCH] [FastIsel][X86] Fix invalid register replacement for bool args
Juergen Ributzka
juergen at apple.com
Wed Nov 26 09:30:04 PST 2014
Hi Keno,
this looks good. Thanks for fixing this.
Cheers,
Juergen
================
Comment at: lib/Target/X86/X86FastISel.cpp:2698
@@ +2697,3 @@
+ MVT VT;
+ auto *TI = dyn_cast<TruncInst>(Val);
+ if (TI && TI->getType()->isIntegerTy(1) && CLI.CS &&
----------------
unsigned ResultReg;
================
Comment at: lib/Target/X86/X86FastISel.cpp:2714-2717
@@ -2710,5 +2713,6 @@
- if (!ResultReg)
- return false;
- updateValueMap(Val, ResultReg);
- }
+ if (!ResultReg)
+ return false;
+
+ ArgRegs.push_back(ResultReg);
+ } else {
----------------
Move this after the end of the "else" block.
================
Comment at: lib/Target/X86/X86FastISel.cpp:2721
@@ -2715,1 +2720,3 @@
+ return false;
+ ArgRegs.push_back(getRegForValue(Val));
}
----------------
ResultReg = getRegForValue(Val);
================
Comment at: lib/Target/X86/X86FastISel.cpp:2757-2758
@@ -2755,3 +2756,4 @@
+ unsigned ArgReg = ArgRegs[VA.getValNo()];
if (!ArgReg)
return false;
----------------
This check could be now removed.
================
Comment at: test/CodeGen/X86/fast-isel-call-bool.ll:7
@@ +6,3 @@
+
+; Function Attrs: sspreq
+declare i64 @bar(i1)
----------------
delete
http://reviews.llvm.org/D6245
More information about the llvm-commits
mailing list