aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-12-05 01:27:58 +0000
committerDan Gohman <gohman@apple.com>2009-12-05 01:27:58 +0000
commit581cdf90ade3d318dedde0c645d478ffede09e0d (patch)
tree3f24664a2a2050191f4a81917eec892b19cea495 /lib/CodeGen/SelectionDAG/FastISel.cpp
parent01696988ff3c98744cce105372803d4ed903f988 (diff)
downloadexternal_llvm-581cdf90ade3d318dedde0c645d478ffede09e0d.zip
external_llvm-581cdf90ade3d318dedde0c645d478ffede09e0d.tar.gz
external_llvm-581cdf90ade3d318dedde0c645d478ffede09e0d.tar.bz2
Make TargetSelectInstruction protected and called from FastISel.cpp
instead of SelectionDAGISel.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90636 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index c6c1401..4ead9c9 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -532,7 +532,15 @@ bool FastISel::SelectBitCast(User *I) {
bool
FastISel::SelectInstruction(Instruction *I) {
- return SelectOperator(I, I->getOpcode());
+ // First, try doing target-independent selection.
+ if (SelectOperator(I, I->getOpcode()))
+ return true;
+
+ // Next, try calling the target to attempt to handle the instruction.
+ if (TargetSelectInstruction(I))
+ return true;
+
+ return false;
}
/// FastEmitBranch - Emit an unconditional branch to the given block,