[all-commits] [llvm/llvm-project] 23a507: [RISCV] LUI used for address computation should no...

Haocong Lu via All-commits all-commits at lists.llvm.org
Fri Feb 11 23:21:55 PST 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 23a50736004e94704a2393aa36a905d737f2b20f
  Author: Haocong.Lu <Haocong.Lu at streamcomputing.com>
  Date:   2022-02-12 (Sat, 12 Feb 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
    M llvm/test/CodeGen/RISCV/unroll-loop-cse.ll

  Log Message:
  [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

More information about the All-commits mailing list