[llvm] [DeadStoreElimination] Optimize tautological assignments (PR #75744)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 19 06:04:07 PST 2023
================
@@ -795,3 +795,27 @@ join:
store i8 %v, ptr %q, align 1
ret void
}
+
+ at x = global i32 0, align 4
+define void @remove_tautological_store() {
+; CHECK-LABEL: @remove_tautological_store(
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr @x, align 4
+; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 4
+; CHECK-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP4:%.*]]
+; CHECK: 3:
+; CHECK-NEXT: br label [[TMP4]]
+; CHECK: 4:
+; CHECK-NEXT: ret void
+;
+ %1 = load i32, ptr @x, align 4
----------------
nikic wrote:
Name instructions and blocks.
https://github.com/llvm/llvm-project/pull/75744
More information about the llvm-commits
mailing list