This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel][AArch64] Don't emit cset for G_FCMPs feeding into G_BRCONDs
ClosedPublic

Authored by paquette on Sep 30 2020, 5:17 PM.

Details

Summary

Similar to the FP case in AArch64TargetLowering::LowerBR_CC.

Instead of emitting the csets + a tbnz, just emit a compare + bcc (or two bccs, depending on the condition code)

This improves cases like this: https://godbolt.org/z/v8hebx

This is a 0.1% geomean code size improvement for CTMark at -O3.

Diff Detail

Event Timeline

paquette created this revision.Sep 30 2020, 5:17 PM
paquette requested review of this revision.Sep 30 2020, 5:17 PM
aemerson added inline comments.Sep 30 2020, 5:31 PM
llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
1327

What else could the opcode be?

paquette added inline comments.Sep 30 2020, 5:33 PM
llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
1327

Looks like SDAG has handling for overflow ops, so I guess one of those?

aemerson accepted this revision.Oct 1 2020, 1:08 PM

LGTM.

This revision is now accepted and ready to land.Oct 1 2020, 1:08 PM