[PATCH] D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc

Mandeep Singh Grang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 4 11:39:10 PST 2019


mgrang marked an inline comment as done.
mgrang added inline comments.


================
Comment at: lib/Target/AArch64/AArch64MCInstLower.cpp:212
+  else if ((MO.getTargetFlags() & AArch64II::MO_FRAGMENT) == AArch64II::MO_G0)
+    RefFlags |= AArch64MCExpr::VK_G0;
+
----------------
The problem with setting VK_NC (if MO_NC is set) is that a lot of unit tests fail with the following assert:

```
        adrp    x0, "??_C at foo@"
        add     x0, x0, Invalid ELF symbol kind
UNREACHABLE executed at /local/mnt/workspace/mgrang/comm/src/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.cpp:78!

```

This is because a lot of flags like VK_PAGEOFF/VK_PAGE, etc also have to be set (like LowerSymbolELF does it). I am not sure that should be done in this patch.

Should I then restrict setting VK_NC only if one of MO_G3/MO_G2/MO_G1/MO_G0 and MO_NC are set?


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

https://reviews.llvm.org/D56037





More information about the llvm-commits mailing list