[PATCH] D97008: [RISCV] Prune unneeded indexed load/store pseudo instructions.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 18 23:09:26 PST 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rGcd4051ac802f: [RISCV] Prune unneeded indexed load/store pseudo instructions. (authored by craig.topper).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97008/new/
https://reviews.llvm.org/D97008
Files:
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
Index: llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
===================================================================
--- llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
+++ llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
@@ -1286,15 +1286,22 @@
multiclass VPseudoILoad {
foreach eew = EEWList in {
- foreach lmul = MxList.m in
- foreach idx_lmul = MxSet<eew>.m in {
- defvar LInfo = lmul.MX;
- defvar Vreg = lmul.vrclass;
- defvar IdxLInfo = idx_lmul.MX;
- defvar IdxVreg = idx_lmul.vrclass;
- let VLMul = lmul.value in {
- def "EI" # eew # "_V_" # IdxLInfo # "_" # LInfo : VPseudoILoadNoMask<Vreg, IdxVreg>;
- def "EI" # eew # "_V_" # IdxLInfo # "_" # LInfo # "_MASK" : VPseudoILoadMask<Vreg, IdxVreg>;
+ foreach sew = EEWList in {
+ foreach lmul = MxSet<sew>.m in {
+ defvar octuple_lmul = octuple_from_str<lmul.MX>.ret;
+ // Calculate emul = eew * lmul / sew
+ defvar octuple_emul = !srl(!mul(eew, octuple_lmul), shift_amount<sew>.val);
+ if !and(!ge(octuple_emul, 1), !le(octuple_emul, 64)) then {
+ defvar LInfo = lmul.MX;
+ defvar IdxLInfo = octuple_to_str<octuple_emul>.ret;
+ defvar idx_lmul = !cast<LMULInfo>("V_" # IdxLInfo);
+ defvar Vreg = lmul.vrclass;
+ defvar IdxVreg = idx_lmul.vrclass;
+ let VLMul = lmul.value in {
+ def "EI" # eew # "_V_" # IdxLInfo # "_" # LInfo : VPseudoILoadNoMask<Vreg, IdxVreg>;
+ def "EI" # eew # "_V_" # IdxLInfo # "_" # LInfo # "_MASK" : VPseudoILoadMask<Vreg, IdxVreg>;
+ }
+ }
}
}
}
@@ -1336,17 +1343,24 @@
multiclass VPseudoIStore {
foreach eew = EEWList in {
- foreach lmul = MxList.m in
- foreach idx_lmul = MxSet<eew>.m in {
- defvar LInfo = lmul.MX;
- defvar Vreg = lmul.vrclass;
- defvar IdxLInfo = idx_lmul.MX;
- defvar IdxVreg = idx_lmul.vrclass;
- let VLMul = lmul.value in {
- def "EI" # eew # "_V_" # IdxLInfo # "_" # LInfo :
- VPseudoIStoreNoMask<Vreg, IdxVreg>;
- def "EI" # eew # "_V_" # IdxLInfo # "_" # LInfo # "_MASK" :
- VPseudoIStoreMask<Vreg, IdxVreg>;
+ foreach sew = EEWList in {
+ foreach lmul = MxSet<sew>.m in {
+ defvar octuple_lmul = octuple_from_str<lmul.MX>.ret;
+ // Calculate emul = eew * lmul / sew
+ defvar octuple_emul = !srl(!mul(eew, octuple_lmul), shift_amount<sew>.val);
+ if !and(!ge(octuple_emul, 1), !le(octuple_emul, 64)) then {
+ defvar LInfo = lmul.MX;
+ defvar IdxLInfo = octuple_to_str<octuple_emul>.ret;
+ defvar idx_lmul = !cast<LMULInfo>("V_" # IdxLInfo);
+ defvar Vreg = lmul.vrclass;
+ defvar IdxVreg = idx_lmul.vrclass;
+ let VLMul = lmul.value in {
+ def "EI" # eew # "_V_" # IdxLInfo # "_" # LInfo :
+ VPseudoIStoreNoMask<Vreg, IdxVreg>;
+ def "EI" # eew # "_V_" # IdxLInfo # "_" # LInfo # "_MASK" :
+ VPseudoIStoreMask<Vreg, IdxVreg>;
+ }
+ }
}
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97008.324892.patch
Type: text/x-patch
Size: 3088 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210219/b87070da/attachment.bin>
More information about the llvm-commits
mailing list