[llvm] r364597 - [NFC][GVNSink] Pre-commit unary FNeg test to fpmath.ll

Cameron McInally via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 27 14:23:07 PDT 2019


Author: mcinally
Date: Thu Jun 27 14:23:07 2019
New Revision: 364597

URL: http://llvm.org/viewvc/llvm-project?rev=364597&view=rev
Log:
[NFC][GVNSink] Pre-commit unary FNeg test to fpmath.ll

Added:
    llvm/trunk/test/Transforms/GVNSink/fpmath.ll

Added: llvm/trunk/test/Transforms/GVNSink/fpmath.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVNSink/fpmath.ll?rev=364597&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVNSink/fpmath.ll (added)
+++ llvm/trunk/test/Transforms/GVNSink/fpmath.ll Thu Jun 27 14:23:07 2019
@@ -0,0 +1,23 @@
+; RUN: opt -S < %s -gvn-sink | FileCheck %s
+
+; CHECK-LABEL: sink
+; CHECK: fneg
+; CHECK: = phi
+define float @sink(float %a, float %b, i1 %cmp) {
+entry:
+  br i1 %cmp, label %if.then, label %if.else
+
+if.then:
+  %sub = fsub float %a, %b
+  %neg0 = fneg float %sub
+  br label %if.end
+
+if.else:
+  %add = fadd float %a, %b
+  %neg1 = fneg float %add
+  br label %if.end
+
+if.end:
+  %phi = phi float [ %neg0, %if.then ], [ %neg1, %if.else ]
+  ret float %phi
+}




More information about the llvm-commits mailing list