[llvm] r258296 - [SelectionDAG] Fold more offsets into GlobalAddresses

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 12:13:06 PST 2016


On 01/20/2016 08:03 AM, Dan Gohman via llvm-commits wrote:
> Author: djg
> Date: Wed Jan 20 01:03:08 2016
> New Revision: 258296
>
> URL: http://llvm.org/viewvc/llvm-project?rev=258296&view=rev
> Log:
> [SelectionDAG] Fold more offsets into GlobalAddresses
>
> SelectionDAG previously missed opportunities to fold constants into
> GlobalAddresses in several areas. For example, given `(add (add GA, c1), y)`, it
> would often reassociate to `(add (add GA, y), c1)`, missing the opportunity to
> create `(add GA+c, y)`. This isn't often visible on targets such as X86 which
> effectively reassociate adds in their complex address-mode folding logic,
> however it is currently visible on WebAssembly since it currently has very
> simple address mode folding code that doesn't reassociate anything.
>
> This patch fixes this by making SelectionDAG fold offsets into GlobalAddresses
> at the same times that it folds constants together, so that it doesn't miss any
> opportunities to perform such folding.

Hi Dan,

I see a miscompile in LNT after this patch:

http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3/builds/7631

The previous build passes and the other commits seem to be in components 
that are unlikely to even be used.

Best,
Tobias


More information about the llvm-commits mailing list