[llvm] [GVN] Drop Clobber dependency if store may overwrite only the same value (PR #68322)
Sergey Kachkov via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 6 05:14:21 PDT 2023
================
@@ -0,0 +1,91 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
+; RUN: opt < %s -passes=gvn -S | FileCheck %s
+
+define void @test_i8(ptr %a, ptr %b, ptr %c) {
+; CHECK-LABEL: define void @test_i8(
+; CHECK-SAME: ptr [[A:%.*]], ptr [[B:%.*]], ptr [[C:%.*]]) {
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A]], align 1
+; CHECK-NEXT: store i8 [[TMP0]], ptr [[B]], align 1
+; CHECK-NEXT: store i8 [[TMP0]], ptr [[C]], align 1
+; CHECK-NEXT: ret void
+;
+entry:
+ %0 = load i8, ptr %a, align 1
+ store i8 %0, ptr %b, align 1
+ %1 = load i8, ptr %a, align 1
+ store i8 %1, ptr %c, align 1
----------------
skachkov-sc wrote:
Thank you, I haven't noticed that tests can be simpified, done
https://github.com/llvm/llvm-project/pull/68322
More information about the llvm-commits
mailing list