[PATCH] D126692: [InstCombine] Expand select+masked_load combine to include FP splats of -0.0

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 31 06:20:16 PDT 2022


spatel added a comment.

In D126692#3547119 <https://reviews.llvm.org/D126692#3547119>, @david-arm wrote:

> In D126692#3547055 <https://reviews.llvm.org/D126692#3547055>, @nikic wrote:
>
>> Can this be based on nsz FMF instead?
>
> I guess it depends what other reviewers think about this patch and whether it's useful or not. Another way of achieving the same result is to ensure the vectoriser uses a splat of +0.0 for the select when the nsz flag is set.

If you can get the vectorizer to produce the better IR in the first place, that would be ideal. Function attributes are the legacy annotations for fast-math; the goal is to rely on FMF whenever possible in the optimizer and codegen.

We should probably canonicalize -0.0 to +0.0 in "select nsz":
https://alive2.llvm.org/ce/z/Z_-yGP

We already canonicalize -0.0 to 0.0 in fcmp (no FMF needed in that case).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126692



More information about the llvm-commits mailing list