[llvm-commits] [llvm] r58340 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Chris Lattner
clattner at apple.com
Tue Oct 28 12:40:08 PDT 2008
On Oct 28, 2008, at 12:08 PM, Dan Gohman wrote:
> Author: djg
> Date: Tue Oct 28 14:08:46 2008
> New Revision: 58340
>
> URL: http://llvm.org/viewvc/llvm-project?rev=58340&view=rev
> Log:
> Protect the code for fast-isel debugging with #ifndef NDEBUG.
Thanks,
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Oct
> 28 14:08:46 2008
> @@ -55,6 +55,7 @@
> EnableValueProp("enable-value-prop", cl::Hidden);
> static cl::opt<bool>
> DisableLegalizeTypes("disable-legalize-types", cl::Hidden);
> +#ifndef NDEBUG
> static cl::opt<bool>
> EnableFastISelVerbose("fast-isel-verbose", cl::Hidden,
> cl::desc("Enable verbose messages in the \"fast\" "
How about:
#else
enum { EnableFastISelVerbose = 0; }
and let the compiler strip the code that uses EnableFastISelVerbose,
instead of #ifdef'ing around each use?
-Chris
>
> @@ -62,6 +63,7 @@
> static cl::opt<bool>
> EnableFastISelAbort("fast-isel-abort", cl::Hidden,
> cl::desc("Enable abort calls when \"fast\" instruction
> fails"));
> +#endif
> static cl::opt<bool>
> SchedLiveInCopies("schedule-livein-copies",
> cl::desc("Schedule copies of livein registers"),
> @@ -701,8 +703,10 @@
> for (Function::arg_iterator I = Fn.arg_begin(), E =
> Fn.arg_end();
> I != E; ++I, ++j)
> if (Fn.paramHasAttr(j, Attribute::ByVal)) {
> +#ifndef NDEBUG
> if (EnableFastISelVerbose || EnableFastISelAbort)
> cerr << "FastISel skips entry block due to byval
> argument\n";
> +#endif
> SuppressFastISel = true;
> break;
> }
> @@ -766,12 +770,14 @@
> // feed PHI nodes in successor blocks.
> if (isa<TerminatorInst>(BI))
> if (!HandlePHINodesInSuccessorBlocksFast(LLVMBB, FastIS)) {
> +#ifndef NDEBUG
> if (EnableFastISelVerbose || EnableFastISelAbort) {
> cerr << "FastISel miss: ";
> BI->dump();
> }
> if (EnableFastISelAbort)
> assert(0 && "FastISel didn't handle a PHI in a
> successor");
> +#endif
> break;
> }
>
> @@ -785,10 +791,12 @@
>
> // Then handle certain instructions as single-LLVM-
> Instruction blocks.
> if (isa<CallInst>(BI)) {
> +#ifndef NDEBUG
> if (EnableFastISelVerbose || EnableFastISelAbort) {
> cerr << "FastISel missed call: ";
> BI->dump();
> }
> +#endif
>
> if (BI->getType() != Type::VoidTy) {
> unsigned &R = FuncInfo->ValueMap[BI];
> @@ -803,6 +811,7 @@
> continue;
> }
>
> +#ifndef NDEBUG
> // 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)) {
> @@ -815,6 +824,7 @@
> // For the purpose of debugging, just abort.
> assert(0 && "FastISel didn't select the entire block");
> }
> +#endif
> break;
> }
> }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list