[llvm-commits] [llvm] r56292 - /llvm/trunk/lib/Target/X86/X86FastISel.cpp
Dan Gohman
gohman at apple.com
Wed Sep 17 14:18:50 PDT 2008
Author: djg
Date: Wed Sep 17 16:18:49 2008
New Revision: 56292
URL: http://llvm.org/viewvc/llvm-project?rev=56292&view=rev
Log:
FastISel: For calls, prefer using the callee's address as a constant
over having it in a register. And wait until after checking type
legality before requesting that the callee address be placed in a
register. Also, fix support for calls with void return type.
This speeds up fast-isel isel time by about 15% and reduces
instruction counts by about 3% overall on certain testcases. It also
changes many indirect calls to direct calls.
Modified:
llvm/trunk/lib/Target/X86/X86FastISel.cpp
Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=56292&r1=56291&r2=56292&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Wed Sep 17 16:18:49 2008
@@ -748,15 +748,6 @@
return false;
}
- // Materialize callee address in a register. FIXME: GV address can be
- // handled with a CALLpcrel32 instead.
- unsigned CalleeOp = getRegForValue(Callee);
- if (CalleeOp == 0) {
- if (!isa<Constant>(Callee) || !X86SelectConstAddr(Callee, CalleeOp, true))
- // Unhandled operand. Halt "fast" selection and bail.
- return false;
- }
-
// Handle only C and fastcc calling conventions for now.
CallSite CS(CI);
unsigned CC = CS.getCallingConv();
@@ -774,9 +765,21 @@
// Handle *simple* calls for now.
const Type *RetTy = CS.getType();
MVT RetVT;
- if (!isTypeLegal(RetTy, TLI, RetVT, true))
+ if (RetTy == Type::VoidTy)
+ RetVT = MVT::isVoid;
+ else if (!isTypeLegal(RetTy, TLI, RetVT, true))
return false;
+ // Materialize callee address in a register. FIXME: GV address can be
+ // handled with a CALLpcrel32 instead.
+ unsigned CalleeOp = 0;
+ if (!isa<Constant>(Callee) || !X86SelectConstAddr(Callee, CalleeOp, true)) {
+ CalleeOp = getRegForValue(Callee);
+ if (CalleeOp == 0)
+ // Unhandled operand. Halt "fast" selection and bail.
+ return false;
+ }
+
// Allow calls which produce i1 results.
bool AndToI1 = false;
if (RetVT == MVT::i1) {
More information about the llvm-commits
mailing list