[PATCH] D158344: WIP: [UpdateTestChecks] Add update test check support for fpmath metadata
John McIver via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 21 10:05:41 PDT 2023
jmciver created this revision.
Herald added subscribers: luismarques, arichardson.
Herald added a project: All.
jmciver retitled this revision from "[UpdateTestChecks] Add update test check support for fpmath metadata" to "WIP: [UpdateTestChecks] Add update test check support for fpmath metadata".
jmciver added a subscriber: nlopes.
jmciver edited the summary of this revision.
jmciver published this revision for review.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Part of a sequence of exploratory patches using poison semantics for
uninitialized memory.
Add fpmath metadata support to update test check utilities.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D158344
Files:
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/basic-metadata.ll
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/basic-metadata.ll.expected
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/basic-metadata.ll.globals.expected
llvm/test/tools/UpdateTestChecks/update_test_checks/basic-metadata.test
llvm/utils/UpdateTestChecks/common.py
Index: llvm/utils/UpdateTestChecks/common.py
===================================================================
--- llvm/utils/UpdateTestChecks/common.py
+++ llvm/utils/UpdateTestChecks/common.py
@@ -980,6 +980,7 @@
),
NamelessValue(r"DBG", "!", r"!dbg ", r"![0-9]+", None),
NamelessValue(r"DIASSIGNID", "!", r"!DIAssignID ", r"![0-9]+", None),
+ NamelessValue(r'FPMATH', '!', r'!fpmath ', r'![0-9]+', None),
NamelessValue(r'FREEZE_BITS', '!', r'!freeze_bits ', r'![0-9]+', None),
NamelessValue(r"PROF", "!", r"!prof ", r"![0-9]+", None),
NamelessValue(r"TBAA", "!", r"!tbaa ", r"![0-9]+", None),
Index: llvm/test/tools/UpdateTestChecks/update_test_checks/basic-metadata.test
===================================================================
--- /dev/null
+++ llvm/test/tools/UpdateTestChecks/update_test_checks/basic-metadata.test
@@ -0,0 +1,9 @@
+## Basic test checking that update_test_checks.py differnt metadata
+# RUN: cp -f %S/Inputs/basic-metadata.ll %t.ll && %update_test_checks %t.ll
+# RUN: diff -u %t.ll %S/Inputs/basic-metadata.ll.expected
+## Check that running the script again does not change the result:
+# RUN: %update_test_checks %t.ll
+# RUN: diff -u %t.ll %S/Inputs/basic-metadata.ll.expected
+## Also try the --check-globals flag
+# RUN: %update_test_checks %t.ll --check-globals
+# RUN: diff -u %t.ll %S/Inputs/basic-metadata.ll.globals.expected
Index: llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/basic-metadata.ll.globals.expected
===================================================================
--- /dev/null
+++ llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/basic-metadata.ll.globals.expected
@@ -0,0 +1,19 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
+; Just run it through opt, no passes needed.
+; RUN: opt < %s -S | FileCheck %s
+
+define double @fpmathTest(double %a, double %b) {
+; CHECK-LABEL: @fpmathTest(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[RET:%.*]] = fmul double [[A:%.*]], [[B:%.*]], !fpmath [[FPMATH0:![0-9]+]]
+; CHECK-NEXT: ret double [[RET]]
+;
+entry:
+ %ret = fmul double %a, %b, !fpmath !0
+ ret double %ret
+}
+
+!0 = !{float 3.0}
+;.
+; CHECK: [[FPMATH0]] = !{float 3.000000e+00}
+;.
Index: llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/basic-metadata.ll.expected
===================================================================
--- /dev/null
+++ llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/basic-metadata.ll.expected
@@ -0,0 +1,16 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; Just run it through opt, no passes needed.
+; RUN: opt < %s -S | FileCheck %s
+
+define double @fpmathTest(double %a, double %b) {
+; CHECK-LABEL: @fpmathTest(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[RET:%.*]] = fmul double [[A:%.*]], [[B:%.*]], !fpmath [[FPMATH0:![0-9]+]]
+; CHECK-NEXT: ret double [[RET]]
+;
+entry:
+ %ret = fmul double %a, %b, !fpmath !0
+ ret double %ret
+}
+
+!0 = !{float 3.0}
Index: llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/basic-metadata.ll
===================================================================
--- /dev/null
+++ llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/basic-metadata.ll
@@ -0,0 +1,10 @@
+; Just run it through opt, no passes needed.
+; RUN: opt < %s -S | FileCheck %s
+
+define double @fpmathTest(double %a, double %b) {
+entry:
+ %ret = fmul double %a, %b, !fpmath !0
+ ret double %ret
+}
+
+!0 = !{float 3.0}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158344.551781.patch
Type: text/x-patch
Size: 3529 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230821/5b1d44df/attachment.bin>
More information about the llvm-commits
mailing list