[PATCH] D80834: [AArch64] Fix CollectLOH creating an AdrpAdd LOH when there's a live used reg between the two instructions.
Amara Emerson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 1 15:11:33 PDT 2020
aemerson marked an inline comment as done.
aemerson added inline comments.
================
Comment at: llvm/test/CodeGen/AArch64/loh-use-between-adrp-add.mir:26-29
+ renamable $x15 = ADRP target-flags(aarch64-page) @rrdpb
+ STRXui renamable $x12, killed renamable $x11, 1 :: (store 8)
+ renamable $x11 = ADDXri killed renamable $x15, target-flags(aarch64-pageoff, aarch64-nc) @rrdpb, 0
+ STRXui renamable $x11, killed renamable $x11, 0
----------------
paquette wrote:
> Will this patch prevent us from making the LOH if we have something like this?
>
> ```
> $add_def = ... stuff ...
> $adrp_def = adrp ...
> $add_def = add ...
> ```
>
> If I understand correctly, it looks like the patch doesn't check if the use is actually between the adrp and add?
This change checks if the add def register has a use at the point of the ADRP, as it goes bottom up. Therefore if the use is before the ADRP, then OneUse won't be true because we haven't hit it yet. And having a def doesn't make sense because the def would be overwritten by the ADD.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80834/new/
https://reviews.llvm.org/D80834
More information about the llvm-commits
mailing list