This is an archive of the discontinued LLVM Phabricator instance.

[InstSimplify] Rename SimplifyFPUnOp and SimplifyFPBinOp
ClosedPublic

Authored by foad on Jul 17 2019, 11:05 PM.

Details

Summary

SimplifyFPBinOp is a variant of SimplifyBinOp that lets you specify
fast math flags, but the name is misleading because both functions
can simplify both FP and non-FP ops. Instead, overload SimplifyBinOp
so that you can optionally specify fast math flags.

Likewise for SimplifyFPUnOp.

Diff Detail

Repository
rL LLVM

Event Timeline

foad created this revision.Jul 17 2019, 11:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 17 2019, 11:05 PM
xbolva00 added inline comments.
llvm/lib/Analysis/InstructionSimplify.cpp
59 ↗(On Diff #210484)

@spatel suggested to make FastMastFlags as last optional argument

foad added a comment.Jul 22 2019, 8:02 AM

@spatel since no-one else has commented, is this still OK to commit? Should I do anything to warn out-of-tree users about the API name change?

foad marked an inline comment as done.Jul 22 2019, 8:07 AM
foad added inline comments.
llvm/lib/Analysis/InstructionSimplify.cpp
59 ↗(On Diff #210484)

Actually I suggested that (in D64713) and @spatel "ok"ed it. But when I came to make the change, I felt that the FastMathFlags argument belonged next to the LHS and RHS arguments. Do you care deeply about the order?

spatel accepted this revision.Jul 24 2019, 5:10 AM

LGTM. This organization doesn't seem ideal to me, but I don't think it's worth holding up the functional change in D64713. If someone has a better idea, we can improve this with an NFC patch.

We're free to change LLVM internal APIs as needed, so I don't think we have to warn anyone in advance. You can send a note to llvm-dev as a courtesy if you'd like (and that would likely generate more opinions about how to better arrange the parameters/names).

llvm/include/llvm/Analysis/InstructionSimplify.h
238 ↗(On Diff #210484)

FastMathFlag ->FastMathFlags

247 ↗(On Diff #210484)

FastMathFlag ->FastMathFlags

llvm/lib/Analysis/InstructionSimplify.cpp
4567 ↗(On Diff #210484)

FastMathFlag ->FastMathFlags

4636 ↗(On Diff #210484)

FastMathFlag ->FastMathFlags

This revision is now accepted and ready to land.Jul 24 2019, 5:10 AM
This revision was automatically updated to reflect the committed changes.
foad marked 4 inline comments as done.Jul 24 2019, 5:51 AM