[PATCH] 'CSE' of ADRP instructions used for load/store addressing

Tim Northover t.p.northover at gmail.com
Fri Apr 4 00:27:57 PDT 2014


Hi Jiangning,

> I finally got time to look into ARM64 back-end, and now I think ARM64
> introduced a so-called LOH(Link Optimization Hint) to mark each instruction
> in the pattern "adrp + add + ld/st" as I mentioned above, so finally ARM64
> intends to expose all of them to linker and ask link time optimization to
> remove redundant adrp and fuse add into ld/st as mentioned in file
> ARM64CollectLOH.cpp.

I think your approach is useful for both targets. The Apple LOH system
only really replaces instructions with NOPs, which are cheap but not
entirely free (in terms of decode resources & I$). I view it as a last
ditch attempt when all else has failed.

Your enhancement to GlobalMerge seems to stop the instructions
existing in the first place, which has to be better where possible. It
should be a useful addition to LOH, though certain aspects of ARM64
currently mean it doesn't exploit that yet.

I suspect the changes wouldn't be too difficult.

Cheers.

Tim.



More information about the llvm-commits mailing list