mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
Protect the code for fast-isel debugging with #ifndef NDEBUG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58340 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f4717aa1b2
commit
727809ad8a
@ -55,6 +55,7 @@ static cl::opt<bool>
|
|||||||
EnableValueProp("enable-value-prop", cl::Hidden);
|
EnableValueProp("enable-value-prop", cl::Hidden);
|
||||||
static cl::opt<bool>
|
static cl::opt<bool>
|
||||||
DisableLegalizeTypes("disable-legalize-types", cl::Hidden);
|
DisableLegalizeTypes("disable-legalize-types", cl::Hidden);
|
||||||
|
#ifndef NDEBUG
|
||||||
static cl::opt<bool>
|
static cl::opt<bool>
|
||||||
EnableFastISelVerbose("fast-isel-verbose", cl::Hidden,
|
EnableFastISelVerbose("fast-isel-verbose", cl::Hidden,
|
||||||
cl::desc("Enable verbose messages in the \"fast\" "
|
cl::desc("Enable verbose messages in the \"fast\" "
|
||||||
@ -62,6 +63,7 @@ EnableFastISelVerbose("fast-isel-verbose", cl::Hidden,
|
|||||||
static cl::opt<bool>
|
static cl::opt<bool>
|
||||||
EnableFastISelAbort("fast-isel-abort", cl::Hidden,
|
EnableFastISelAbort("fast-isel-abort", cl::Hidden,
|
||||||
cl::desc("Enable abort calls when \"fast\" instruction fails"));
|
cl::desc("Enable abort calls when \"fast\" instruction fails"));
|
||||||
|
#endif
|
||||||
static cl::opt<bool>
|
static cl::opt<bool>
|
||||||
SchedLiveInCopies("schedule-livein-copies",
|
SchedLiveInCopies("schedule-livein-copies",
|
||||||
cl::desc("Schedule copies of livein registers"),
|
cl::desc("Schedule copies of livein registers"),
|
||||||
@ -701,8 +703,10 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF,
|
|||||||
for (Function::arg_iterator I = Fn.arg_begin(), E = Fn.arg_end();
|
for (Function::arg_iterator I = Fn.arg_begin(), E = Fn.arg_end();
|
||||||
I != E; ++I, ++j)
|
I != E; ++I, ++j)
|
||||||
if (Fn.paramHasAttr(j, Attribute::ByVal)) {
|
if (Fn.paramHasAttr(j, Attribute::ByVal)) {
|
||||||
|
#ifndef NDEBUG
|
||||||
if (EnableFastISelVerbose || EnableFastISelAbort)
|
if (EnableFastISelVerbose || EnableFastISelAbort)
|
||||||
cerr << "FastISel skips entry block due to byval argument\n";
|
cerr << "FastISel skips entry block due to byval argument\n";
|
||||||
|
#endif
|
||||||
SuppressFastISel = true;
|
SuppressFastISel = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -766,12 +770,14 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF,
|
|||||||
// feed PHI nodes in successor blocks.
|
// feed PHI nodes in successor blocks.
|
||||||
if (isa<TerminatorInst>(BI))
|
if (isa<TerminatorInst>(BI))
|
||||||
if (!HandlePHINodesInSuccessorBlocksFast(LLVMBB, FastIS)) {
|
if (!HandlePHINodesInSuccessorBlocksFast(LLVMBB, FastIS)) {
|
||||||
|
#ifndef NDEBUG
|
||||||
if (EnableFastISelVerbose || EnableFastISelAbort) {
|
if (EnableFastISelVerbose || EnableFastISelAbort) {
|
||||||
cerr << "FastISel miss: ";
|
cerr << "FastISel miss: ";
|
||||||
BI->dump();
|
BI->dump();
|
||||||
}
|
}
|
||||||
if (EnableFastISelAbort)
|
if (EnableFastISelAbort)
|
||||||
assert(0 && "FastISel didn't handle a PHI in a successor");
|
assert(0 && "FastISel didn't handle a PHI in a successor");
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -785,10 +791,12 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF,
|
|||||||
|
|
||||||
// Then handle certain instructions as single-LLVM-Instruction blocks.
|
// Then handle certain instructions as single-LLVM-Instruction blocks.
|
||||||
if (isa<CallInst>(BI)) {
|
if (isa<CallInst>(BI)) {
|
||||||
|
#ifndef NDEBUG
|
||||||
if (EnableFastISelVerbose || EnableFastISelAbort) {
|
if (EnableFastISelVerbose || EnableFastISelAbort) {
|
||||||
cerr << "FastISel missed call: ";
|
cerr << "FastISel missed call: ";
|
||||||
BI->dump();
|
BI->dump();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (BI->getType() != Type::VoidTy) {
|
if (BI->getType() != Type::VoidTy) {
|
||||||
unsigned &R = FuncInfo->ValueMap[BI];
|
unsigned &R = FuncInfo->ValueMap[BI];
|
||||||
@ -803,6 +811,7 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
// Otherwise, give up on FastISel for the rest of the block.
|
// Otherwise, give up on FastISel for the rest of the block.
|
||||||
// For now, be a little lenient about non-branch terminators.
|
// For now, be a little lenient about non-branch terminators.
|
||||||
if (!isa<TerminatorInst>(BI) || isa<BranchInst>(BI)) {
|
if (!isa<TerminatorInst>(BI) || isa<BranchInst>(BI)) {
|
||||||
@ -815,6 +824,7 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF,
|
|||||||
// For the purpose of debugging, just abort.
|
// For the purpose of debugging, just abort.
|
||||||
assert(0 && "FastISel didn't select the entire block");
|
assert(0 && "FastISel didn't select the entire block");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user