[llvm] 0178ae7 - [DSE] Add another multiblock loop DSE test. NFC
David Green via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 8 13:55:22 PDT 2021
Author: David Green
Date: 2021-06-08T21:54:59+01:00
New Revision: 0178ae734ca33265fe051c39deff6d7d530f6239
URL: https://github.com/llvm/llvm-project/commit/0178ae734ca33265fe051c39deff6d7d530f6239
DIFF: https://github.com/llvm/llvm-project/commit/0178ae734ca33265fe051c39deff6d7d530f6239.diff
LOG: [DSE] Add another multiblock loop DSE test. NFC
As reported in D100464, the stores in these loops should not be removed.
Added:
Modified:
llvm/test/Transforms/DeadStoreElimination/multiblock-loops.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/DeadStoreElimination/multiblock-loops.ll b/llvm/test/Transforms/DeadStoreElimination/multiblock-loops.ll
index e887a478120f..67250fd94df7 100644
--- a/llvm/test/Transforms/DeadStoreElimination/multiblock-loops.ll
+++ b/llvm/test/Transforms/DeadStoreElimination/multiblock-loops.ll
@@ -706,3 +706,59 @@ exit:
ret i16 0
}
+define void @InitializeMasks(i64* %p) {
+; CHECK-LABEL: @InitializeMasks(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: br label [[FOR_BODY98:%.*]]
+; CHECK: for.body98:
+; CHECK-NEXT: [[INDVARS_IV377:%.*]] = phi i64 [ 8, [[ENTRY:%.*]] ], [ [[INC2:%.*]], [[FOR_INC140:%.*]] ], [ [[INC1:%.*]], [[FOR_INC140_THREAD:%.*]] ]
+; CHECK-NEXT: [[ARRAYIDX106:%.*]] = getelementptr inbounds i64, i64* [[P:%.*]], i64 [[INDVARS_IV377]]
+; CHECK-NEXT: store i64 1, i64* [[ARRAYIDX106]], align 8
+; CHECK-NEXT: [[CMP107:%.*]] = icmp ugt i64 [[INDVARS_IV377]], 15
+; CHECK-NEXT: br i1 [[CMP107]], label [[IF_END:%.*]], label [[IF_END_THREAD:%.*]]
+; CHECK: if.end.thread:
+; CHECK-NEXT: br label [[FOR_INC140_THREAD]]
+; CHECK: if.end:
+; CHECK-NEXT: store i64 2, i64* [[ARRAYIDX106]], align 8
+; CHECK-NEXT: [[CMP127:%.*]] = icmp ult i64 [[INDVARS_IV377]], 48
+; CHECK-NEXT: br i1 [[CMP127]], label [[FOR_INC140_THREAD]], label [[FOR_INC140]]
+; CHECK: for.inc140.thread:
+; CHECK-NEXT: [[INC1]] = add i64 [[INDVARS_IV377]], 1
+; CHECK-NEXT: br label [[FOR_BODY98]]
+; CHECK: for.inc140:
+; CHECK-NEXT: [[INC2]] = add i64 [[INDVARS_IV377]], 1
+; CHECK-NEXT: [[EXITCOND384_NOT:%.*]] = icmp eq i64 [[INDVARS_IV377]], 56
+; CHECK-NEXT: br i1 [[EXITCOND384_NOT]], label [[FOR_INC177:%.*]], label [[FOR_BODY98]]
+; CHECK: for.inc177:
+; CHECK-NEXT: ret void
+;
+entry:
+ br label %for.body98
+
+for.body98: ; preds = %for.inc140, %for.inc140.thread, %entry
+ %indvars.iv377 = phi i64 [ 8, %entry ], [ %inc2, %for.inc140 ], [ %inc1, %for.inc140.thread ]
+ %arrayidx106 = getelementptr inbounds i64, i64* %p, i64 %indvars.iv377
+ store i64 1, i64* %arrayidx106, align 8
+ %cmp107 = icmp ugt i64 %indvars.iv377, 15
+ br i1 %cmp107, label %if.end, label %if.end.thread
+
+if.end.thread: ; preds = %for.body98
+ br label %for.inc140.thread
+
+if.end: ; preds = %for.body98
+ store i64 2, i64* %arrayidx106, align 8
+ %cmp127 = icmp ult i64 %indvars.iv377, 48
+ br i1 %cmp127, label %for.inc140.thread, label %for.inc140
+
+for.inc140.thread: ; preds = %if.end, %if.end.thread
+ %inc1 = add i64 %indvars.iv377, 1
+ br label %for.body98
+
+for.inc140: ; preds = %if.end
+ %inc2 = add i64 %indvars.iv377, 1
+ %exitcond384.not = icmp eq i64 %indvars.iv377, 56
+ br i1 %exitcond384.not, label %for.inc177, label %for.body98
+
+for.inc177: ; preds = %for.inc140
+ ret void
+}
More information about the llvm-commits
mailing list