[PATCH] D61910: Support FNeg in SpeculativeExecution pass

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 09:49:02 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL360692: Support FNeg in SpeculativeExecution pass (authored by mcinally, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61910?vs=199466&id=199474#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61910/new/

https://reviews.llvm.org/D61910

Files:
  llvm/trunk/lib/Transforms/Scalar/SpeculativeExecution.cpp
  llvm/trunk/test/Transforms/SpeculativeExecution/spec-fp.ll


Index: llvm/trunk/test/Transforms/SpeculativeExecution/spec-fp.ll
===================================================================
--- llvm/trunk/test/Transforms/SpeculativeExecution/spec-fp.ll
+++ llvm/trunk/test/Transforms/SpeculativeExecution/spec-fp.ll
@@ -30,10 +30,10 @@
   ret void
 }
 
-; CHECK-LABEL: @ifThen_fneg(
+; CHECK-LABEL: @ifThen_binary_fneg(
 ; CHECK: fsub float -0.0
 ; CHECK: br i1 true
-define void @ifThen_fneg() {
+define void @ifThen_binary_fneg() {
   br i1 true, label %a, label %b
 
 a:
@@ -44,6 +44,20 @@
   ret void
 }
 
+; CHECK-LABEL: @ifThen_unary_fneg(
+; CHECK: fneg float
+; CHECK: br i1 true
+define void @ifThen_unary_fneg() {
+  br i1 true, label %a, label %b
+
+a:
+  %x = fneg float undef
+  br label %b
+
+b:
+  ret void
+}
+
 ; CHECK-LABEL: @ifThen_fmul(
 ; CHECK: fmul
 ; CHECK: br i1 true
Index: llvm/trunk/lib/Transforms/Scalar/SpeculativeExecution.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Scalar/SpeculativeExecution.cpp
+++ llvm/trunk/lib/Transforms/Scalar/SpeculativeExecution.cpp
@@ -240,6 +240,7 @@
     case Instruction::FMul:
     case Instruction::FDiv:
     case Instruction::FRem:
+    case Instruction::FNeg:
     case Instruction::ICmp:
     case Instruction::FCmp:
       return TTI.getUserCost(I);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61910.199474.patch
Type: text/x-patch
Size: 1322 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190514/766bfa33/attachment.bin>


More information about the llvm-commits mailing list