Commit Graph

3 Commits

Author SHA1 Message Date
Ben Shi 0b93e90971 Revert "[RISCV] LUI used for address computation should not isAsCheapAsAMove"
This reverts commit 23a5073600.

Although this patch achieved better codegen in most cases, it is really
important to accurately describe the cost of instructions. So I revert it.
2022-02-17 17:27:37 +08:00
Haocong.Lu 23a5073600 [RISCV] LUI used for address computation should not isAsCheapAsAMove
A LUI instruction with flag RISCVII::MO_HI is usually used in conjunction
with ADDI, and jointly complete address computation. To bind the cost
evaluation of address computation, the LUI should not be regarded as a cheap
 move separately, which is consistent with ADDI.

In this test case, it improves the unroll-loop code that the rematerialization
of array's base address miss MachineCSE with Heuristics #1 at isProfitableToCSE.

Reviewed By: asb, frasercrmck

Differential Revision: https://reviews.llvm.org/D118216
2022-02-12 07:14:38 +00:00
Haocong.Lu 2e57156fea [RISCV][test] Precommit a test of CSE within an unroll loop
Reviewed By: asb, frasercrmck

Differential Revision: https://reviews.llvm.org/D118218
2022-02-12 06:30:03 +00:00