[PATCH] D51145: make copyFMF consistent with AnyDefined for detection of any FMF flag set to true
Michael Berg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 4 13:28:41 PDT 2018
mcberg2017 updated this revision to Diff 163890.
mcberg2017 added a comment.
I added one more non fmf instruction and there is room to add others if needed.
https://reviews.llvm.org/D51145
Files:
include/llvm/IR/Operator.h
test/CodeGen/X86/intersect-fma-fmf.ll
Index: test/CodeGen/X86/intersect-fma-fmf.ll
===================================================================
--- test/CodeGen/X86/intersect-fma-fmf.ll
+++ test/CodeGen/X86/intersect-fma-fmf.ll
@@ -3,8 +3,7 @@
define float @test_x86_fma_intersection_fmf(float %a, float %b) {
; CHECK-LABEL: test_x86_fma_intersection_fmf:
; CHECK: # %bb.0:
-; CHECK: vmulss {{[0-9]+}}(%esp), %xmm0, %xmm1
-; CHECK-NEXT: vaddss %xmm0, %xmm1, %xmm0
+; CHECK: vfmadd132ss {{[0-9]+}}(%esp), %xmm0, %xmm0
; CHECK: retl
%tmp8 = fmul fast float %a, %b
%tmp9 = fadd fast float %tmp8, %b
Index: include/llvm/IR/Operator.h
===================================================================
--- include/llvm/IR/Operator.h
+++ include/llvm/IR/Operator.h
@@ -365,13 +365,29 @@
float getFPAccuracy() const;
static bool classof(const Instruction *I) {
- return I->getType()->isFPOrFPVectorTy() ||
- I->getOpcode() == Instruction::FCmp;
+ switch (I->getOpcode()) {
+ case Instruction::FCmp:
+ return true;
+ case Instruction::ExtractElement:
+ case Instruction::ShuffleVector:
+ case Instruction::InsertElement:
+ return false;
+ default:
+ return I->getType()->isFPOrFPVectorTy();
+ }
}
static bool classof(const ConstantExpr *CE) {
- return CE->getType()->isFPOrFPVectorTy() ||
- CE->getOpcode() == Instruction::FCmp;
+ switch (CE->getOpcode()) {
+ case Instruction::FCmp:
+ return true;
+ case Instruction::ExtractElement:
+ case Instruction::ShuffleVector:
+ case Instruction::InsertElement:
+ return false;
+ default:
+ return CE->getType()->isFPOrFPVectorTy();
+ }
}
static bool classof(const Value *V) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51145.163890.patch
Type: text/x-patch
Size: 1744 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180904/aa83da8f/attachment.bin>
More information about the llvm-commits
mailing list