[llvm-commits] [llvm] r81813 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp

Chris Lattner clattner at apple.com
Mon Sep 14 23:41:26 PDT 2009


On Sep 14, 2009, at 5:13 PM, Nate Begeman wrote:

> Author: sampo
> Date: Mon Sep 14 19:13:12 2009
> New Revision: 81813
>
> URL: http://llvm.org/viewvc/llvm-project?rev=81813&view=rev
> Log:
> Add an "original alignment" field to load and store nodes.  This  
> enables the
> DAG Combiner to disambiguate chains for loads and stores of types  
> which are
> broken up by the Legalizer into smaller pieces.

Hi Nate,

> +  //! OrigAlign - The original alignment of this MemSDNode in the  
> case where
> +  // this node was created by legalize from a MemSDNode with known  
> alignment.
> +  unsigned OrigAlign;

I don't understand what this means.  Is this saying that the load/ 
store is always an access to [ptr_with_some_alignment]+SVOffset?

If so, it seems that the ultimate alignment of the access is actually:
   MinAlign(OrigAlign, SVOffset)
(from MathExtras.h).

If this is true, then you can make the comment much more strong, and  
fix MemSDNode to never actually store the alignment of the access  
(store OrigAlign instead and compute the access alignment when needed).

If we do need to keep both alignments around, is there any way to  
encode this in SubclassData like the alignment field itself is to  
avoid growing MemSDNode (the biggest sdnode)?

-Chris





More information about the llvm-commits mailing list