Skip to content

Commit 71b8787

Browse files
committed
[BOLT][AArch64] Handle PAuth call instructions in isIndirectCall
1 parent b6b40e9 commit 71b8787

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#include "AArch64InstrInfo.h"
1314
#include "AArch64MCSymbolizer.h"
1415
#include "MCTargetDesc/AArch64AddressingModes.h"
1516
#include "MCTargetDesc/AArch64FixupKinds.h"
@@ -635,7 +636,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
635636
}
636637

637638
bool isIndirectCall(const MCInst &Inst) const override {
638-
return Inst.getOpcode() == AArch64::BLR;
639+
return isIndirectCallOpcode(Inst.getOpcode());
639640
}
640641

641642
MCPhysReg getSpRegister(int Size) const {

llvm/lib/Target/AArch64/AArch64InstrInfo.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,19 @@ static inline bool isIndirectBranchOpcode(int Opc) {
726726
return false;
727727
}
728728

729+
static inline bool isIndirectCallOpcode(unsigned Opc) {
730+
switch (Opc) {
731+
case AArch64::BLR:
732+
case AArch64::BLRAA:
733+
case AArch64::BLRAB:
734+
case AArch64::BLRAAZ:
735+
case AArch64::BLRABZ:
736+
return true;
737+
default:
738+
return false;
739+
}
740+
}
741+
729742
static inline bool isPTrueOpcode(unsigned Opc) {
730743
switch (Opc) {
731744
case AArch64::PTRUE_B:

0 commit comments

Comments
 (0)