[PATCH] D37989: InstCombine: Insert missing canonicalizes

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 27 11:02:36 PST 2017


huh, minnum and maxnum return canonicalized values?

that’s interesting, because on our target, they don’t (our min/max acts as a select operation insomuch as it cannot modify the selectands).

what determines which operations canonicalize and which don’t?

—escha

> On Sep 18, 2017, at 12:08 PM, Matt Arsenault via Phabricator <reviews at reviews.llvm.org> wrote:
> 
> arsenm created this revision.
> Herald added subscribers: nhaehnle, wdng.
> 
> minnum/maxnum are supposed to return a canonicalized value.
> We were folding cases where one of the operands is constant
> without inserting the appropriate canonicalize. Also fix
> the LangRef to mention the canonicalize part of the IEEE
> definition.
> 
> 
> https://reviews.llvm.org/D37989
> 
> Files:
>  docs/LangRef.rst
>  include/llvm/IR/IRBuilder.h
>  lib/IR/IRBuilder.cpp
>  lib/Transforms/InstCombine/InstCombineCalls.cpp
>  test/Transforms/InstCombine/AMDGPU/amdgcn-intrinsics.ll
>  test/Transforms/InstCombine/maxnum.ll
>  test/Transforms/InstCombine/minnum.ll
> 
> <D37989.115698.patch>



More information about the llvm-commits mailing list