[PATCH] D57825: IR: Add immarg attribute

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 8 07:47:03 PST 2019


nhaehnle added a comment.

In D57825#1390457 <https://reviews.llvm.org/D57825#1390457>, @arsenm wrote:

> @nhaehnle can you look at the InstCombineSimplifyDemanded change? I was a bit confused by the assert you added


The background of this is that if TFE/LWE is enabled, the SimplifyDemanded logic won't work as-is; but it should also never be hit, because intrinsic calls with TFE/LWE should have a struct return type (e.g. `{v4f32,i32}`) and the SimplifyDemanded logic doesn't support looking through that. The assert double-checks that.

In hindsight, it would be possible for somebody to manually create malformed IR which calls image intrinsics with TFE/LWE enabled but with a vector return type. That would be an error, and one could argue that the code should produce an error instead of an assert. It would require a broken frontend or manually written IR, though.


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

https://reviews.llvm.org/D57825





More information about the llvm-commits mailing list