[clang] [llvm] [AArch64][PAC] Sign block addresses used in indirectbr. (PR #97647)

Daniil Kovalev via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 8 03:50:26 PDT 2024


================
@@ -10704,15 +10728,36 @@ SDValue AArch64TargetLowering::LowerConstantPool(SDValue Op,
 
 SDValue AArch64TargetLowering::LowerBlockAddress(SDValue Op,
                                                SelectionDAG &DAG) const {
-  BlockAddressSDNode *BA = cast<BlockAddressSDNode>(Op);
+  BlockAddressSDNode *BAN = cast<BlockAddressSDNode>(Op);
+  const BlockAddress *BA = BAN->getBlockAddress();
+
+  if (std::optional<uint16_t> BADisc =
+          Subtarget->getPtrAuthBlockAddressDiscriminator(*BA->getFunction())) {
+    SDLoc DL(Op);
----------------
kovdan01 wrote:

Is there a test which covers this code path?

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


More information about the llvm-commits mailing list