[RISCV] Add sext.b/h and zext.b/h/w to RISCVInstrInfo::foldMemoryOperandImpl.
authorCraig Topper <craig.topper@sifive.com>
Thu, 21 Jul 2022 21:23:30 +0000 (14:23 -0700)
committerCraig Topper <craig.topper@sifive.com>
Thu, 21 Jul 2022 21:54:58 +0000 (14:54 -0700)
commitab2348a6fa989dbbb046976825277aa7843faa12
tree133ae38e715326b8e7422231f6f24a8809338cac
parente9afdf838eb9bb0914f58c762b676aa31b9d41d1
[RISCV] Add sext.b/h and zext.b/h/w to RISCVInstrInfo::foldMemoryOperandImpl.

We can always fold zext.b since it is just andi. The others require
Zba/Zbb.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D130302
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
llvm/lib/Target/RISCV/RISCVInstrInfo.h
llvm/test/CodeGen/RISCV/stack-folding.ll