[PATCH] SelectionDAG: Remove #if NDEBUG from check for a post-isel hook

Hal Finkel hfinkel at anl.gov
Thu Sep 25 10:09:23 PDT 2014


----- Original Message -----
> From: "Tom Stellard" <thomas.stellard at amd.com>
> To: llvm-commits at cs.uiuc.edu
> Cc: "Tom Stellard" <thomas.stellard at amd.com>
> Sent: Thursday, September 25, 2014 10:52:19 AM
> Subject: [PATCH] SelectionDAG: Remove #if NDEBUG from check for a post-isel	hook
> 
> The InstrEmitter will skip the check of MI.hasPostISelHook()
> before calling AdjustInstrPostInstrSelection() when NDEBUG
> is not defined.
> 
> This was added in r140228, and I'm not sure if it is intentional or
> not,
> but it is a likely source for bugs, because it means with
> Release+Asserts builds you can forget to set the hasPostISelHook
> flag on TableGen definitions and AdjustInstrPostInstrSelection() will
> still be called.

I agree, please change this.

 -Hal

> ---
>  lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
> b/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
> index 6661aca..4d6de12 100644
> --- a/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
> +++ b/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
> @@ -865,9 +865,7 @@ EmitMachineNode(SDNode *Node, bool IsClone, bool
> IsCloned,
>      MIB->setPhysRegsDeadExcept(UsedRegs, *TRI);
>  
>    // Run post-isel target hook to adjust this instruction if needed.
> -#ifdef NDEBUG
>    if (II.hasPostISelHook())
> -#endif
>      TLI->AdjustInstrPostInstrSelection(MIB, Node);
>  }
>  
> --
> 1.8.5.5
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list