This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] NFC: Refactor G_FCMP selection code
ClosedPublic

Authored by paquette on Sep 30 2020, 2:05 PM.

Details

Summary

Refactor this so it's similar to the existing integer comparison code.

Also add some missing 64-bit testcases to select-fcmp.mir.

Refactoring to prep for improving selection for G_FCMP-related conditional branches etc.

Diff Detail

Event Timeline

paquette created this revision.Sep 30 2020, 2:05 PM
paquette requested review of this revision.Sep 30 2020, 2:05 PM
aemerson accepted this revision.Sep 30 2020, 3:38 PM

A few minor comments.

llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
177

No Pred in args.

252

Seeing as we seem to only ever need the 32 bit variant. Can document DstReg to be a 32 bit scalar register. And in the bodies assert that its a 32 bit scalar type rather than return nullptr.

3940

This can be const.

llvm/test/CodeGen/AArch64/GlobalISel/select-fcmp.mir
79

Nit: %1 seems to be unused in these two tests (and others in the file but no bother).

This revision is now accepted and ready to land.Sep 30 2020, 3:38 PM