[PATCH] D124514: [ArgPromotion] Make a non-byval promotion attempt first

Pavel Samolysov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 28 10:16:50 PDT 2022


psamolysov added a comment.

I've updated the tests to forbid non-byval promotion and let byval chance to work. As I see, not only 'store' is allowed for byval (but not every 'store', for not-densely packed structures, with x86_fp80, for example, stores makes 'canPaddingBeAccessed' to return 'true') but GEPs with non constant indexes too. I think there could be other instructions that is allowed for byval but not allowed for 'usual' promoting, in fact, if isDenselyPacked returns 'true', any user is possible: store, cmp, etc. because byval promotion just replaces passing a structure by value with passing it's elements without care about how they are used if the structure is densely packed or a GEP with non-const index is the only user.

By the way, should GEP with non constant index be a flag that padding can be accessed and in this case the canPaddingBeAccessed function should return 'true'?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124514



More information about the llvm-commits mailing list