[llvm-commits] [llvm] r97211 - /llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp

Chandler Carruth chandlerc at google.com
Fri Feb 26 00:43:59 PST 2010


This started breaking a PIC test for all the build bots. I've reverted
it and r97213 in order to get the tests passing again. Please fix the
tests prior to submitting, and watch the build bots for failures on
other platforms.

On Thu, Feb 25, 2010 at 11:27 PM, Sanjiv Gupta
<sanjiv.gupta at microchip.com> wrote:
> Author: sgupta
> Date: Fri Feb 26 01:27:35 2010
> New Revision: 97211
>
> URL: http://llvm.org/viewvc/llvm-project?rev=97211&view=rev
> Log:
> Before converting an operand to mem, check if it is legal to do so.
>
> Modified:
>    llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp
>
> Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp?rev=97211&r1=97210&r2=97211&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Fri Feb 26 01:27:35 2010
> @@ -1527,10 +1527,24 @@
>     return true;
>
>   if (isDirectLoad(Op.getOperand(1))) {
> -    if (Op.getOperand(1).hasOneUse())
> -      return false;
> -    else
> -      MemOp = 1;
> +    if (Op.getOperand(1).hasOneUse()) {
> +      // Legal and profitable folding check uses the NodeId of DAG nodes.
> +      // This NodeId is assigned by topological order. Therefore first
> +      // assign topological order then perform legal and profitable check.
> +      // Note:- Though this ordering is done before begining with legalization,
> +      // newly added node during legalization process have NodeId=-1 (NewNode)
> +      // therefore before performing any check proper ordering of the node is
> +      // required.
> +      DAG.AssignTopologicalOrder();
> +
> +      // Direct load operands are folded in binary operations. But before folding
> +      // verify if this folding is legal. Fold only if it is legal otherwise
> +      // convert this direct load to a separate memory operation.
> +      if(ISel->IsLegalToFold(Op.getOperand(1), Op.getNode(), Op.getNode()))
> +         return false;
> +      else
> +         MemOp = 1;
> +    }
>   }
>   return true;
>  }
>
>
> _______________________________________________
> 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