[llvm] 8977989 - [RISCV] Increase complexity of RVV element extraction patterns

via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 10 19:53:54 PDT 2022


Author: Pengcheng Wang
Date: 2022-07-11T10:53:15+08:00
New Revision: 897798944941202ef54735183d2620b21e32214f

URL: https://github.com/llvm/llvm-project/commit/897798944941202ef54735183d2620b21e32214f
DIFF: https://github.com/llvm/llvm-project/commit/897798944941202ef54735183d2620b21e32214f.diff

LOG: [RISCV] Increase complexity of RVV element extraction patterns

Somehow some tests failed in our downstream because it matched
VFMV+FSD pattern first. Both FSD and VSE patterns have the same
complexity, while FSD is matched before VSE in the generated
matcher table.

This problem only occurs in our downstream (so sorry that I can't
provide a test here) and increasing the value of `AddedComplexity`
can fix it.

Reviewed By: StephenFan, craig.topper

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

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
index 6501bb2aeb93..b7b25643e397 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
@@ -1039,7 +1039,7 @@ foreach vti = AllFloatVectors in {
   // Fold store of vmv.f.s to a vse with VL=1.
   defvar store_instr = !cast<Instruction>("PseudoVSE"#vti.SEW#"_V_"#vti.LMul.MX);
 
-  let AddedComplexity = 1 in {
+  let AddedComplexity = 2 in {
   // Add complexity to increase the priority of this pattern being matched.
   def : Pat<(store (vti.Scalar (int_riscv_vfmv_f_s (vti.Vector vti.RegClass:$rs2))), GPR:$rs1),
             (store_instr vti.RegClass:$rs2, GPR:$rs1, 1, vti.Log2SEW)>;


        


More information about the llvm-commits mailing list