[PATCH] D30134: AMDGPU: Fold FP clamp as modifier bit

Marek Olšák via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 09:02:51 PST 2017


mareko added a comment.

In https://reviews.llvm.org/D30134#682357, @arsenm wrote:

> In https://reviews.llvm.org/D30134#681271, @mareko wrote:
>
> > I only know that exceptions won't occur with the clamp modifier. No idea about denormals.
> >
> > Also, shouldn't this handle MIN as well?
>
>
> There's no practical reason to handle min. The higher level operation minnum(x, x) is folded to x in the IR, so this should only be appearing when we emit this pattern for the clamp operation, where max was arbitrarily chosen.


I don't understand. FPClamp(x) = min(max(x, 0), 1). I don't see min handled here, that's why I asked.


https://reviews.llvm.org/D30134





More information about the llvm-commits mailing list