[llvm] 06ebce3 - [RISCV][InsertVSETVLI] vmv.s.x and fvmv.s.f do not depend on LMUL

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 10:14:51 PST 2022


Author: Philip Reames
Date: 2022-12-08T10:14:39-08:00
New Revision: 06ebce363a713ced024acd7807e6143abb718736

URL: https://github.com/llvm/llvm-project/commit/06ebce363a713ced024acd7807e6143abb718736
DIFF: https://github.com/llvm/llvm-project/commit/06ebce363a713ced024acd7807e6143abb718736.diff

LOG: [RISCV][InsertVSETVLI] vmv.s.x and fvmv.s.f do not depend on LMUL

We already have this rule encoded elsewhere in the file - which is why we don't see any test changes.  I'm adding it here for completionism.

This is not technically NFC since there could be a test case which isn't caught by the specific rules, but is handled by the generic logic.  I don't have such an example.

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
index aae570c872da0..faa2d8f22d227 100644
--- a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
+++ b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
@@ -232,6 +232,11 @@ static DemandedFields getDemanded(const MachineInstr &MI) {
     Res.LMUL = false;
   }
 
+  // For vmv.s.x and vfmv.s.f, there is only two behaviors, VL = 0 and VL > 0.
+  // As such, the result does not depend on LMUL.
+  if (isScalarMoveInstr(MI))
+    Res.LMUL = false;
+
   return Res;
 }
 


        


More information about the llvm-commits mailing list