<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 25, 2015 at 1:17 PM, Paul Robinson <span dir="ltr"><<a href="mailto:Paul_Robinson@playstation.sony.com" target="_blank">Paul_Robinson@playstation.sony.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi dblaikie,<br>
<br>
DAG combiner had been disabled for 'optnone' functions in r221168.<br>
It was re-enabled in r233153. Add a test to keep it from happening again.<br></blockquote><div><br>Is this basically the same test from r221168 (that was removed in r233153)? If not, what's the particular motivation for this test to be different? If it is essentially the same - go for it!<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<a href="http://reviews.llvm.org/D8614" target="_blank">http://reviews.llvm.org/D8614</a><br>
<br>
Files:<br>
  test/CodeGen/X86/dag-optnone.ll<br>
<br>
Index: test/CodeGen/X86/dag-optnone.ll<br>
===================================================================<br>
--- test/CodeGen/X86/dag-optnone.ll<br>
+++ test/CodeGen/X86/dag-optnone.ll<br>
@@ -0,0 +1,38 @@<br>
+; RUN: llc < %s -mtriple=x86_64-pc-win32 | FileCheck %s<br>
+; Verify that when an 'optnone' function bails out of fast-isel, it will run<br>
+; the DAG combiner. (This was disabled by r221168, re-enabled in r233153.)<br>
+; We set unsafe-fp-math which allows the DAG combiner to fold the fadd sequence<br>
+; into an fmul. We have a non-optnone function doing the same thing, to show<br>
+; that the combine is expected.<br>
+; Note, this will start failing if somebody decides that this combine should<br>
+; not occur at -O0 (because 'optnone' essentially sets -O0 for the function).<br>
+; FIXME: We use a Windows triple because the calling convention ends up causing<br>
+; fast-isel to bail out.  A more robust tactic for ensuring fast-isel will<br>
+; bail out would be better.<br>
+<br>
+define float @foo(float %x) #0 {<br>
+entry:<br>
+  %add = fadd fast float %x, %x<br>
+  %add1 = fadd fast float %add, %x<br>
+  ret float %add1<br>
+}<br>
+<br>
+; CHECK-LABEL: @foo<br>
+; CHECK-NOT:   add<br>
+; CHECK:       mul<br>
+; CHECK-NEXT:  ret<br>
+<br>
+define float @fooWithOptnone(float %x) #1 {<br>
+entry:<br>
+  %add = fadd fast float %x, %x<br>
+  %add1 = fadd fast float %add, %x<br>
+  ret float %add1<br>
+}<br>
+<br>
+; CHECK-LABEL: @fooWithOptnone<br>
+; CHECK-NOT:   add<br>
+; CHECK:       mul<br>
+; CHECK-NEXT:  ret<br>
+<br>
+attributes #0 = { "unsafe-fp-math"="true" }<br>
+attributes #1 = { noinline optnone "unsafe-fp-math"="true" }<br>
<br>
EMAIL PREFERENCES<br>
  <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
</blockquote></div><br></div></div>