[llvm-dev] should we have IR intrinsics for integer min/max?

Sanjay Patel via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 7 12:33:13 PST 2016


Codegen is not the primary motivation here, so maybe I shouldn't have even
mentioned that. However, you can find more context in:
https://reviews.llvm.org/D26091
https://reviews.llvm.org/D26096 (note how the optimizer can regress codegen)

The main concern is that we should choose a canonical form for IR that is
easiest to reason about, and then we should transform all IR to that form.
The backend shouldn't have to pattern match all of these variants - that's
what IR is for.



On Mon, Nov 7, 2016 at 1:20 PM, Manuel Jacob <me at manueljacob.de> wrote:

> On 2016-11-07 20:01, Sanjay Patel via llvm-dev wrote:
>
>> FWIW, InstCombine doesn't canonicalize any of the first 3 options
>> currently. Codegen suffers because of that (depending on the target
>> machine
>> and data types). Regardless of the IR choice, some backend fixes are
>> needed.
>>
>
> I'm missing context here.  Can you describe in more detail how the IR
> choice affects the code generation?  In case the target has special integer
> min / max instructions, why is matching all three variants difficult?
>
> -Manuel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161107/afede71b/attachment.html>


More information about the llvm-dev mailing list