This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Try to use less instructions to materialize 64-bit constant when High32=Low32
ClosedPublic

Authored by Esme on Aug 22 2023, 1:46 AM.

Details

Summary

Materialization a 64-bit constant with High32=Low32 only requires 2 instructions instead of 3 when Low32 can be materialized in 1 instruction.

Diff Detail

Event Timeline

Esme created this revision.Aug 22 2023, 1:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2023, 1:46 AM
Esme requested review of this revision.Aug 22 2023, 1:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2023, 1:46 AM
qiucf added a subscriber: qiucf.Aug 22 2023, 1:58 AM
qiucf added inline comments.
llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
1182–1188

Can we remove this part? I think it's already been handled.

lkail added a subscriber: lkail.Aug 22 2023, 2:01 AM
lkail added inline comments.
llvm/test/CodeGen/PowerPC/constants-i64.ll
427

Please pre-commit these test cases.

Esme added inline comments.Aug 22 2023, 2:32 AM
llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
1182–1188

Do you mean the case where 3 instructions are needed?
If we remove it, we will use 4 instructions for constants like 0xFFF7C000FFF7C000.

Esme updated this revision to Diff 552621.Aug 23 2023, 1:27 AM
Esme marked an inline comment as done.
Esme added reviewers: qiucf, lkail.

Address comments.

Esme added a comment.Sep 4 2023, 7:21 PM

Gentle ping

qiucf accepted this revision as: qiucf.Sep 4 2023, 10:46 PM

LGTM, thanks.

This revision is now accepted and ready to land.Sep 4 2023, 10:46 PM
This revision was landed with ongoing or failed builds.Sep 7 2023, 10:04 AM
This revision was automatically updated to reflect the committed changes.