[PATCH] D115394: [instcombine] Do demanded elts last when visiting extractelement

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 9 10:03:24 PST 2021


reames added a comment.

In D115394#3182721 <https://reviews.llvm.org/D115394#3182721>, @spatel wrote:

> Side note on poison with FMF: this came up recently in D112117 <https://reviews.llvm.org/D112117>, and I'm not sure yet how to solve it. I think the issue is that "reassoc" effectively implies "nnan" + "ninf" + "nsz". Ie, if we are allowed to reorder FP math, anything is possible, and we can't be blamed for creating any of the special FP values...otherwise, we can't safely reorder any FP math.

Well, at the moment, I'm mostly focused on simple consistency on how we handle explicit nnan and ninf flags.  We drop fmf flags (specifically no-nans and no-infs) in some cases, but not others.  At least one case we don't drop appears to be a semantic bug per the current LangRef wording.

I haven't gotten to looking at the reduction changes to see if those are spurious.  The first version of the patch I wrote changed a ton of tests, mostly undesirably.  I'm currently picking a test, figuring out what's going on, fixing that issue, then iterating.  I'll let you know once I get to the reduction question.

Note that the "does reassoc imply nnan and ninf" is basically a different question.  All that means is that we need to treat reasoc as poison generating.  The current LangRef does not say that, so it be both a LangRef and implementation change.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115394



More information about the llvm-commits mailing list