[clang] [clang-tools-extra] [llvm] [LLVM] Add IRNormalizer Pass (PR #68176)
Nikita Popov via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 1 08:08:20 PST 2023
================
@@ -0,0 +1,14 @@
+; RUN: opt -S -passes=normalize < %s | FileCheck %s
+
+define double @foo(double %a0, double %a1) {
+entry:
+; CHECK: %b
+; CHECK: %d
+; CHECK: %a
+; CHECK: %c
+ %a = fmul double %a0, %a1
+ %b = fmul double %a0, 2.000000e+00
+ %c = fmul double %a, 6.000000e+00
+ %d = fmul double %b, 6.000000e+00
+ ret double %d
+}
----------------
nikic wrote:
I'd suggest to add some more tests for this, in particular for instructions with side-effects or accessing memory.
If possible (i.e. for tests that don't include hashes in the output) you should use update_test_checks to generate the CHECK lines.
https://github.com/llvm/llvm-project/pull/68176
More information about the cfe-commits
mailing list