[llvm] [GlobalOpt] Bail out for ConstantPtrAuth in isSimpleEnoughtToCommit. (PR #143400)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 10 01:16:04 PDT 2025


================
@@ -74,6 +74,9 @@ isSimpleEnoughValueToCommitHelper(Constant *C,
     return true;
   }
 
+  if (isa<ConstantPtrAuth>(C))
----------------
fhahn wrote:

Updated to use dyn_cast, thanks.

This checks if the constant can be lowered to something constant (or almost constant) in the backend. I'm not 100% sure how exactly the result is used, but presumably to decide whether it is worth propagating the constant to multiple places.

I think in general, ConstanPtrAuth will lowered to a set of instructions to materlize the address, followed by a ptrauth instruction, e.g. for the one in the example:

```
        adrp	x16, _foo at PAGE
	add	x16, x16, _foo at PAGEOFF
	paciza	x16
```

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


More information about the llvm-commits mailing list