[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

Daniil Kovalev via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed May 22 01:49:14 PDT 2024


================
@@ -1012,25 +1014,37 @@ bool AArch64CallLowering::isEligibleForTailCallOptimization(
 }
 
 static unsigned getCallOpcode(const MachineFunction &CallerF, bool IsIndirect,
-                              bool IsTailCall) {
+                              bool IsTailCall,
+                              std::optional<CallLowering::PointerAuthInfo> &PAI,
+                              MachineRegisterInfo &MRI) {
   const AArch64FunctionInfo *FuncInfo = CallerF.getInfo<AArch64FunctionInfo>();
 
-  if (!IsTailCall)
-    return IsIndirect ? getBLRCallOpcode(CallerF) : (unsigned)AArch64::BL;
+  if (!IsTailCall) {
+    if (!PAI)
+      return IsIndirect ? getBLRCallOpcode(CallerF) : (unsigned)AArch64::BL;
----------------
kovdan01 wrote:

Explicit cast to `unsigned` does not look necessary - the `AArch64::BL` is an unscoped enum with no explicit underlying type set, and the value would be casted to the function return type `unsigned` w/o the explicit cast. If there is some strong reason to have this explicit cast (please let me know if so), it should also be used below for `return AArch64::BLRA;` to keep things consistent.

https://github.com/llvm/llvm-project/pull/85736


More information about the llvm-branch-commits mailing list