HomePhabricator

[RISCV] Support Constant Pools in Load/Store Peephole

Authored by lenary on May 11 2020, 10:52 AM.

Description

[RISCV] Support Constant Pools in Load/Store Peephole

Summary:
RISC-V uses a post-select peephole pass to optimise
(load/store (ADDI $reg, %lo(addr)), 0) into (load/store $reg, %lo(addr)).
This peephole wasn't firing for accesses to constant pools, which is how we
materialise most floating point constants.

This adds support for the constantpool case, which improves code generation for
lots of small FP loading examples. I have not added any tests because this
structure is well-covered by the fp-imm.ll testcases, as well as almost
all other uses of floating point constants in the RISC-V backend tests.

Reviewed By: luismarques, asb

Differential Revision: https://reviews.llvm.org/D79523

Details

Committed
lenaryMay 11 2020, 11:20 AM
Reviewer
luismarques
Differential Revision
D79523: [RISCV] Support Constant Pools in Load/Store Peephole
Parents
rG10658691951f: [Matrix] Add matrix type to Clang.
Branches
Unknown
Tags
Unknown