[PATCH] D119967: [InstCombineCalls] Optimize call of bitcast even w/ parameter attributes

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 22 00:13:52 PST 2022


nikic added a comment.

In D119967#3327289 <https://reviews.llvm.org/D119967#3327289>, @jdoerfert wrote:

> In D119967#3327278 <https://reviews.llvm.org/D119967#3327278>, @nikic wrote:
>
>> I'm not convinced this is right when there are ABI affecting attributes involved. Consider the first example, where `zeroext` is dropped. Let's hypothetically assume that this indicates a zeroext up to 64-bit, but we have 32-bit pointers. Doing the transform and dropping the zeroext means that the top bits will be left uninitialized now.
>
> I don't think zeroext is a problem. The 64 bit case shows why, `isBitOrNoopPointerCastable` is false and we won't transform it.

I'm referring to the case where the argument is pointer-sized (so it is castable), but the (target-specific) semantics of `zeroext` require an extension beyond pointer size.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119967



More information about the llvm-commits mailing list