Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions llvm/lib/Target/AArch64/AArch64InstrInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -1798,9 +1798,6 @@ def PAUTH_PROLOGUE : Pseudo<(outs), (ins), []>, Sched<[]> {
def PAUTH_EPILOGUE : Pseudo<(outs), (ins), []>, Sched<[]>;
}

def PAUTH_BLEND : Pseudo<(outs GPR64:$disc),
(ins GPR64:$addr_disc, i32imm:$int_disc), []>, Sched<[]>;

// These pointer authentication instructions require armv8.3a
let Predicates = [HasPAuth] in {

Expand Down Expand Up @@ -10130,7 +10127,7 @@ let Predicates = [HasMOPS, HasMTE], Defs = [NZCV], Size = 12, mayLoad = 0, maySt
// v8.3 Pointer Authentication late patterns

def : Pat<(int_ptrauth_blend GPR64:$Rd, imm64_0_65535:$imm),
(PAUTH_BLEND GPR64:$Rd, (trunc_imm imm64_0_65535:$imm))>;
(MOVKXi GPR64:$Rd, (trunc_imm imm64_0_65535:$imm), 48)>;
def : Pat<(int_ptrauth_blend GPR64:$Rd, GPR64:$Rn),
(BFMXri GPR64:$Rd, GPR64:$Rn, 16, 15)>;

Expand Down
33 changes: 0 additions & 33 deletions llvm/lib/Target/AArch64/AArch64PointerAuth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ class AArch64PointerAuth : public MachineFunctionPass {
void emitBlend(MachineBasicBlock::iterator MBBI, Register Result,
Register AddrDisc, unsigned IntDisc) const;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] This function was removed as well.

/// Expands PAUTH_BLEND pseudo instruction.
void expandPAuthBlend(MachineBasicBlock::iterator MBBI) const;

bool checkAuthenticatedLR(MachineBasicBlock::iterator TI) const;
};

Expand Down Expand Up @@ -249,32 +246,6 @@ unsigned llvm::AArch64PAuth::getCheckerSizeInBytes(AuthCheckMethod Method) {
llvm_unreachable("Unknown AuthCheckMethod enum");
}

void AArch64PointerAuth::emitBlend(MachineBasicBlock::iterator MBBI,
Register Result, Register AddrDisc,
unsigned IntDisc) const {
MachineBasicBlock &MBB = *MBBI->getParent();
DebugLoc DL = MBBI->getDebugLoc();

if (Result != AddrDisc)
BuildMI(MBB, MBBI, DL, TII->get(AArch64::ORRXrs), Result)
.addReg(AArch64::XZR)
.addReg(AddrDisc)
.addImm(0);

BuildMI(MBB, MBBI, DL, TII->get(AArch64::MOVKXi), Result)
.addReg(Result)
.addImm(IntDisc)
.addImm(48);
}

void AArch64PointerAuth::expandPAuthBlend(
MachineBasicBlock::iterator MBBI) const {
Register ResultReg = MBBI->getOperand(0).getReg();
Register AddrDisc = MBBI->getOperand(1).getReg();
unsigned IntDisc = MBBI->getOperand(2).getImm();
emitBlend(MBBI, ResultReg, AddrDisc, IntDisc);
}

bool AArch64PointerAuth::runOnMachineFunction(MachineFunction &MF) {
Subtarget = &MF.getSubtarget<AArch64Subtarget>();
TII = Subtarget->getInstrInfo();
Expand All @@ -290,7 +261,6 @@ bool AArch64PointerAuth::runOnMachineFunction(MachineFunction &MF) {
break;
case AArch64::PAUTH_PROLOGUE:
case AArch64::PAUTH_EPILOGUE:
case AArch64::PAUTH_BLEND:
PAuthPseudoInstrs.push_back(MI.getIterator());
break;
}
Expand All @@ -305,9 +275,6 @@ bool AArch64PointerAuth::runOnMachineFunction(MachineFunction &MF) {
case AArch64::PAUTH_EPILOGUE:
authenticateLR(MF, It);
break;
case AArch64::PAUTH_BLEND:
expandPAuthBlend(It);
break;
default:
llvm_unreachable("Unhandled opcode");
}
Expand Down
27 changes: 0 additions & 27 deletions llvm/test/CodeGen/AArch64/ptrauth-pseudo-instructions.mir

This file was deleted.