[PATCH] D61419: Support FNeg constant folding

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 10:15:18 PDT 2019


cameron.mcinally added a comment.

Couple of updates...

In D61419#1487929 <https://reviews.llvm.org/D61419#1487929>, @cameron.mcinally wrote:

> In D61419#1487834 <https://reviews.llvm.org/D61419#1487834>, @spatel wrote:
>
> > Let me know if I'm not seeing it correctly, but the DAG change is independent of the IR changes, so it should be a stand-alone patch.
>
>
> Yes, you're correct. Kind of... I noticed that FNeg wasn't folding vectors with some undef elements correctly while working on this change. I can separate that patch if you'd like.


This actually can't be separated out. We were mistakenly generating an FSub, instead of an FNeg in the IRBuilder, so the DAG code won't trigger without the IRBuilder change. I won't be able to write a test for it without that change (at least that I know about right now) .

> I would expect -instsimplify to work.

@arsenm, the InstructionSimplify pass has a whole different sets of folds from the ConstantExpr folds. Piling on top of that, we'll have to add support for UnaryInstructions to the other passes that make use of InstructionSimplify. That seems like a big change. @kpn is also working on D61447 <https://reviews.llvm.org/D61447>, which I just found out about. I propose adding the ConstantExpr folding changes as-is, with the expectation that InstructionSimplify folding (and probably other places that I don't know about) will have to be done too. Does anyone feel strongly against this?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61419





More information about the llvm-commits mailing list