[PATCH] D86906: [AArch64LdStOptimzation] fix a bug in AArch64 Load Store Optimization

Congzhe Cao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 12:24:45 PDT 2020


congzhe added inline comments.


================
Comment at: llvm/test/CodeGen/AArch64/aarch64-ldst-subsuperReg-no-ldp.mir:30
+
+  @m = common dso_local local_unnamed_addr global %struct.a zeroinitializer, align 1
+  @n = common dso_local local_unnamed_addr global i32 0, align 4
----------------
fhahn wrote:
> congzhe wrote:
> > fhahn wrote:
> > > Is it possible to strip the IR references from the MIR test? Ideally most/all of the IR function here can be dropped.
> > I spent effort trying to drop out the IR, but since some global variables such as `@_MergedGlobals` or `@i` are used in the mir, if I were to drop the IR `llc` would report undefined global variables error. Is there a way that I can drop the IR while still being able to run the mir? @fhahn 
> I think it should be possible to get rid of the IR references by re-writing the address computations to use the same base register but with different offsets to ensure it is clear there is no aliasing going on. Reduced test case:
> ```
> ---
> name:            test
> tracksRegLiveness: true
> body:             |
>   bb.0:
>     liveins: $x9, $x11
> 
>     renamable $w10 = LDRWui renamable $x9, 2 :: (load 4)
>     STRWui killed renamable $w10, renamable $x9, 2 :: (store 4)
>     renamable $x10 = LDRSWui renamable $x9, 3 :: (load 4)
>     STRWui renamable $w11, renamable $x9, 8 :: (store 4)
>     renamable $w10 = LDRWui renamable $x9, 2 :: (load 4)
>     RET undef $lr, implicit undef $w0
> 
> ...
> ```
> 
@fhahn Thank you very much for this comment, now further reduced this mir test case.

Also the mir test case in https://reviews.llvm.org/D86956 has been further reduced.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86906/new/

https://reviews.llvm.org/D86906



More information about the llvm-commits mailing list