[PATCH] D113107: Support of expression granularity for _Float16.

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 23 13:28:35 PDT 2022


rjmccall added a comment.

In D113107#3606107 <https://reviews.llvm.org/D113107#3606107>, @zahiraam wrote:

> For this test case:
> _Float16 add_half_cr(_Float16 a, _Float16 b) {
>
>   return a > b ? a : b;
>
> }
>
> are we expecting the phi node to be
>
> cond.true:
>
>   %2 = load float , ptr 
>   ...
>
> cond.false:
>
>   %3 = load float, ptr
>   ...
>
> %cond = phi float {{.*}} {{.*}}
>
> ?

I would say no, but if you add a promotable operation outside the `? :`, like `(a > b ? a : b) + 1`, then we should emit the ternary as a promoted value, and that should force its operands to be emitted under promotion.


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

https://reviews.llvm.org/D113107



More information about the llvm-commits mailing list