This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Teach getIntImmCostInst about the cost of saturating fp converts
ClosedPublic

Authored by dmgreen on Nov 22 2021, 10:04 AM.

Details

Summary

Given a min(max(fptosi, INT_MIN), INT_MAX) with the correct constants, we can now generate a fptosi.sat. But in the arm backend, the constant can be treated as high cost, pulling it out of the basic block in a way that the DAG combine can no longer see it. This teaches it again that it is a low cost constant, not worth hoisting out.

Diff Detail

Event Timeline

dmgreen created this revision.Nov 22 2021, 10:04 AM
dmgreen requested review of this revision.Nov 22 2021, 10:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 22 2021, 10:04 AM
This revision is now accepted and ready to land.Nov 26 2021, 7:06 AM
This revision was landed with ongoing or failed builds.Dec 1 2021, 2:26 AM
This revision was automatically updated to reflect the committed changes.

Hi @dmgreen, I think this change is the cause of CodeGen/ARM/fpclamptosat.ll failing on the clang-x64-windows-msvc build bot.

Hi @dmgreen, I think this change is the cause of CodeGen/ARM/fpclamptosat.ll failing on the clang-x64-windows-msvc build bot.

Yeah, I saw. I'm not really sure what's going on, I'm not sure why it being windows matters. I've tried to fix it once to no avail, and have had to get a windows build going to see what is different. I'll revert the patch in the meantime and recommit once I can figure out why it's not working as intended.