This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add test cases showing inefficient materialization for stores of immediates. NFC
ClosedPublic

Authored by craig.topper on Aug 10 2021, 12:35 PM.

Details

Summary

DAGCombiner::visitStore can call GetDemandedBits which will remove
upper bits from immediates. The upper bits are important for good
materialization of negative constants on RISCV. GetDemandedBits is a
different mechanism than SimplifyDemandedBits so
TargetShrinkDemandedConstant can't block it.

As far as I know this behavior is unique to stores.

I think we can fix this in isel using a concept similar to D107658.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 10 2021, 12:35 PM
craig.topper requested review of this revision.Aug 10 2021, 12:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2021, 12:35 PM
Herald added a subscriber: MaskRay. · View Herald Transcript

Oh for a second I thought "bad" meant "incorrect". Perhaps something like "inefficient" is clearer?

craig.topper retitled this revision from [RISCV] Add test cases showing bad materialization for stores of immediates. NFC to [RISCV] Add test cases showing inefficient materialization for stores of immediates. NFC.Aug 11 2021, 9:12 AM

Oh for a second I thought "bad" meant "incorrect". Perhaps something like "inefficient" is clearer?

Fixed

frasercrmck accepted this revision.Aug 11 2021, 9:19 AM

Cheers, LGTM

This revision is now accepted and ready to land.Aug 11 2021, 9:19 AM