summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/IVDescriptors.cpp3
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp14
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp29
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp5
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp2
5 files changed, 9 insertions, 44 deletions
diff --git a/llvm/lib/Analysis/IVDescriptors.cpp b/llvm/lib/Analysis/IVDescriptors.cpp
index 6fb600114bc..ce285f82f72 100644
--- a/llvm/lib/Analysis/IVDescriptors.cpp
+++ b/llvm/lib/Analysis/IVDescriptors.cpp
@@ -300,8 +300,7 @@ bool RecurrenceDescriptor::AddReductionVar(PHINode *Phi, RecurrenceKind Kind,
ReduxDesc = isRecurrenceInstr(Cur, Kind, ReduxDesc, HasFunNoNaNAttr);
if (!ReduxDesc.isRecurrence())
return false;
- // FIXME: FMF is allowed on phi, but propagation is not handled correctly.
- if (isa<FPMathOperator>(ReduxDesc.getPatternInst()) && !IsAPhi)
+ if (isa<FPMathOperator>(ReduxDesc.getPatternInst()))
FMF &= ReduxDesc.getPatternInst()->getFastMathFlags();
}
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 5ea0b7d39c1..eb66a7c82b5 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -5802,19 +5802,7 @@ int LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB,
case lltok::kw_extractelement: return ParseExtractElement(Inst, PFS);
case lltok::kw_insertelement: return ParseInsertElement(Inst, PFS);
case lltok::kw_shufflevector: return ParseShuffleVector(Inst, PFS);
- case lltok::kw_phi: {
- FastMathFlags FMF = EatFastMathFlagsIfPresent();
- int Res = ParsePHI(Inst, PFS);
- if (Res != 0)
- return Res;
- if (FMF.any()) {
- if (!Inst->getType()->isFPOrFPVectorTy())
- return Error(Loc, "fast-math-flags specified for phi without "
- "floating-point scalar or vector return type");
- Inst->setFastMathFlags(FMF);
- }
- return 0;
- }
+ case lltok::kw_phi: return ParsePHI(Inst, PFS);
case lltok::kw_landingpad: return ParseLandingPad(Inst, PFS);
// Call.
case lltok::kw_call: return ParseCall(Inst, PFS, CallInst::TCK_None);
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 9c377552b4a..89a5b7bdd5b 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -4629,48 +4629,31 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
InstructionList.push_back(I);
break;
case bitc::FUNC_CODE_INST_PHI: { // PHI: [ty, val0,bb0, ...]
- if (Record.size() < 1)
+ if (Record.size() < 1 || ((Record.size()-1)&1))
return error("Invalid record");
- // The first record specifies the type.
FullTy = getFullyStructuredTypeByID(Record[0]);
Type *Ty = flattenPointerTypes(FullTy);
if (!Ty)
return error("Invalid record");
- // Phi arguments are pairs of records of [value, basic block].
- // There is an optional final record for fast-math-flags if this phi has a
- // floating-point type.
- size_t NumArgs = (Record.size() - 1) / 2;
- if ((Record.size() - 1) % 2 == 1 && !Ty->isFloatingPointTy())
- return error("Invalid record");
-
- PHINode *PN = PHINode::Create(Ty, NumArgs);
+ PHINode *PN = PHINode::Create(Ty, (Record.size()-1)/2);
InstructionList.push_back(PN);
- for (unsigned i = 0; i != NumArgs; i++) {
+ for (unsigned i = 0, e = Record.size()-1; i != e; i += 2) {
Value *V;
// With the new function encoding, it is possible that operands have
// negative IDs (for forward references). Use a signed VBR
// representation to keep the encoding small.
if (UseRelativeIDs)
- V = getValueSigned(Record, i * 2 + 1, NextValueNo, Ty);
+ V = getValueSigned(Record, 1+i, NextValueNo, Ty);
else
- V = getValue(Record, i * 2 + 1, NextValueNo, Ty);
- BasicBlock *BB = getBasicBlock(Record[i * 2 + 2]);
+ V = getValue(Record, 1+i, NextValueNo, Ty);
+ BasicBlock *BB = getBasicBlock(Record[2+i]);
if (!V || !BB)
return error("Invalid record");
PN->addIncoming(V, BB);
}
I = PN;
-
- // If there are an even number of records, the final record must be FMF.
- if (Record.size() % 2 == 0) {
- assert(isa<FPMathOperator>(I) && "Unexpected phi type");
- FastMathFlags FMF = getDecodedFastMathFlags(Record[Record.size() - 1]);
- if (FMF.any())
- I->setFastMathFlags(FMF);
- }
-
break;
}
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 2818e843b50..0eea6dc87ce 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -2880,11 +2880,6 @@ void ModuleBitcodeWriter::writeInstruction(const Instruction &I,
pushValueSigned(PN.getIncomingValue(i), InstID, Vals64);
Vals64.push_back(VE.getValueID(PN.getIncomingBlock(i)));
}
-
- uint64_t Flags = getOptimizationFlags(&I);
- if (Flags != 0)
- Vals64.push_back(Flags);
-
// Emit a Vals64 vector and exit.
Stream.EmitRecord(Code, Vals64, AbbrevToUse);
Vals64.clear();
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 0333232983d..b3a6e284f4f 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -5951,7 +5951,7 @@ bool CodeGenPrepare::optimizeSelectInst(SelectInst *SI) {
// If branch conversion isn't desirable, exit early.
if (DisableSelectToBranch || OptSize || !TLI)
return false;
-TLI->isSelectSupported(<#SelectSupportKind#>)
+
// Find all consecutive select instructions that share the same condition.
SmallVector<SelectInst *, 2> ASI;
ASI.push_back(SI);
OpenPOWER on IntegriCloud