[llvm] [RISCV] Minimally modify incoming state in transferBefore (PR #72352)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 16 07:50:33 PST 2023


================
@@ -1013,73 +1015,76 @@ bool RISCVInsertVSETVLI::needVSETVLI(const MachineInstr &MI,
   return true;
 }
 
-// Given an incoming state reaching MI, modifies that state so that it is minimally
-// compatible with MI.  The resulting state is guaranteed to be semantically legal
-// for MI, but may not be the state requested by MI.
+// Given an incoming state reaching MI, minimally modifies that state so that it
+// is compatible with MI. The resulting state is guaranteed to be semantically
+// legal for MI, but may not be the state requested by MI.
 void RISCVInsertVSETVLI::transferBefore(VSETVLIInfo &Info,
                                         const MachineInstr &MI) const {
   uint64_t TSFlags = MI.getDesc().TSFlags;
   if (!RISCVII::hasSEWOp(TSFlags))
     return;
 
-  const VSETVLIInfo NewInfo = computeInfoForInstr(MI, TSFlags, MRI);
+  VSETVLIInfo NewInfo = computeInfoForInstr(MI, TSFlags, MRI);
----------------
preames wrote:

Please leave NewInfo and PrevInfo unchanged.  Use Info as your mutable state variable if desired.  Mixing the meaning leads to subtle confusions below.

https://github.com/llvm/llvm-project/pull/72352


More information about the llvm-commits mailing list