[llvm-commits] [llvm] r56021 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Dan Gohman
gohman at apple.com
Tue Sep 9 15:06:46 PDT 2008
Author: djg
Date: Tue Sep 9 17:06:46 2008
New Revision: 56021
URL: http://llvm.org/viewvc/llvm-project?rev=56021&view=rev
Log:
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.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Sep 9 17:06:46 2008
@@ -60,6 +60,10 @@
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 @@
// 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 @@
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;
}
More information about the llvm-commits
mailing list