[llvm] [RISCV] Don't set AVL if only zeroness is demanded (PR #74049)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 15:02:14 PST 2023


================
@@ -1112,20 +1121,6 @@ static VSETVLIInfo adjustIncoming(VSETVLIInfo PrevInfo, VSETVLIInfo NewInfo,
     Demanded.LMUL = true;
   }
 
-  // If we only demand VL zeroness (i.e. vmv.s.x and vmv.x.s), then there are
-  // only two behaviors, VL = 0 and VL > 0. We can discard the user requested
-  // AVL and just use the last one if we can prove it equally zero. This
-  // removes a vsetvli entirely if the types match or allows use of cheaper avl
-  // preserving variant if VLMAX doesn't change. If VLMAX might change, we
-  // couldn't use the 'vsetvli x0, x0, vtype" variant, so we avoid the transform
-  // to prevent extending live range of an avl register operand.
-  // TODO: We can probably relax this for immediates.
-  if (Demanded.VLZeroness && !Demanded.VLAny && PrevInfo.isValid() &&
----------------
preames wrote:

I am wrong here.  I had misread the definition of SEWLMULRatioOnly.  This flag is only set in the merge if the AVL is the same, and thus well defined.

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


More information about the llvm-commits mailing list