[AArch64][GlobalISel] Fold a chain of two G_PTR_ADDs of constant offsets.
authorAmara Emerson <aemerson@apple.com>
Tue, 7 Jan 2020 18:52:26 +0000 (10:52 -0800)
committerAmara Emerson <aemerson@apple.com>
Tue, 7 Jan 2020 22:12:42 +0000 (14:12 -0800)
commitb6598bcf4b81ed8fb66a7c576a81e422750b9329
tree49330305baf3f4b7abe20d8ba03a8e895e69684f
parenteee89cd5a89e9c1cc33d98a1a2d21e042c54b066
[AArch64][GlobalISel] Fold a chain of two G_PTR_ADDs of constant offsets.

E.g.
%addr1 = G_PTR_ADD %base, G_CONSTANT 20
%addr2 = G_PTR_ADD %addr1, G_CONSTANT 8
  -->
%addr2 = G_PTR_ADD %base, G_CONSTANT 28

Differential Revision: https://reviews.llvm.org/D72351
llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
llvm/include/llvm/Target/GlobalISel/Combine.td
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-ptradd-chain.mir [new file with mode: 0644]