================
@@ -2135,6 +2135,11 @@ bool 
ConstantPtrAuth::hasSpecialAddressDiscriminator(uint64_t Value) const {
 bool ConstantPtrAuth::isKnownCompatibleWith(const Value *Key,
                                             const Value *Discriminator,
                                             const DataLayout &DL) const {
+  // This function may only be validly called to analyze a ptrauth operation 
with
+  // no deactivation symbol, so if we have one it isn't compatible.
+  if (!getDeactivationSymbol()->isNullValue())
----------------
pcc wrote:

> But they would be compatible if they have the same deactivation symbol 
> wouldn't they? 

Correct.

> It seems reasonable to just compare the symbol - if there's a mismatch in 
> "present vs not present" or the relevant symbol they're compatible aren't 
> they?
> 
> You'd just need to pass in the deactivation symbol for the other scheme?

I'm not sure that it's worth the added complexity, given that it is unlikely 
that this will result in an optimization. So in this PR I just wanted to do the 
minimum to avoid miscompilations, and we can think about adding this 
optimization in a followup if it's worth it.

https://github.com/llvm/llvm-project/pull/133537
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to