[PATCH] D81678: Introduce frozen attribute at call sites for stricter poison analysis

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 23 13:59:21 PDT 2020


jdoerfert added inline comments.


================
Comment at: clang/lib/CodeGen/CGCall.cpp:4095
+    }
+  }
   call->setCallingConv(getRuntimeCC());
----------------
eugenis wrote:
> guiand wrote:
> > jdoerfert wrote:
> > > Why would we do this? Function attributes are valid at the call site, no need to copy them.
> > Do you mean that for some definition: `define @foo(i32 frozen %a, i32 frozen %b)`, it's valid to issue a call instruction like `call @foo(i32 %a, i32 %b)` and its operands will be correctly identified as `frozen`? That's the kind of behavior I was seeing and I wasn't sure if it was an error.
> If you see CallBase::paramHasAttr, function definition attributes will be taken into account when available.
> 
> I'm not sure what happens for indirect calls that do not have a Callee - we need to make sure that the frontend emits the callsite attributes that match the signature of the call.
> If you see CallBase::paramHasAttr, function definition attributes will be taken into account when available.

Yes :)

> I'm not sure what happens for indirect calls that do not have a Callee - we need to make sure that the frontend emits the callsite attributes that match the signature of the call.

This would not trigger for indirect calls, `f` would be `nullptr`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81678/new/

https://reviews.llvm.org/D81678





More information about the llvm-commits mailing list