[PATCH] D61419: Support FNeg ConstantExpr folding

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 16:32:25 PDT 2019


cameron.mcinally added a comment.

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

> 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?


I'll retract this statement. The InstructionSimplify work wasn't as bad as it first appeared. There are users of InstructionSimplify that will need to be updated to take advance of the UnaryOps, but those don't have to be done right away.

Patch incoming...


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