[AArch64] Fix ldst optimization of non-immediate store offset
authorAndrew Wei <weiwei64@huawei.com>
Wed, 23 Sep 2020 14:44:30 +0000 (22:44 +0800)
committerAndrew Wei <weiwei64@huawei.com>
Wed, 23 Sep 2020 15:00:13 +0000 (23:00 +0800)
commitc2deacd929dabded734a478e78c1eef23aa459c5
treec1b62191a04bd20ed711142b7a11c8ba1aa18199
parent91589cf679c7946edfb5b33d1eb94d723ad99e2b
[AArch64] Fix ldst optimization of non-immediate store offset

When matching store instruction for ldst opt, we should make sure store instr is in 'reg+imm' form as load instr,
otherwise, it will have assertion in isLdOffsetInRangeOfSt since it will use getImm() directly.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D87905
llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
llvm/test/CodeGen/AArch64/ldst-opt-non-imm-offset.mir [new file with mode: 0644]