[llvm-commits] [llvm] r71457 - /llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp

Chris Lattner clattner at apple.com
Mon May 11 12:02:15 PDT 2009


On May 11, 2009, at 11:40 AM, Evan Cheng wrote:

> Author: evancheng
> Date: Mon May 11 13:40:52 2009
> New Revision: 71457
>
> URL: http://llvm.org/viewvc/llvm-project?rev=71457&view=rev
> Log:
> Unbreak non-debug build.

Is the 'break' supposed to be in the ifdef?  Why not only wrap the  
"HasFastExitPath = true;" in an #ifdef and the the optimizer strip out  
the dead check below?

-chris


>
>
> Modified:
>    llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
>
> Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=71457&r1=71456&r2=71457&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original)
> +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Mon May 11  
> 13:40:52 2009
> @@ -337,7 +337,9 @@
> void PEI::initShrinkWrappingInfo() {
>   clearAllSets();
>   EntryBlock = 0;
> +#ifndef NDEBUG
>   HasFastExitPath = false;
> +#endif
>   ShrinkWrapThisFunction = ShrinkWrapping;
>   // DEBUG: enable or disable shrink wrapping for the current function
>   // via --shrink-wrap-func=<funcname>.
> @@ -1656,7 +1658,9 @@
>     MachineBasicBlock* SUCC = *SI;
>
>     // Assume positive, disprove existence of fast path.
> +#ifndef NDEBUG
>     HasFastExitPath = true;
> +#endif
>
>     // Check the immediate successors.
>     if (isReturnBlock(SUCC)) {
> @@ -1672,17 +1676,21 @@
>       MachineBasicBlock* SBB = *BI;
>       // Reject paths with branch nodes.
>       if (SBB->succ_size() > 1) {
> +#ifndef NDEBUG
>         HasFastExitPath = false;
> +#endif
>         break;
>       }
>       exitPath += "->" + getBasicBlockName(SBB);
>     }
> +#ifndef NDEBUG
>     if (HasFastExitPath) {
>       if (ShrinkWrapDebugging >= BasicInfo)
>         DOUT << "Fast exit path: " << getBasicBlockName(EntryBlock)
>              << "->" << exitPath << "\n";
>       break;
>     }
> +#endif
>   }
> }
>
>
>
> _______________________________________________
> 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