[PATCH] D51030: [AArch64] Optimise load(adr address) to ldr address

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 27 14:56:01 PDT 2018


efriedma added inline comments.


================
Comment at: lib/Target/AArch64/AArch64InstrInfo.td:1896
+def alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
+  return cast<LoadSDNode>(N)->getAlignment() >= 4;
+}]>;
----------------
Checking the alignment of the load isn't going to do the right thing in general; you need to check that the global is aligned.  (Normally, a misaligned load is UB, but this would turn it into a link error.)


https://reviews.llvm.org/D51030





More information about the llvm-commits mailing list