File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -379,20 +379,25 @@ class FPMathOperator : public Operator {
379
379
return false ;
380
380
381
381
switch (Opcode) {
382
+ case Instruction::FNeg:
383
+ case Instruction::FAdd:
384
+ case Instruction::FSub:
385
+ case Instruction::FMul:
386
+ case Instruction::FDiv:
387
+ case Instruction::FRem:
382
388
// FIXME: To clean up and correct the semantics of fast-math-flags, FCmp
383
389
// should not be treated as a math op, but the other opcodes should.
384
390
// This would make things consistent with Select/PHI (FP value type
385
391
// determines whether they are math ops and, therefore, capable of
386
392
// having fast-math-flags).
387
393
case Instruction::FCmp:
388
394
return true ;
389
- // non math FP Operators (no FMF)
390
- case Instruction::ExtractElement:
391
- case Instruction::ShuffleVector:
392
- case Instruction::InsertElement:
393
- return false ;
394
- default :
395
+ case Instruction::PHI:
396
+ case Instruction::Select:
397
+ case Instruction::Call:
395
398
return V->getType ()->isFPOrFPVectorTy ();
399
+ default :
400
+ return false ;
396
401
}
397
402
}
398
403
};
Original file line number Diff line number Diff line change @@ -376,7 +376,7 @@ TEST_F(IRBuilderTest, UnaryOperators) {
376
376
ASSERT_FALSE (isa<BinaryOperator>(U));
377
377
378
378
// Test CreateFNegFMF(X)
379
- Instruction *I = cast<Instruction>(V );
379
+ Instruction *I = cast<Instruction>(U );
380
380
I->setHasNoSignedZeros (true );
381
381
I->setHasNoNaNs (true );
382
382
Value *VFMF = Builder.CreateFNegFMF (V, I);
You can’t perform that action at this time.
0 commit comments