mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-18 18:42:46 +02:00
PHI nodes are not FPMathOperator
s
Reviewers: chandlerc, arsenm Reviewed By: arsenm Subscribers: wdng, arsenm, mcrosier, jlebar, bixia, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58887 llvm-svn: 355362
This commit is contained in:
parent
a47507ca88
commit
5012dbbadd
@ -379,6 +379,7 @@ public:
|
||||
case Instruction::ExtractElement:
|
||||
case Instruction::ShuffleVector:
|
||||
case Instruction::InsertElement:
|
||||
case Instruction::PHI:
|
||||
return false;
|
||||
default:
|
||||
return V->getType()->isFPOrFPVectorTy();
|
||||
|
@ -549,9 +549,8 @@ RecurrenceDescriptor::isConditionalRdxPattern(
|
||||
RecurrenceDescriptor::InstDesc
|
||||
RecurrenceDescriptor::isRecurrenceInstr(Instruction *I, RecurrenceKind Kind,
|
||||
InstDesc &Prev, bool HasFunNoNaNAttr) {
|
||||
bool FP = I->getType()->isFloatingPointTy();
|
||||
Instruction *UAI = Prev.getUnsafeAlgebraInst();
|
||||
if (!UAI && FP && !I->isFast())
|
||||
if (!UAI && isa<FPMathOperator>(I) && !I->isFast())
|
||||
UAI = I; // Found an unsafe (unvectorizable) algebra instruction.
|
||||
|
||||
switch (I->getOpcode()) {
|
||||
|
@ -993,5 +993,14 @@ TEST(InstructionsTest, SkipDebug) {
|
||||
EXPECT_EQ(nullptr, Term->getNextNonDebugInstruction());
|
||||
}
|
||||
|
||||
TEST(InstructionsTest, PhiIsNotFPMathOperator) {
|
||||
LLVMContext Context;
|
||||
IRBuilder<> Builder(Context);
|
||||
MDBuilder MDHelper(Context);
|
||||
Instruction *I = Builder.CreatePHI(Builder.getDoubleTy(), 0);
|
||||
EXPECT_FALSE(isa<FPMathOperator>(I));
|
||||
I->deleteValue();
|
||||
}
|
||||
|
||||
} // end anonymous namespace
|
||||
} // end namespace llvm
|
||||
|
Loading…
Reference in New Issue
Block a user