This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Refactor floating point materialization. NFC
ClosedPublic

Authored by zatrazz on Mar 4 2019, 11:35 AM.

Details

Summary

It splits the login of actual instruction emission away from the logic
that figures out the appropriate sequence on.
AArch64ExpandPseudo::expandMOVImm. The new function
AArch64_IMM::expandMOVImm, which return the list of the instruction to
materialize the immediate constant, is implemented on a separated
unit because it will be used in a subsequent patch to optimize floating
point materialization.

Diff Detail

Event Timeline

zatrazz created this revision.Mar 4 2019, 11:35 AM
efriedma added inline comments.Mar 4 2019, 12:37 PM
lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
122

5?

lib/Target/AArch64/MCTargetDesc/CMakeLists.txt
5

Probably shouldn't be in MCTargetDesc; just lib/Target/AArch64/ is fine. MCTargetDesc generally only contains code used by the assembler, and there isn't any AArch64 directive that would require the assembler to expand an immediate.

zatrazz updated this revision to Diff 189346.Mar 5 2019, 10:03 AM

Updated patch based on previous comments.

Ping, only this refactor is missing review for my aarch64 fp materialization optimization.

efriedma added inline comments.Mar 14 2019, 3:04 PM
lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
124

Is LastItem supposed to be set somewhere? Why isn't it used for AArch64::ORRXri?

zatrazz marked an inline comment as done.Mar 15 2019, 6:05 AM
zatrazz added inline comments.
lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
124

It should be set for last item iteration, I will fix it. And my understanding why it is not set fo AArch64::ORRXri is the register used is always WZR/XZR.

zatrazz updated this revision to Diff 190815.Mar 15 2019, 6:06 AM

Updated patch based on previous comments.

efriedma accepted this revision.Mar 15 2019, 8:41 AM

LGTM

lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
124

Isn't the point here to try to preserve the "dead" flag? How is the operand related?

But if this actually matches the existing behavior, we can leave it for now, and clean it up later. (If the destination is actually dead, there's a much simpler way to expand the instruction... by emitting nothing at all.)

This revision is now accepted and ready to land.Mar 15 2019, 8:41 AM
zatrazz closed this revision.Mar 18 2019, 11:23 AM