================ @@ -1909,9 +1948,60 @@ void AArch64AsmPrinter::emitInstruction(const MachineInstr *MI) { emitPtrauthAuthResign(MI); return; + case AArch64::BLRA: + emitPtrauthBranch(MI); + return; + // Tail calls use pseudo instructions so they have the proper code-gen // attributes (isCall, isReturn, etc.). We lower them to the real // instruction here. + case AArch64::AUTH_TCRETURN: + case AArch64::AUTH_TCRETURN_BTI: { + const uint64_t Key = MI->getOperand(2).getImm(); + assert(Key < 2 && "Unknown key kind for authenticating tail-call return"); ---------------- kovdan01 wrote:
There are many assertions and if statements all around the code which try to check that key is either IA or IB. They look inconsistent: sometimes we have `Key < 2`, sometimes `Key == 0 || Key == 1', sometimes `Key > 1` (for an opposite check). I like the approach from `AArch64AsmPrinter::emitPtrauthBranch`: ``` assert((Key == AArch64PACKey::IA || Key == AArch64PACKey::IB) && "Invalid auth call key");` ``` It does not rely on magic constants and it's our intentions are clear. The check might be moved to a small helper, it'll be probably more handy to use it everywhere. Please make assertions and if statements checking the key against IA or IB consistent with each other. https://github.com/llvm/llvm-project/pull/85736 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits