[PATCH] D129235: [GVN] Bug fix to reportMayClobberedLoad remark
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 6 17:42:47 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG89a99ec900d5: [GVN] Bug fix to reportMayClobberedLoad remark (authored by virnarula, committed by fhahn).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129235/new/
https://reviews.llvm.org/D129235
Files:
llvm/lib/Transforms/Scalar/GVN.cpp
llvm/test/Transforms/GVN/remarks-selfdomination.ll
Index: llvm/test/Transforms/GVN/remarks-selfdomination.ll
===================================================================
--- /dev/null
+++ llvm/test/Transforms/GVN/remarks-selfdomination.ll
@@ -0,0 +1,21 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -gvn -pass-remarks-analysis=gvn -S < %s | FileCheck %s
+
+define ptr @ReplaceWithTidy(ptr %one, ptr %two, ptr %three) {
+; CHECK-LABEL: @ReplaceWithTidy(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ONE:%.*]], align 8
+; CHECK-NEXT: store ptr [[TMP0]], ptr [[TMP0]], align 8
+; CHECK-NEXT: store ptr null, ptr [[TWO:%.*]], align 8
+; CHECK-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP0]], align 8
+; CHECK-NEXT: store ptr [[TMP1]], ptr [[THREE:%.*]], align 8
+; CHECK-NEXT: ret ptr null
+;
+entry:
+ %0 = load ptr, ptr %one, align 8
+ store ptr %0, ptr %0, align 8
+ store ptr null, ptr %two, align 8
+ %1 = load ptr, ptr %0, align 8
+ store ptr %1, ptr %three, align 8
+ ret ptr null
+}
Index: llvm/lib/Transforms/Scalar/GVN.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/GVN.cpp
+++ llvm/lib/Transforms/Scalar/GVN.cpp
@@ -1059,8 +1059,8 @@
if (DT->dominates(cast<Instruction>(OtherAccess), cast<Instruction>(U)))
OtherAccess = U;
else
- assert(DT->dominates(cast<Instruction>(U),
- cast<Instruction>(OtherAccess)));
+ assert(U == OtherAccess || DT->dominates(cast<Instruction>(U),
+ cast<Instruction>(OtherAccess)));
} else
OtherAccess = U;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129235.442737.patch
Type: text/x-patch
Size: 1692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220707/78447cc9/attachment.bin>
More information about the llvm-commits
mailing list