[llvm] [LV] Check isPredInst instead of isScalarWithPred in uniform analysis. (PR #98892)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 15:38:46 PDT 2024


================
@@ -9482,6 +9483,8 @@ void VPInterleaveRecipe::execute(VPTransformState &State) {
 void VPReplicateRecipe::execute(VPTransformState &State) {
   Instruction *UI = getUnderlyingInstr();
   if (State.Instance) { // Generate a single instance.
+    assert((State.VF.isScalar() || !isUniform()) &&
+           "uniform recipe shouldn't be predicated");
----------------
ayalz wrote:

Could this assert be committed separately?

Better catch this earlier, say assert (!IsUniform || !IsPredicated) upon replicate recipe construction and/or at handleReplication()?

Note the `if (IsUniform)` below - would be good to be consistent.

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


More information about the llvm-commits mailing list