[PATCH] D104641: [LICM] Strip context sensitive attributes after call hoisting
Anna Thomas via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 23 12:29:21 PDT 2021
anna added inline comments.
================
Comment at: llvm/lib/IR/Instructions.cpp:350
+
+ // Whitelist attributes we should strip.
+ static constexpr Attribute::AttrKind ParamAttrsToStrip[] = {
----------------
jdoerfert wrote:
> We got rid of "whitelist". It is also weird to call it that as we actually remove those. I'm not sure having a list here is great. Should we have a `Attribute::isABIrelated()` instead?
Yeah. I think `isABIRelated` is a good choice here. I'll add that function and use it here, instead of a list. It also tests the theory that only ABI related attributes is illegal to strip.
================
Comment at: llvm/lib/IR/Instructions.cpp:353
+ Attribute::NonNull, Attribute::Alignment, Attribute::NoAlias,
+ Attribute::Dereferenceable};
+ for (unsigned ArgNo = 0; ArgNo < getNumArgOperands(); ArgNo++) {
----------------
nikic wrote:
> We already have removeParamUndefImplyingAttributes() with a similar but not same list of attributes. I'm not sure if the desired semantics line up, but if they do it would be good to extend/reuse that.
Looking at that code piece, I don't think they line up for what's required here. Specifically, it is for updating attributes if a given parameter has undefined/poison behaviour in it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104641/new/
https://reviews.llvm.org/D104641
More information about the llvm-commits
mailing list