[PATCH] D67602: GlobalISel: Handle llvm.read_register

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 10:02:30 PDT 2019


paquette added a comment.

Even though this was reverted, I'm going to necromance it to point out an issue with the approach wrt AArch64 in the inline comments.

Maybe a G_READ_REGISTER/G_WRITE_REGISTER opcode would be a better approach?



================
Comment at: lib/CodeGen/GlobalISel/IRTranslator.cpp:1529
+    EVT VT = TLI->getValueType(*DL, CI.getType());
+    Register Reg = TLI->getRegisterByName(RegStr->getString().data(), VT, *MF);
+    if (!Reg.isValid())
----------------
`TLI->getRegisterByName` can't handle sysregs on the AArch64 side, since they're modelled as immediate operands. So, this approach can't work for AArch64.

(see llvm/test/CodeGen/AArch64/special-reg.ll for an example)


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

https://reviews.llvm.org/D67602





More information about the llvm-commits mailing list