[PATCH] D129235: [GVN] Bug fix to reportMayClobberedLoad remark
Vir Narula via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 6 16:38:02 PDT 2022
virnarula updated this revision to Diff 442717.
virnarula added a comment.
update
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,24 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -gvn -pass-remarks-analysis=gvn -S < %s | FileCheck %s
+
+target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
+target triple = "arm64-apple-macosx12.0.0"
+
+define ptr @ReplaceWithTidy(ptr %zz_hold) {
+; CHECK-LABEL: @ReplaceWithTidy(
+; CHECK-NEXT: cond.end480.us:
+; CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr null, align 8
+; CHECK-NEXT: store ptr [[TMP0]], ptr [[TMP0]], align 8
+; CHECK-NEXT: store ptr null, ptr [[ZZ_HOLD:%.*]], align 8
+; CHECK-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP0]], align 8
+; CHECK-NEXT: store ptr [[TMP1]], ptr null, align 8
+; CHECK-NEXT: ret ptr null
+;
+cond.end480.us:
+ %0 = load ptr, ptr null, align 8
+ store ptr %0, ptr %0, align 8
+ store ptr null, ptr %zz_hold, align 8
+ %1 = load ptr, ptr %0, align 8
+ store ptr %1, ptr null, 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.442717.patch
Type: text/x-patch
Size: 1785 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220706/b6c89805/attachment.bin>
More information about the llvm-commits
mailing list