[llvm] [InstCombine] Combine ptrauth constants into ptrauth intrinsics. (PR #94705)
Daniil Kovalev via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 16 22:02:34 PDT 2024
================
@@ -2643,13 +2643,14 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
// (sign|resign) + (auth|resign) can be folded by omitting the middle
// sign+auth component if the key and discriminator match.
bool NeedSign = II->getIntrinsicID() == Intrinsic::ptrauth_resign;
+ Value *Ptr = II->getArgOperand(0);
Value *Key = II->getArgOperand(1);
Value *Disc = II->getArgOperand(2);
// AuthKey will be the key we need to end up authenticating against in
// whatever we replace this sequence with.
Value *AuthKey = nullptr, *AuthDisc = nullptr, *BasePtr;
- if (auto CI = dyn_cast<CallBase>(II->getArgOperand(0))) {
+ if (auto *CI = dyn_cast<CallBase>(Ptr)) {
----------------
kovdan01 wrote:
nit
```suggestion
if (const auto *CI = dyn_cast<CallBase>(Ptr)) {
```
https://github.com/llvm/llvm-project/pull/94705
More information about the llvm-commits
mailing list