Reland r329956, "AArch64: Introduce a DAG combine for folding offsets into addresses...
authorPeter Collingbourne <peter@pcc.me.uk>
Mon, 23 Apr 2018 19:09:34 +0000 (19:09 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Mon, 23 Apr 2018 19:09:34 +0000 (19:09 +0000)
commit5ab4a4793efbe8805c3fedc8f6625ebad987ce7b
treef160a8e343181015aee8ce2b4d54dc4e1dee4794
parentcc45e923c5c1be906ad9b56b2665b954f78c4a49
Reland r329956, "AArch64: Introduce a DAG combine for folding offsets into addresses.", with a fix for the bot failure.

This reland includes a check to prevent the DAG combiner from folding an
offset that is smaller than the existing one. This can cause oscillations
between two possible DAGs, which was the cause of the hang and later assertion
failure observed on the lnt-ctmark-aarch64-O3-flto bot.
http://green.lab.llvm.org/green/job/lnt-ctmark-aarch64-O3-flto/2024/

Original commit message:
> This is a code size win in code that takes offseted addresses
> frequently, such as C++ constructors that typically need to compute
> an offseted address of a vtable. This reduces the size of Chromium
> for Android's .text section by 108KB.

Differential Revision: https://reviews.llvm.org/D45199

llvm-svn: 330630
llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/arm64-addrmode.ll
llvm/test/CodeGen/AArch64/arm64-vector-ldst.ll
llvm/test/CodeGen/AArch64/fold-global-offsets.ll [new file with mode: 0644]
llvm/test/CodeGen/AArch64/global-merge-3.ll
llvm/test/CodeGen/AArch64/global-merge-ignore-single-use-minsize.ll
llvm/test/CodeGen/AArch64/global-merge-ignore-single-use.ll