Page MenuHomePhabricator

[CostModel] Add really basic support for being able to query the cost of the FNeg instruction.
ClosedPublic

Authored by craig.topper on May 24 2019, 10:55 PM.

Details

Summary

This reuses the getArithmeticInstrCost, but passes dummy values of the second
operand flags.

The X86 costs are wrong and can be improved in a follow up. I just wanted to
stop it from reporting an unknown cost first.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.May 24 2019, 10:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2019, 10:55 PM
Herald added a subscriber: hiraditya. · View Herald Transcript

Add the tests first as a preliminary step?
Make sure I'm seeing it correctly: neither default nor x86 override is distinguishing the fsub idiom from normal fsub currently?

Add the tests first as a preliminary step?
Make sure I'm seeing it correctly: neither default nor x86 override is distinguishing the fsub idiom from normal fsub currently?

Yeah doesn't look like we recognize fsub -0.0, X as special currently.

Rebase after pre-committing test

Really rebase it. I hadn't pulled after pushing the test so arcanist merged the two commits.

spatel accepted this revision.May 27 2019, 7:24 AM

LGTM

This revision is now accepted and ready to land.May 27 2019, 7:24 AM
This revision was automatically updated to reflect the committed changes.