[RISCV] Teach constant materialization that it can use zext.w at the end with Zba...
authorCraig Topper <craig.topper@sifive.com>
Fri, 16 Jul 2021 16:23:17 +0000 (09:23 -0700)
committerCraig Topper <craig.topper@sifive.com>
Fri, 16 Jul 2021 16:35:56 +0000 (09:35 -0700)
commit4dbb78806871b158c9ec23196f075c070baa2909
treec9ced324058b0195b00bc8658baff1f6d94a6f70
parent0ce13f92b7c6b368c0d1862d9e76540aad9629a6
[RISCV] Teach constant materialization that it can use zext.w at the end with Zba to reduce number of instructions.

If the upper 32 bits are zero and bit 31 is set, we might be able to
use zext.w to fill in the zeros after using an lui and/or addi.

Most of this patch is plumbing the subtarget features into the constant
materialization.

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D105509
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp
llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.h
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
llvm/test/CodeGen/RISCV/rv64zba.ll
llvm/test/CodeGen/RISCV/rv64zbb-zbp.ll
llvm/test/CodeGen/RISCV/xaluo.ll
llvm/test/MC/RISCV/rv64b-aliases-valid.s