summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-09-09 22:06:46 +0000
committerDan Gohman <gohman@apple.com>2008-09-09 22:06:46 +0000
commit293d5f8bc02a9148238b2c79484637f56de65b9c (patch)
tree31de52cc1f309b066eefa47bfef085b6090bbbac /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parent3ef2d60e95f320fe2377d62b1f460cae44f5fdbe (diff)
downloadllvm-293d5f8bc02a9148238b2c79484637f56de65b9c.tar.gz
llvm-293d5f8bc02a9148238b2c79484637f56de65b9c.tar.bz2
llvm-293d5f8bc02a9148238b2c79484637f56de65b9c.tar.xz
Add a new option, -fast-isel-verbose, that can be used with
-fast-isel-no-abort to get a dump of all unhandled instructions, without an abort. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56021 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp36
1 files changed, 21 insertions, 15 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index a2716c2706..070bd7084e 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -60,6 +60,10 @@ static cl::opt<bool>
EnableFastISel("fast-isel", cl::Hidden,
cl::desc("Enable the experimental \"fast\" instruction selector"));
static cl::opt<bool>
+EnableFastISelVerbose("fast-isel-verbose", cl::Hidden,
+ cl::desc("Enable verbose messages in the experimental \"fast\" "
+ "instruction selector"));
+static cl::opt<bool>
DisableFastISelAbort("fast-isel-no-abort", cl::Hidden,
cl::desc("Use the SelectionDAGISel when \"fast\" instruction "
"selection fails"));
@@ -743,12 +747,12 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF) {
// feed PHI nodes in successor blocks.
if (isa<TerminatorInst>(BI))
if (!HandlePHINodesInSuccessorBlocksFast(LLVMBB, F)) {
- if (DisableFastISelAbort)
- break;
-#ifndef NDEBUG
- BI->dump();
-#endif
- assert(0 && "FastISel didn't handle a PHI in a successor");
+ if (EnableFastISelVerbose || !DisableFastISelAbort) {
+ cerr << "FastISel miss: ";
+ BI->dump();
+ }
+ if (!DisableFastISelAbort)
+ assert(0 && "FastISel didn't handle a PHI in a successor");
}
// First try normal tablegen-generated "fast" selection.
@@ -771,15 +775,17 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF) {
continue;
}
- if (!DisableFastISelAbort &&
- // For now, don't abort on non-conditional-branch terminators.
- (!isa<TerminatorInst>(BI) || isa<BranchInst>(BI))) {
- // The "fast" selector couldn't handle something and bailed.
- // For the purpose of debugging, just abort.
-#ifndef NDEBUG
- BI->dump();
-#endif
- assert(0 && "FastISel didn't select the entire block");
+ // Otherwise, give up on FastISel for the rest of the block.
+ // For now, be a little lenient about non-branch terminators.
+ if (!isa<TerminatorInst>(BI) || isa<BranchInst>(BI)) {
+ if (EnableFastISelVerbose || !DisableFastISelAbort) {
+ cerr << "FastISel miss: ";
+ BI->dump();
+ }
+ if (!DisableFastISelAbort)
+ // The "fast" selector couldn't handle something and bailed.
+ // For the purpose of debugging, just abort.
+ assert(0 && "FastISel didn't select the entire block");
}
break;
}