[PATCH] Bug 21610: Canonicalize min/max fcmp selects to use ordered comparisons

Matt Arsenault Matthew.Arsenault at amd.com
Thu Nov 20 21:32:32 PST 2014


>>! In D6337#6, @hfinkel wrote:
> What's the motivation?

To reduce the number of cases to inspect when looking at something that looks like a min / max. I was working on matching some different versions of min and max instructions with varying NaN behavior, and kept writing patterns permuting the operands for the different cases. Plus in the bug I noticed the temporary variable changed the IR, so this seems like a basic missing canonicalization. Also ordered compares are more 'normal' and seem to be more popular and understood in the backends, so it seems preferable to us them when possible.

http://reviews.llvm.org/D6337






More information about the llvm-commits mailing list