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

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 16 12:55:43 PST 2022


jdoerfert added a comment.

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.

> For non-ABI attributes, I agree that just dropping them is fine.




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