summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/FastISel.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2013-02-11 01:27:15 +0000
committerEvan Cheng <evan.cheng@apple.com>2013-02-11 01:27:15 +0000
commit092e5e75661fdd5d54a748fb00fab59d21031268 (patch)
treed75557bd1edf37b06f7f4fb7b78cf1b341fda12c /include/llvm/CodeGen/FastISel.h
parent5f352cc6e49d714bd5c14c952aa5c394fc9897bf (diff)
downloadllvm-092e5e75661fdd5d54a748fb00fab59d21031268.tar.gz
llvm-092e5e75661fdd5d54a748fb00fab59d21031268.tar.bz2
llvm-092e5e75661fdd5d54a748fb00fab59d21031268.tar.xz
Currently, codegen may spent some time in SDISel passes even if an entire
function is successfully handled by fast-isel. That's because function arguments are *always* handled by SDISel. Introduce FastLowerArguments to allow each target to provide hook to handle formal argument lowering. As a proof-of-concept, add ARMFastIsel::FastLowerArguments to handle functions with 4 or fewer scalar integer (i8, i16, or i32) arguments. It completely eliminates the need for SDISel for trivial functions. rdar://13163905 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174855 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/FastISel.h')
-rw-r--r--include/llvm/CodeGen/FastISel.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/FastISel.h b/include/llvm/CodeGen/FastISel.h
index 05619050a3..705db7e643 100644
--- a/include/llvm/CodeGen/FastISel.h
+++ b/include/llvm/CodeGen/FastISel.h
@@ -90,6 +90,11 @@ public:
/// getCurDebugLoc() - Return current debug location information.
DebugLoc getCurDebugLoc() const { return DL; }
+
+ /// LowerArguments - Do "fast" instruction selection for function arguments
+ /// and append machine instructions to the current block. Return true if
+ /// it is successful.
+ bool LowerArguments();
/// SelectInstruction - Do "fast" instruction selection for the given
/// LLVM IR instruction, and append generated machine instructions to
@@ -160,6 +165,11 @@ protected:
///
virtual bool
TargetSelectInstruction(const Instruction *I) = 0;
+
+ /// FastLowerArguments - This method is called by target-independent code to
+ /// do target specific argument lowering. It returns true if it was
+ /// successful.
+ virtual bool FastLowerArguments();
/// FastEmit_r - This method is called by target-independent code
/// to request that an instruction with the given type and opcode