[llvm] d26808c - [RISCV] Move RISCVInsertVSETVLI::coalesceVSETVLIs back to before insertReadVL (#96056)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 05:20:24 PDT 2024


Author: Luke Lau
Date: 2024-06-19T20:20:19+08:00
New Revision: d26808c4a694d5a5bc5f4360798151be432164ad

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

LOG: [RISCV] Move RISCVInsertVSETVLI::coalesceVSETVLIs back to before insertReadVL (#96056)

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 d36ce60c24185..877535513c721 100644
--- a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
+++ b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
@@ -1813,11 +1813,6 @@ bool RISCVInsertVSETVLI::runOnMachineFunction(MachineFunction &MF) {
   for (MachineBasicBlock &MBB : MF)
     emitVSETVLIs(MBB);
 
-  // Insert PseudoReadVL after VLEFF/VLSEGFF and replace it with the vl output
-  // of VLEFF/VLSEGFF.
-  for (MachineBasicBlock &MBB : MF)
-    insertReadVL(MBB);
-
   // Now that all vsetvlis are explicit, go through and do block local
   // DSE and peephole based demanded fields based transforms.  Note that
   // this *must* be done outside the main dataflow so long as we allow
@@ -1827,6 +1822,11 @@ bool RISCVInsertVSETVLI::runOnMachineFunction(MachineFunction &MF) {
   for (MachineBasicBlock &MBB : MF)
     coalesceVSETVLIs(MBB);
 
+  // Insert PseudoReadVL after VLEFF/VLSEGFF and replace it with the vl output
+  // of VLEFF/VLSEGFF.
+  for (MachineBasicBlock &MBB : MF)
+    insertReadVL(MBB);
+
   BlockInfo.clear();
   return HaveVectorOp;
 }


        


More information about the llvm-commits mailing list