[PATCH] D44851: [AArch64] Decorate AArch64 instrs with OPERAND_PCREL
Tim Northover via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 24 04:06:13 PDT 2018
t.p.northover accepted this revision.
t.p.northover added a comment.
This revision is now accepted and ready to land.
A nice little change with big benefits! One little nit (no need to reupload here after fixing, I think):
================
Comment at: lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp:147
+
+ int64_t Imm = Inst.getOperand(0).getImm() << 2;
+ Target = Addr + Imm;
----------------
This is UB for negative immediates (at least until C++20). Probably best as `* 4`.
Repository:
rL LLVM
https://reviews.llvm.org/D44851
More information about the llvm-commits
mailing list