[llvm] Don't use Optional::getValue (NFC)
This commit is contained in:
parent
9cfbe7bbfe
commit
7a47ee51a1
|
@ -80,7 +80,7 @@ private:
|
||||||
|
|
||||||
inline void toNext() {
|
inline void toNext() {
|
||||||
Optional<QueueElement> Head = VisitQueue.front();
|
Optional<QueueElement> Head = VisitQueue.front();
|
||||||
QueueElement H = Head.getValue();
|
QueueElement H = *Head;
|
||||||
NodeRef Node = H.first;
|
NodeRef Node = H.first;
|
||||||
Optional<ChildItTy> &ChildIt = H.second;
|
Optional<ChildItTy> &ChildIt = H.second;
|
||||||
|
|
||||||
|
|
|
@ -1299,7 +1299,7 @@ bool BlockFrequencyInfoImpl<BT>::computeMassInLoop(LoopData &Loop) {
|
||||||
auto &HeaderNode = Loop.Nodes[H];
|
auto &HeaderNode = Loop.Nodes[H];
|
||||||
assert(!getBlock(HeaderNode)->getIrrLoopHeaderWeight() &&
|
assert(!getBlock(HeaderNode)->getIrrLoopHeaderWeight() &&
|
||||||
"Shouldn't have a weight metadata");
|
"Shouldn't have a weight metadata");
|
||||||
uint64_t MinWeight = MinHeaderWeight.getValue();
|
uint64_t MinWeight = *MinHeaderWeight;
|
||||||
LLVM_DEBUG(dbgs() << "Giving weight " << MinWeight << " to "
|
LLVM_DEBUG(dbgs() << "Giving weight " << MinWeight << " to "
|
||||||
<< getBlockName(HeaderNode) << "\n");
|
<< getBlockName(HeaderNode) << "\n");
|
||||||
if (MinWeight)
|
if (MinWeight)
|
||||||
|
@ -1869,7 +1869,7 @@ struct BFIDOTGraphTraitsBase : public DefaultDOTGraphTraits {
|
||||||
case GVDT_Count: {
|
case GVDT_Count: {
|
||||||
auto Count = Graph->getBlockProfileCount(Node);
|
auto Count = Graph->getBlockProfileCount(Node);
|
||||||
if (Count)
|
if (Count)
|
||||||
OS << Count.getValue();
|
OS << *Count;
|
||||||
else
|
else
|
||||||
OS << "Unknown";
|
OS << "Unknown";
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1307,8 +1307,7 @@ public:
|
||||||
|
|
||||||
// Scale the cost of the load by the fraction of legal instructions that
|
// Scale the cost of the load by the fraction of legal instructions that
|
||||||
// will be used.
|
// will be used.
|
||||||
Cost = divideCeil(UsedInsts.count() * Cost.getValue().getValue(),
|
Cost = divideCeil(UsedInsts.count() * *Cost.getValue(), NumLegalInsts);
|
||||||
NumLegalInsts);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then plus the cost of interleave operation.
|
// Then plus the cost of interleave operation.
|
||||||
|
|
|
@ -196,7 +196,7 @@ struct BinaryAnnotationIterator
|
||||||
|
|
||||||
const DecodedAnnotation &operator*() {
|
const DecodedAnnotation &operator*() {
|
||||||
ParseCurrentAnnotation();
|
ParseCurrentAnnotation();
|
||||||
return Current.getValue();
|
return *Current;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -181,7 +181,7 @@ Error iterateSymbolGroups(InputFile &Input, const PrintScope &HeaderScope,
|
||||||
|
|
||||||
FilterOptions Filters = HeaderScope.P.getFilters();
|
FilterOptions Filters = HeaderScope.P.getFilters();
|
||||||
if (Filters.DumpModi) {
|
if (Filters.DumpModi) {
|
||||||
uint32_t Modi = Filters.DumpModi.getValue();
|
uint32_t Modi = *Filters.DumpModi;
|
||||||
SymbolGroup SG(&Input, Modi);
|
SymbolGroup SG(&Input, Modi);
|
||||||
return iterateOneModule(Input, withLabelWidth(HeaderScope, NumDigits(Modi)),
|
return iterateOneModule(Input, withLabelWidth(HeaderScope, NumDigits(Modi)),
|
||||||
SG, Modi, Callback);
|
SG, Modi, Callback);
|
||||||
|
|
|
@ -1692,7 +1692,7 @@ void IO::processKeyWithDefault(const char *Key, Optional<T> &Val,
|
||||||
if (IsNone)
|
if (IsNone)
|
||||||
Val = DefaultValue;
|
Val = DefaultValue;
|
||||||
else
|
else
|
||||||
yamlize(*this, Val.getValue(), Required, Ctx);
|
yamlize(*this, *Val, Required, Ctx);
|
||||||
this->postflightKey(SaveInfo);
|
this->postflightKey(SaveInfo);
|
||||||
} else {
|
} else {
|
||||||
if (UseDefault)
|
if (UseDefault)
|
||||||
|
|
|
@ -414,8 +414,7 @@ bool BranchProbabilityInfo::calcMetadataWeights(const BasicBlock *BB) {
|
||||||
const LoopBlock DstLoopBB = getLoopBlock(TI->getSuccessor(I - 1));
|
const LoopBlock DstLoopBB = getLoopBlock(TI->getSuccessor(I - 1));
|
||||||
auto EstimatedWeight = getEstimatedEdgeWeight({SrcLoopBB, DstLoopBB});
|
auto EstimatedWeight = getEstimatedEdgeWeight({SrcLoopBB, DstLoopBB});
|
||||||
if (EstimatedWeight &&
|
if (EstimatedWeight &&
|
||||||
EstimatedWeight.getValue() <=
|
*EstimatedWeight <= static_cast<uint32_t>(BlockExecWeight::UNREACHABLE))
|
||||||
static_cast<uint32_t>(BlockExecWeight::UNREACHABLE))
|
|
||||||
UnreachableIdxs.push_back(I - 1);
|
UnreachableIdxs.push_back(I - 1);
|
||||||
else
|
else
|
||||||
ReachableIdxs.push_back(I - 1);
|
ReachableIdxs.push_back(I - 1);
|
||||||
|
@ -688,7 +687,7 @@ Optional<uint32_t> BranchProbabilityInfo::getMaxEstimatedEdgeWeight(
|
||||||
if (!Weight)
|
if (!Weight)
|
||||||
return None;
|
return None;
|
||||||
|
|
||||||
if (!MaxWeight || MaxWeight.getValue() < Weight.getValue())
|
if (!MaxWeight || *MaxWeight < *Weight)
|
||||||
MaxWeight = Weight;
|
MaxWeight = Weight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -852,8 +851,7 @@ void BranchProbabilityInfo::computeEestimateBlockWeight(
|
||||||
if (LoopWeight <= static_cast<uint32_t>(BlockExecWeight::UNREACHABLE))
|
if (LoopWeight <= static_cast<uint32_t>(BlockExecWeight::UNREACHABLE))
|
||||||
LoopWeight = static_cast<uint32_t>(BlockExecWeight::LOWEST_NON_ZERO);
|
LoopWeight = static_cast<uint32_t>(BlockExecWeight::LOWEST_NON_ZERO);
|
||||||
|
|
||||||
EstimatedLoopWeight.insert(
|
EstimatedLoopWeight.insert({LoopBB.getLoopData(), *LoopWeight});
|
||||||
{LoopBB.getLoopData(), LoopWeight.getValue()});
|
|
||||||
// Add all blocks entering the loop into working list.
|
// Add all blocks entering the loop into working list.
|
||||||
getLoopEnterBlocks(LoopBB, BlockWorkList);
|
getLoopEnterBlocks(LoopBB, BlockWorkList);
|
||||||
}
|
}
|
||||||
|
@ -875,7 +873,7 @@ void BranchProbabilityInfo::computeEestimateBlockWeight(
|
||||||
auto MaxWeight = getMaxEstimatedEdgeWeight(LoopBB, successors(BB));
|
auto MaxWeight = getMaxEstimatedEdgeWeight(LoopBB, successors(BB));
|
||||||
|
|
||||||
if (MaxWeight)
|
if (MaxWeight)
|
||||||
propagateEstimatedBlockWeight(LoopBB, DT, PDT, MaxWeight.getValue(),
|
propagateEstimatedBlockWeight(LoopBB, DT, PDT, *MaxWeight,
|
||||||
BlockWorkList, LoopWorkList);
|
BlockWorkList, LoopWorkList);
|
||||||
}
|
}
|
||||||
} while (!BlockWorkList.empty() || !LoopWorkList.empty());
|
} while (!BlockWorkList.empty() || !LoopWorkList.empty());
|
||||||
|
|
|
@ -2056,7 +2056,7 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
|
||||||
case Intrinsic::experimental_constrained_rint: {
|
case Intrinsic::experimental_constrained_rint: {
|
||||||
auto CI = cast<ConstrainedFPIntrinsic>(Call);
|
auto CI = cast<ConstrainedFPIntrinsic>(Call);
|
||||||
RM = CI->getRoundingMode();
|
RM = CI->getRoundingMode();
|
||||||
if (!RM || RM.getValue() == RoundingMode::Dynamic)
|
if (!RM || *RM == RoundingMode::Dynamic)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1205,7 +1205,7 @@ SimilarityGroupList &IRSimilarityIdentifier::findSimilarity(
|
||||||
populateMapper(Modules, InstrList, IntegerMapping);
|
populateMapper(Modules, InstrList, IntegerMapping);
|
||||||
findCandidates(InstrList, IntegerMapping);
|
findCandidates(InstrList, IntegerMapping);
|
||||||
|
|
||||||
return SimilarityCandidates.getValue();
|
return *SimilarityCandidates;
|
||||||
}
|
}
|
||||||
|
|
||||||
SimilarityGroupList &IRSimilarityIdentifier::findSimilarity(Module &M) {
|
SimilarityGroupList &IRSimilarityIdentifier::findSimilarity(Module &M) {
|
||||||
|
@ -1222,7 +1222,7 @@ SimilarityGroupList &IRSimilarityIdentifier::findSimilarity(Module &M) {
|
||||||
populateMapper(M, InstrList, IntegerMapping);
|
populateMapper(M, InstrList, IntegerMapping);
|
||||||
findCandidates(InstrList, IntegerMapping);
|
findCandidates(InstrList, IntegerMapping);
|
||||||
|
|
||||||
return SimilarityCandidates.getValue();
|
return *SimilarityCandidates;
|
||||||
}
|
}
|
||||||
|
|
||||||
INITIALIZE_PASS(IRSimilarityIdentifierWrapperPass, "ir-similarity-identifier",
|
INITIALIZE_PASS(IRSimilarityIdentifierWrapperPass, "ir-similarity-identifier",
|
||||||
|
|
|
@ -578,8 +578,7 @@ const char *InlineAdvisor::getAnnotatedInlinePassName() {
|
||||||
|
|
||||||
// IC is constant and initialized in constructor, so compute the annotated
|
// IC is constant and initialized in constructor, so compute the annotated
|
||||||
// name only once.
|
// name only once.
|
||||||
static const std::string PassName =
|
static const std::string PassName = llvm::AnnotateInlinePassName(*IC);
|
||||||
llvm::AnnotateInlinePassName(IC.getValue());
|
|
||||||
|
|
||||||
return PassName.c_str();
|
return PassName.c_str();
|
||||||
}
|
}
|
||||||
|
|
|
@ -836,7 +836,7 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
|
||||||
auto *CallerBB = CandidateCall.getParent();
|
auto *CallerBB = CandidateCall.getParent();
|
||||||
BlockFrequencyInfo *CallerBFI = &(GetBFI(*(CallerBB->getParent())));
|
BlockFrequencyInfo *CallerBFI = &(GetBFI(*(CallerBB->getParent())));
|
||||||
CycleSavings += getCallsiteCost(this->CandidateCall, DL);
|
CycleSavings += getCallsiteCost(this->CandidateCall, DL);
|
||||||
CycleSavings *= CallerBFI->getBlockProfileCount(CallerBB).getValue();
|
CycleSavings *= *CallerBFI->getBlockProfileCount(CallerBB);
|
||||||
|
|
||||||
// Remove the cost of the cold basic blocks.
|
// Remove the cost of the cold basic blocks.
|
||||||
int Size = Cost - ColdSize;
|
int Size = Cost - ColdSize;
|
||||||
|
@ -906,7 +906,7 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
|
||||||
|
|
||||||
if (auto Result = costBenefitAnalysis()) {
|
if (auto Result = costBenefitAnalysis()) {
|
||||||
DecidedByCostBenefit = true;
|
DecidedByCostBenefit = true;
|
||||||
if (Result.getValue())
|
if (*Result)
|
||||||
return InlineResult::success();
|
return InlineResult::success();
|
||||||
else
|
else
|
||||||
return InlineResult::failure("Cost over threshold.");
|
return InlineResult::failure("Cost over threshold.");
|
||||||
|
@ -998,7 +998,7 @@ public:
|
||||||
BoostIndirectCalls(BoostIndirect), IgnoreThreshold(IgnoreThreshold),
|
BoostIndirectCalls(BoostIndirect), IgnoreThreshold(IgnoreThreshold),
|
||||||
CostBenefitAnalysisEnabled(isCostBenefitAnalysisEnabled()),
|
CostBenefitAnalysisEnabled(isCostBenefitAnalysisEnabled()),
|
||||||
Writer(this) {
|
Writer(this) {
|
||||||
AllowRecursiveCall = Params.AllowRecursiveCall.getValue();
|
AllowRecursiveCall = *Params.AllowRecursiveCall;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Annotation Writer for instruction details
|
/// Annotation Writer for instruction details
|
||||||
|
@ -1262,7 +1262,7 @@ void InlineCostAnnotationWriter::emitInstructionAnnot(
|
||||||
auto C = ICCA->getSimplifiedValue(const_cast<Instruction *>(I));
|
auto C = ICCA->getSimplifiedValue(const_cast<Instruction *>(I));
|
||||||
if (C) {
|
if (C) {
|
||||||
OS << ", simplified to ";
|
OS << ", simplified to ";
|
||||||
C.getValue()->print(OS, true);
|
(*C)->print(OS, true);
|
||||||
}
|
}
|
||||||
OS << "\n";
|
OS << "\n";
|
||||||
}
|
}
|
||||||
|
@ -1855,7 +1855,7 @@ void InlineCostCallAnalyzer::updateThreshold(CallBase &Call, Function &Callee) {
|
||||||
// current threshold, but AutoFDO + ThinLTO currently relies on this
|
// current threshold, but AutoFDO + ThinLTO currently relies on this
|
||||||
// behavior to prevent inlining of hot callsites during ThinLTO
|
// behavior to prevent inlining of hot callsites during ThinLTO
|
||||||
// compile phase.
|
// compile phase.
|
||||||
Threshold = HotCallSiteThreshold.getValue();
|
Threshold = *HotCallSiteThreshold;
|
||||||
} else if (isColdCallSite(Call, CallerBFI)) {
|
} else if (isColdCallSite(Call, CallerBFI)) {
|
||||||
LLVM_DEBUG(dbgs() << "Cold callsite.\n");
|
LLVM_DEBUG(dbgs() << "Cold callsite.\n");
|
||||||
// Do not apply bonuses for a cold callsite including the
|
// Do not apply bonuses for a cold callsite including the
|
||||||
|
|
|
@ -1353,7 +1353,7 @@ static Optional<ValueLatticeElement> getEdgeValueLocal(Value *Val,
|
||||||
ValueLatticeElement OpLatticeVal =
|
ValueLatticeElement OpLatticeVal =
|
||||||
getValueFromCondition(Op, Condition, isTrueDest);
|
getValueFromCondition(Op, Condition, isTrueDest);
|
||||||
if (Optional<APInt> OpConst = OpLatticeVal.asConstantInteger()) {
|
if (Optional<APInt> OpConst = OpLatticeVal.asConstantInteger()) {
|
||||||
Result = constantFoldUser(Usr, Op, OpConst.getValue(), DL);
|
Result = constantFoldUser(Usr, Op, *OpConst, DL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -367,7 +367,7 @@ static void computeFunctionSummary(
|
||||||
// We should have named any anonymous globals
|
// We should have named any anonymous globals
|
||||||
assert(CalledFunction->hasName());
|
assert(CalledFunction->hasName());
|
||||||
auto ScaledCount = PSI->getProfileCount(*CB, BFI);
|
auto ScaledCount = PSI->getProfileCount(*CB, BFI);
|
||||||
auto Hotness = ScaledCount ? getHotness(ScaledCount.getValue(), PSI)
|
auto Hotness = ScaledCount ? getHotness(*ScaledCount, PSI)
|
||||||
: CalleeInfo::HotnessType::Unknown;
|
: CalleeInfo::HotnessType::Unknown;
|
||||||
if (ForceSummaryEdgesCold != FunctionSummary::FSHT_None)
|
if (ForceSummaryEdgesCold != FunctionSummary::FSHT_None)
|
||||||
Hotness = CalleeInfo::HotnessType::Cold;
|
Hotness = CalleeInfo::HotnessType::Cold;
|
||||||
|
|
|
@ -124,7 +124,7 @@ bool ProfileSummaryInfo::isFunctionHotInCallGraph(
|
||||||
for (const auto &I : BB)
|
for (const auto &I : BB)
|
||||||
if (isa<CallInst>(I) || isa<InvokeInst>(I))
|
if (isa<CallInst>(I) || isa<InvokeInst>(I))
|
||||||
if (auto CallCount = getProfileCount(cast<CallBase>(I), nullptr))
|
if (auto CallCount = getProfileCount(cast<CallBase>(I), nullptr))
|
||||||
TotalCallCount += CallCount.getValue();
|
TotalCallCount += *CallCount;
|
||||||
if (isHotCount(TotalCallCount))
|
if (isHotCount(TotalCallCount))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ bool ProfileSummaryInfo::isFunctionColdInCallGraph(
|
||||||
for (const auto &I : BB)
|
for (const auto &I : BB)
|
||||||
if (isa<CallInst>(I) || isa<InvokeInst>(I))
|
if (isa<CallInst>(I) || isa<InvokeInst>(I))
|
||||||
if (auto CallCount = getProfileCount(cast<CallBase>(I), nullptr))
|
if (auto CallCount = getProfileCount(cast<CallBase>(I), nullptr))
|
||||||
TotalCallCount += CallCount.getValue();
|
TotalCallCount += *CallCount;
|
||||||
if (!isColdCount(TotalCallCount))
|
if (!isColdCount(TotalCallCount))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ bool ProfileSummaryInfo::isFunctionHotOrColdInCallGraphNthPercentile(
|
||||||
for (const auto &I : BB)
|
for (const auto &I : BB)
|
||||||
if (isa<CallInst>(I) || isa<InvokeInst>(I))
|
if (isa<CallInst>(I) || isa<InvokeInst>(I))
|
||||||
if (auto CallCount = getProfileCount(cast<CallBase>(I), nullptr))
|
if (auto CallCount = getProfileCount(cast<CallBase>(I), nullptr))
|
||||||
TotalCallCount += CallCount.getValue();
|
TotalCallCount += *CallCount;
|
||||||
if (isHot && isHotCountNthPercentile(PercentileCutoff, TotalCallCount))
|
if (isHot && isHotCountNthPercentile(PercentileCutoff, TotalCallCount))
|
||||||
return true;
|
return true;
|
||||||
if (!isHot && !isColdCountNthPercentile(PercentileCutoff, TotalCallCount))
|
if (!isHot && !isColdCountNthPercentile(PercentileCutoff, TotalCallCount))
|
||||||
|
|
|
@ -9951,7 +9951,7 @@ ScalarEvolution::howFarToZero(const SCEV *V, const Loop *L, bool ControlsExit,
|
||||||
// value at this index. When solving for "X*X != 5", for example, we
|
// value at this index. When solving for "X*X != 5", for example, we
|
||||||
// should not accept a root of 2.
|
// should not accept a root of 2.
|
||||||
if (auto S = SolveQuadraticAddRecExact(AddRec, *this)) {
|
if (auto S = SolveQuadraticAddRecExact(AddRec, *this)) {
|
||||||
const auto *R = cast<SCEVConstant>(getConstant(S.getValue()));
|
const auto *R = cast<SCEVConstant>(getConstant(*S));
|
||||||
return ExitLimit(R, R, false, Predicates);
|
return ExitLimit(R, R, false, Predicates);
|
||||||
}
|
}
|
||||||
return getCouldNotCompute();
|
return getCouldNotCompute();
|
||||||
|
@ -12781,7 +12781,7 @@ const SCEV *SCEVAddRecExpr::getNumIterationsInRange(const ConstantRange &Range,
|
||||||
|
|
||||||
if (isQuadratic()) {
|
if (isQuadratic()) {
|
||||||
if (auto S = SolveQuadraticAddRecRange(this, Range, SE))
|
if (auto S = SolveQuadraticAddRecRange(this, Range, SE))
|
||||||
return SE.getConstant(S.getValue());
|
return SE.getConstant(*S);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SE.getCouldNotCompute();
|
return SE.getCouldNotCompute();
|
||||||
|
|
|
@ -70,7 +70,7 @@ static const AllocaInst *findMatchingAlloca(const IntrinsicInst &II,
|
||||||
auto AllocaSizeInBits = AI->getAllocationSizeInBits(DL);
|
auto AllocaSizeInBits = AI->getAllocationSizeInBits(DL);
|
||||||
if (!AllocaSizeInBits)
|
if (!AllocaSizeInBits)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
int64_t AllocaSize = AllocaSizeInBits.getValue() / 8;
|
int64_t AllocaSize = *AllocaSizeInBits / 8;
|
||||||
|
|
||||||
auto *Size = dyn_cast<ConstantInt>(II.getArgOperand(0));
|
auto *Size = dyn_cast<ConstantInt>(II.getArgOperand(0));
|
||||||
if (!Size)
|
if (!Size)
|
||||||
|
|
|
@ -54,7 +54,7 @@ void SyntheticCountsUtils<CallGraphType>::propagateFromSCC(
|
||||||
if (!OptProfCount)
|
if (!OptProfCount)
|
||||||
continue;
|
continue;
|
||||||
auto Callee = CGT::edge_dest(E.second);
|
auto Callee = CGT::edge_dest(E.second);
|
||||||
AdditionalCounts[Callee] += OptProfCount.getValue();
|
AdditionalCounts[Callee] += *OptProfCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the counts for the nodes in the SCC.
|
// Update the counts for the nodes in the SCC.
|
||||||
|
@ -67,7 +67,7 @@ void SyntheticCountsUtils<CallGraphType>::propagateFromSCC(
|
||||||
if (!OptProfCount)
|
if (!OptProfCount)
|
||||||
continue;
|
continue;
|
||||||
auto Callee = CGT::edge_dest(E.second);
|
auto Callee = CGT::edge_dest(E.second);
|
||||||
AddCount(Callee, OptProfCount.getValue());
|
AddCount(Callee, *OptProfCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1755,8 +1755,7 @@ static void computeKnownBitsFromOperator(const Operator *I,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned FirstZeroHighBit =
|
unsigned FirstZeroHighBit = 32 - countLeadingZeros(*VScaleMax);
|
||||||
32 - countLeadingZeros(VScaleMax.getValue());
|
|
||||||
if (FirstZeroHighBit < BitWidth)
|
if (FirstZeroHighBit < BitWidth)
|
||||||
Known.Zero.setBitsFrom(FirstZeroHighBit);
|
Known.Zero.setBitsFrom(FirstZeroHighBit);
|
||||||
|
|
||||||
|
|
|
@ -270,7 +270,7 @@ bool LLParser::validateEndOfModule(bool UpgradeDebugInfo) {
|
||||||
// remangle intrinsics names as well.
|
// remangle intrinsics names as well.
|
||||||
for (Function &F : llvm::make_early_inc_range(*M)) {
|
for (Function &F : llvm::make_early_inc_range(*M)) {
|
||||||
if (auto Remangled = Intrinsic::remangleIntrinsicFunction(&F)) {
|
if (auto Remangled = Intrinsic::remangleIntrinsicFunction(&F)) {
|
||||||
F.replaceAllUsesWith(Remangled.getValue());
|
F.replaceAllUsesWith(*Remangled);
|
||||||
F.eraseFromParent();
|
F.eraseFromParent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3331,7 +3331,7 @@ Error BitcodeReader::globalCleanup() {
|
||||||
// Some types could be renamed during loading if several modules are
|
// Some types could be renamed during loading if several modules are
|
||||||
// loaded in the same LLVMContext (LTO scenario). In this case we should
|
// loaded in the same LLVMContext (LTO scenario). In this case we should
|
||||||
// remangle intrinsics names as well.
|
// remangle intrinsics names as well.
|
||||||
RemangledIntrinsics[&F] = Remangled.getValue();
|
RemangledIntrinsics[&F] = *Remangled;
|
||||||
// Look for functions that rely on old function attribute behavior.
|
// Look for functions that rely on old function attribute behavior.
|
||||||
UpgradeFunctionAttributes(F);
|
UpgradeFunctionAttributes(F);
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,7 +203,7 @@ void DbgValueHistoryMap::trimLocationRanges(
|
||||||
if (auto R = intersects(StartMI, EndMI, ScopeRanges, Ordering)) {
|
if (auto R = intersects(StartMI, EndMI, ScopeRanges, Ordering)) {
|
||||||
// Adjust ScopeRanges to exclude ranges which subsequent location ranges
|
// Adjust ScopeRanges to exclude ranges which subsequent location ranges
|
||||||
// cannot possibly intersect.
|
// cannot possibly intersect.
|
||||||
ScopeRanges = ArrayRef<InsnRange>(R.getValue(), ScopeRanges.end());
|
ScopeRanges = ArrayRef<InsnRange>(*R, ScopeRanges.end());
|
||||||
} else {
|
} else {
|
||||||
// If the location range does not intersect any scope range then the
|
// If the location range does not intersect any scope range then the
|
||||||
// DBG_VALUE which opened this location range is usless, mark it for
|
// DBG_VALUE which opened this location range is usless, mark it for
|
||||||
|
|
|
@ -799,7 +799,7 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, const DIDerivedType *DTy) {
|
||||||
// or reference types.
|
// or reference types.
|
||||||
if (DTy->getDWARFAddressSpace())
|
if (DTy->getDWARFAddressSpace())
|
||||||
addUInt(Buffer, dwarf::DW_AT_address_class, dwarf::DW_FORM_data4,
|
addUInt(Buffer, dwarf::DW_AT_address_class, dwarf::DW_FORM_data4,
|
||||||
DTy->getDWARFAddressSpace().getValue());
|
*DTy->getDWARFAddressSpace());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DwarfUnit::constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args) {
|
void DwarfUnit::constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args) {
|
||||||
|
|
|
@ -245,7 +245,7 @@ assignSections(MachineFunction &MF,
|
||||||
if (EHPadsSectionID == MBBSectionID::ExceptionSectionID)
|
if (EHPadsSectionID == MBBSectionID::ExceptionSectionID)
|
||||||
for (auto &MBB : MF)
|
for (auto &MBB : MF)
|
||||||
if (MBB.isEHPad())
|
if (MBB.isEHPad())
|
||||||
MBB.setSectionID(EHPadsSectionID.getValue());
|
MBB.setSectionID(*EHPadsSectionID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void llvm::sortBasicBlocksAndUpdateBranches(
|
void llvm::sortBasicBlocksAndUpdateBranches(
|
||||||
|
|
|
@ -3973,7 +3973,7 @@ bool CombinerHelper::matchExtractAllEltsFromBuildVector(
|
||||||
auto Cst = getIConstantVRegVal(II.getOperand(2).getReg(), MRI);
|
auto Cst = getIConstantVRegVal(II.getOperand(2).getReg(), MRI);
|
||||||
if (!Cst)
|
if (!Cst)
|
||||||
return false;
|
return false;
|
||||||
unsigned Idx = Cst.getValue().getZExtValue();
|
unsigned Idx = Cst->getZExtValue();
|
||||||
if (Idx >= NumElts)
|
if (Idx >= NumElts)
|
||||||
return false; // Out of range.
|
return false; // Out of range.
|
||||||
ExtractedElts.set(Idx);
|
ExtractedElts.set(Idx);
|
||||||
|
|
|
@ -1817,7 +1817,7 @@ static unsigned getConstrainedOpcode(Intrinsic::ID ID) {
|
||||||
|
|
||||||
bool IRTranslator::translateConstrainedFPIntrinsic(
|
bool IRTranslator::translateConstrainedFPIntrinsic(
|
||||||
const ConstrainedFPIntrinsic &FPI, MachineIRBuilder &MIRBuilder) {
|
const ConstrainedFPIntrinsic &FPI, MachineIRBuilder &MIRBuilder) {
|
||||||
fp::ExceptionBehavior EB = FPI.getExceptionBehavior().getValue();
|
fp::ExceptionBehavior EB = *FPI.getExceptionBehavior();
|
||||||
|
|
||||||
unsigned Opcode = getConstrainedOpcode(FPI.getIntrinsicID());
|
unsigned Opcode = getConstrainedOpcode(FPI.getIntrinsicID());
|
||||||
if (!Opcode)
|
if (!Opcode)
|
||||||
|
@ -2264,7 +2264,7 @@ bool IRTranslator::translateKnownIntrinsic(const CallInst &CI, Intrinsic::ID ID,
|
||||||
.buildInstr(TargetOpcode::G_INTRINSIC_FPTRUNC_ROUND,
|
.buildInstr(TargetOpcode::G_INTRINSIC_FPTRUNC_ROUND,
|
||||||
{getOrCreateVReg(CI)},
|
{getOrCreateVReg(CI)},
|
||||||
{getOrCreateVReg(*CI.getArgOperand(0))}, Flags)
|
{getOrCreateVReg(*CI.getArgOperand(0))}, Flags)
|
||||||
.addImm((int)RoundMode.getValue());
|
.addImm((int)*RoundMode);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1618,7 +1618,7 @@ bool MIParser::assignRegisterTies(MachineInstr &MI,
|
||||||
continue;
|
continue;
|
||||||
// The parser ensures that this operand is a register use, so we just have
|
// The parser ensures that this operand is a register use, so we just have
|
||||||
// to check the tied-def operand.
|
// to check the tied-def operand.
|
||||||
unsigned DefIdx = Operands[I].TiedDefIdx.getValue();
|
unsigned DefIdx = *Operands[I].TiedDefIdx;
|
||||||
if (DefIdx >= E)
|
if (DefIdx >= E)
|
||||||
return error(Operands[I].Begin,
|
return error(Operands[I].Begin,
|
||||||
Twine("use of invalid tied-def operand index '" +
|
Twine("use of invalid tied-def operand index '" +
|
||||||
|
|
|
@ -643,7 +643,7 @@ bool MIRParserImpl::parseRegisterInfo(PerFunctionMIParsingState &PFS,
|
||||||
// be saved for the caller).
|
// be saved for the caller).
|
||||||
if (YamlMF.CalleeSavedRegisters) {
|
if (YamlMF.CalleeSavedRegisters) {
|
||||||
SmallVector<MCPhysReg, 16> CalleeSavedRegisters;
|
SmallVector<MCPhysReg, 16> CalleeSavedRegisters;
|
||||||
for (const auto &RegSource : YamlMF.CalleeSavedRegisters.getValue()) {
|
for (const auto &RegSource : *YamlMF.CalleeSavedRegisters) {
|
||||||
Register Reg;
|
Register Reg;
|
||||||
if (parseNamedRegisterReference(PFS, Reg, RegSource.Value, Error))
|
if (parseNamedRegisterReference(PFS, Reg, RegSource.Value, Error))
|
||||||
return error(Error, RegSource.SourceRange);
|
return error(Error, RegSource.SourceRange);
|
||||||
|
@ -814,7 +814,7 @@ bool MIRParserImpl::initializeFrameInfo(PerFunctionMIParsingState &PFS,
|
||||||
Object.CalleeSavedRestored, ObjectIdx))
|
Object.CalleeSavedRestored, ObjectIdx))
|
||||||
return true;
|
return true;
|
||||||
if (Object.LocalOffset)
|
if (Object.LocalOffset)
|
||||||
MFI.mapLocalFrameObject(ObjectIdx, Object.LocalOffset.getValue());
|
MFI.mapLocalFrameObject(ObjectIdx, *Object.LocalOffset);
|
||||||
if (parseStackObjectsDebugInfo(PFS, Object, ObjectIdx))
|
if (parseStackObjectsDebugInfo(PFS, Object, ObjectIdx))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1431,7 +1431,7 @@ Register KernelRewriter::remapUse(Register Reg, MachineInstr &MI) {
|
||||||
Register R = MRI.createVirtualRegister(RC);
|
Register R = MRI.createVirtualRegister(RC);
|
||||||
MachineInstr *IllegalPhi =
|
MachineInstr *IllegalPhi =
|
||||||
BuildMI(*BB, MI, DebugLoc(), TII->get(TargetOpcode::PHI), R)
|
BuildMI(*BB, MI, DebugLoc(), TII->get(TargetOpcode::PHI), R)
|
||||||
.addReg(IllegalPhiDefault.getValue())
|
.addReg(*IllegalPhiDefault)
|
||||||
.addMBB(PreheaderBB) // Block choice is arbitrary and has no effect.
|
.addMBB(PreheaderBB) // Block choice is arbitrary and has no effect.
|
||||||
.addReg(LoopReg)
|
.addReg(LoopReg)
|
||||||
.addMBB(BB); // Block choice is arbitrary and has no effect.
|
.addMBB(BB); // Block choice is arbitrary and has no effect.
|
||||||
|
|
|
@ -924,7 +924,7 @@ Optional<uint64_t> SelectOptimize::computeInstCost(const Instruction *I) {
|
||||||
InstructionCost ICost =
|
InstructionCost ICost =
|
||||||
TTI->getInstructionCost(I, TargetTransformInfo::TCK_Latency);
|
TTI->getInstructionCost(I, TargetTransformInfo::TCK_Latency);
|
||||||
if (auto OC = ICost.getValue())
|
if (auto OC = ICost.getValue())
|
||||||
return Optional<uint64_t>(OC.getValue());
|
return Optional<uint64_t>(*OC);
|
||||||
return Optional<uint64_t>(None);
|
return Optional<uint64_t>(None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17928,7 +17928,7 @@ bool DAGCombiner::mergeStoresOfConstantsOrVecElts(
|
||||||
if (!UseTrunc) {
|
if (!UseTrunc) {
|
||||||
NewStore = DAG.getStore(NewChain, DL, StoredVal, FirstInChain->getBasePtr(),
|
NewStore = DAG.getStore(NewChain, DL, StoredVal, FirstInChain->getBasePtr(),
|
||||||
FirstInChain->getPointerInfo(),
|
FirstInChain->getPointerInfo(),
|
||||||
FirstInChain->getAlign(), Flags.getValue(), AAInfo);
|
FirstInChain->getAlign(), *Flags, AAInfo);
|
||||||
} else { // Must be realized as a trunc store
|
} else { // Must be realized as a trunc store
|
||||||
EVT LegalizedStoredValTy =
|
EVT LegalizedStoredValTy =
|
||||||
TLI.getTypeToTransformTo(*DAG.getContext(), StoredVal.getValueType());
|
TLI.getTypeToTransformTo(*DAG.getContext(), StoredVal.getValueType());
|
||||||
|
@ -17940,7 +17940,7 @@ bool DAGCombiner::mergeStoresOfConstantsOrVecElts(
|
||||||
NewStore = DAG.getTruncStore(
|
NewStore = DAG.getTruncStore(
|
||||||
NewChain, DL, ExtendedStoreVal, FirstInChain->getBasePtr(),
|
NewChain, DL, ExtendedStoreVal, FirstInChain->getBasePtr(),
|
||||||
FirstInChain->getPointerInfo(), StoredVal.getValueType() /*TVT*/,
|
FirstInChain->getPointerInfo(), StoredVal.getValueType() /*TVT*/,
|
||||||
FirstInChain->getAlign(), Flags.getValue(), AAInfo);
|
FirstInChain->getAlign(), *Flags, AAInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace all merged stores with the new store.
|
// Replace all merged stores with the new store.
|
||||||
|
|
|
@ -5543,7 +5543,7 @@ SDValue SelectionDAG::FoldConstantArithmetic(unsigned Opcode, const SDLoc &DL,
|
||||||
if (!FoldAttempt)
|
if (!FoldAttempt)
|
||||||
return SDValue();
|
return SDValue();
|
||||||
|
|
||||||
SDValue Folded = getConstant(FoldAttempt.getValue(), DL, VT);
|
SDValue Folded = getConstant(*FoldAttempt, DL, VT);
|
||||||
assert((!Folded || !VT.isVector()) &&
|
assert((!Folded || !VT.isVector()) &&
|
||||||
"Can't fold vectors ops with scalar operands");
|
"Can't fold vectors ops with scalar operands");
|
||||||
return Folded;
|
return Folded;
|
||||||
|
@ -5588,7 +5588,7 @@ SDValue SelectionDAG::FoldConstantArithmetic(unsigned Opcode, const SDLoc &DL,
|
||||||
Optional<APInt> Fold = FoldValue(Opcode, RawBits1[I], RawBits2[I]);
|
Optional<APInt> Fold = FoldValue(Opcode, RawBits1[I], RawBits2[I]);
|
||||||
if (!Fold)
|
if (!Fold)
|
||||||
break;
|
break;
|
||||||
RawBits.push_back(Fold.getValue());
|
RawBits.push_back(*Fold);
|
||||||
}
|
}
|
||||||
if (RawBits.size() == NumElts.getFixedValue()) {
|
if (RawBits.size() == NumElts.getFixedValue()) {
|
||||||
// We have constant folded, but we need to cast this again back to
|
// We have constant folded, but we need to cast this again back to
|
||||||
|
|
|
@ -337,7 +337,7 @@ static SDValue getCopyFromPartsVector(SelectionDAG &DAG, const SDLoc &DL,
|
||||||
|
|
||||||
if (IsABIRegCopy) {
|
if (IsABIRegCopy) {
|
||||||
NumRegs = TLI.getVectorTypeBreakdownForCallingConv(
|
NumRegs = TLI.getVectorTypeBreakdownForCallingConv(
|
||||||
*DAG.getContext(), CallConv.getValue(), ValueVT, IntermediateVT,
|
*DAG.getContext(), *CallConv, ValueVT, IntermediateVT,
|
||||||
NumIntermediates, RegisterVT);
|
NumIntermediates, RegisterVT);
|
||||||
} else {
|
} else {
|
||||||
NumRegs =
|
NumRegs =
|
||||||
|
@ -726,7 +726,7 @@ static void getCopyToPartsVector(SelectionDAG &DAG, const SDLoc &DL,
|
||||||
DestEltCnt = ElementCount::getFixed(NumIntermediates);
|
DestEltCnt = ElementCount::getFixed(NumIntermediates);
|
||||||
|
|
||||||
EVT BuiltVectorTy = EVT::getVectorVT(
|
EVT BuiltVectorTy = EVT::getVectorVT(
|
||||||
*DAG.getContext(), IntermediateVT.getScalarType(), DestEltCnt.getValue());
|
*DAG.getContext(), IntermediateVT.getScalarType(), *DestEltCnt);
|
||||||
|
|
||||||
if (ValueVT == BuiltVectorTy) {
|
if (ValueVT == BuiltVectorTy) {
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
|
@ -6372,7 +6372,7 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
|
||||||
SDValue Result;
|
SDValue Result;
|
||||||
Result = DAG.getNode(
|
Result = DAG.getNode(
|
||||||
ISD::FPTRUNC_ROUND, sdl, VT, getValue(I.getArgOperand(0)),
|
ISD::FPTRUNC_ROUND, sdl, VT, getValue(I.getArgOperand(0)),
|
||||||
DAG.getTargetConstant((int)RoundMode.getValue(), sdl,
|
DAG.getTargetConstant((int)*RoundMode, sdl,
|
||||||
TLI.getPointerTy(DAG.getDataLayout())));
|
TLI.getPointerTy(DAG.getDataLayout())));
|
||||||
setValue(&I, Result);
|
setValue(&I, Result);
|
||||||
|
|
||||||
|
@ -7303,7 +7303,7 @@ void SelectionDAGBuilder::visitConstrainedFPIntrinsic(
|
||||||
};
|
};
|
||||||
|
|
||||||
SDVTList VTs = DAG.getVTList(ValueVTs);
|
SDVTList VTs = DAG.getVTList(ValueVTs);
|
||||||
fp::ExceptionBehavior EB = FPI.getExceptionBehavior().getValue();
|
fp::ExceptionBehavior EB = *FPI.getExceptionBehavior();
|
||||||
|
|
||||||
SDNodeFlags Flags;
|
SDNodeFlags Flags;
|
||||||
if (EB == fp::ExceptionBehavior::ebIgnore)
|
if (EB == fp::ExceptionBehavior::ebIgnore)
|
||||||
|
@ -7386,7 +7386,7 @@ static unsigned getISDForVPIntrinsic(const VPIntrinsic &VPIntrin) {
|
||||||
: ISD::VP_REDUCE_FMUL;
|
: ISD::VP_REDUCE_FMUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ResOPC.getValue();
|
return *ResOPC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectionDAGBuilder::visitVPLoadGather(const VPIntrinsic &VPIntrin, EVT VT,
|
void SelectionDAGBuilder::visitVPLoadGather(const VPIntrinsic &VPIntrin, EVT VT,
|
||||||
|
|
|
@ -669,7 +669,7 @@ Error write(MCStreamer &Out, ArrayRef<std::string> Inputs) {
|
||||||
FoundCUUnit = true;
|
FoundCUUnit = true;
|
||||||
} else if (Header.UnitType == dwarf::DW_UT_split_type) {
|
} else if (Header.UnitType == dwarf::DW_UT_split_type) {
|
||||||
auto P = TypeIndexEntries.insert(
|
auto P = TypeIndexEntries.insert(
|
||||||
std::make_pair(Header.Signature.getValue(), Entry));
|
std::make_pair(*Header.Signature, Entry));
|
||||||
if (!P.second)
|
if (!P.second)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -389,7 +389,7 @@ void DWARFContext::dump(
|
||||||
OS << '\n' << Name << " contents:\n";
|
OS << '\n' << Name << " contents:\n";
|
||||||
if (auto DumpOffset = DumpOffsets[DIDT_ID_DebugInfo])
|
if (auto DumpOffset = DumpOffsets[DIDT_ID_DebugInfo])
|
||||||
for (const auto &U : Units)
|
for (const auto &U : Units)
|
||||||
U->getDIEForOffset(DumpOffset.getValue())
|
U->getDIEForOffset(*DumpOffset)
|
||||||
.dump(OS, 0, DumpOpts.noImplicitRecursion());
|
.dump(OS, 0, DumpOpts.noImplicitRecursion());
|
||||||
else
|
else
|
||||||
for (const auto &U : Units)
|
for (const auto &U : Units)
|
||||||
|
|
|
@ -115,7 +115,7 @@ Error DWARFDebugMacro::parseImpl(
|
||||||
if (IsMacro && Data.isValidOffset(Offset)) {
|
if (IsMacro && Data.isValidOffset(Offset)) {
|
||||||
// Keep a mapping from Macro contribution to CUs, this will
|
// Keep a mapping from Macro contribution to CUs, this will
|
||||||
// be needed while retrieving macro from DW_MACRO_define_strx form.
|
// be needed while retrieving macro from DW_MACRO_define_strx form.
|
||||||
for (const auto &U : Units.getValue())
|
for (const auto &U : *Units)
|
||||||
if (auto CUDIE = U->getUnitDIE())
|
if (auto CUDIE = U->getUnitDIE())
|
||||||
// Skip units which does not contibutes to macro section.
|
// Skip units which does not contibutes to macro section.
|
||||||
if (auto MacroOffset = toSectionOffset(CUDIE.find(DW_AT_macros)))
|
if (auto MacroOffset = toSectionOffset(CUDIE.find(DW_AT_macros)))
|
||||||
|
|
|
@ -139,8 +139,7 @@ static void dumpAttribute(raw_ostream &OS, const DWARFDie &Die,
|
||||||
Color = HighlightColor::String;
|
Color = HighlightColor::String;
|
||||||
if (const auto *LT = U->getContext().getLineTableForUnit(U))
|
if (const auto *LT = U->getContext().getLineTableForUnit(U))
|
||||||
if (LT->getFileNameByIndex(
|
if (LT->getFileNameByIndex(
|
||||||
FormValue.getAsUnsignedConstant().getValue(),
|
*FormValue.getAsUnsignedConstant(), U->getCompilationDir(),
|
||||||
U->getCompilationDir(),
|
|
||||||
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, File)) {
|
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, File)) {
|
||||||
File = '"' + File + '"';
|
File = '"' + File + '"';
|
||||||
Name = File;
|
Name = File;
|
||||||
|
|
|
@ -126,7 +126,7 @@ void IRSpeculationLayer::emit(std::unique_ptr<MaterializationResponsibility> R,
|
||||||
|
|
||||||
assert(Mutator.GetInsertBlock()->getParent() == &Fn &&
|
assert(Mutator.GetInsertBlock()->getParent() == &Fn &&
|
||||||
"IR builder association mismatch?");
|
"IR builder association mismatch?");
|
||||||
S.registerSymbols(internToJITSymbols(IRNames.getValue()),
|
S.registerSymbols(internToJITSymbols(*IRNames),
|
||||||
&R->getTargetJITDylib());
|
&R->getTargetJITDylib());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1032,7 +1032,7 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
|
||||||
// Remangle our intrinsic since we upgrade the mangling
|
// Remangle our intrinsic since we upgrade the mangling
|
||||||
auto Result = llvm::Intrinsic::remangleIntrinsicFunction(F);
|
auto Result = llvm::Intrinsic::remangleIntrinsicFunction(F);
|
||||||
if (Result != None) {
|
if (Result != None) {
|
||||||
NewFn = Result.getValue();
|
NewFn = *Result;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4497,7 +4497,7 @@ SwitchInstProfUpdateWrapper::CaseWeightOpt
|
||||||
SwitchInstProfUpdateWrapper::getSuccessorWeight(unsigned idx) {
|
SwitchInstProfUpdateWrapper::getSuccessorWeight(unsigned idx) {
|
||||||
if (!Weights)
|
if (!Weights)
|
||||||
return None;
|
return None;
|
||||||
return Weights.getValue()[idx];
|
return (*Weights)[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwitchInstProfUpdateWrapper::setSuccessorWeight(
|
void SwitchInstProfUpdateWrapper::setSuccessorWeight(
|
||||||
|
@ -4509,7 +4509,7 @@ void SwitchInstProfUpdateWrapper::setSuccessorWeight(
|
||||||
Weights = SmallVector<uint32_t, 8>(SI.getNumSuccessors(), 0);
|
Weights = SmallVector<uint32_t, 8>(SI.getNumSuccessors(), 0);
|
||||||
|
|
||||||
if (Weights) {
|
if (Weights) {
|
||||||
auto &OldW = Weights.getValue()[idx];
|
auto &OldW = (*Weights)[idx];
|
||||||
if (*W != OldW) {
|
if (*W != OldW) {
|
||||||
Changed = true;
|
Changed = true;
|
||||||
OldW = *W;
|
OldW = *W;
|
||||||
|
|
|
@ -314,7 +314,7 @@ ElementCount VPIntrinsic::getStaticVectorLength() const {
|
||||||
|
|
||||||
Value *VPIntrinsic::getMaskParam() const {
|
Value *VPIntrinsic::getMaskParam() const {
|
||||||
if (auto MaskPos = getMaskParamPos(getIntrinsicID()))
|
if (auto MaskPos = getMaskParamPos(getIntrinsicID()))
|
||||||
return getArgOperand(MaskPos.getValue());
|
return getArgOperand(*MaskPos);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ void VPIntrinsic::setMaskParam(Value *NewMask) {
|
||||||
|
|
||||||
Value *VPIntrinsic::getVectorLengthParam() const {
|
Value *VPIntrinsic::getVectorLengthParam() const {
|
||||||
if (auto EVLPos = getVectorLengthParamPos(getIntrinsicID()))
|
if (auto EVLPos = getVectorLengthParamPos(getIntrinsicID()))
|
||||||
return getArgOperand(EVLPos.getValue());
|
return getArgOperand(*EVLPos);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -194,7 +194,7 @@ public:
|
||||||
for (const std::string &Lib : Stub.NeededLibs)
|
for (const std::string &Lib : Stub.NeededLibs)
|
||||||
DynStr.Content.add(Lib);
|
DynStr.Content.add(Lib);
|
||||||
if (Stub.SoName)
|
if (Stub.SoName)
|
||||||
DynStr.Content.add(Stub.SoName.getValue());
|
DynStr.Content.add(*Stub.SoName);
|
||||||
|
|
||||||
std::vector<OutputSection<ELFT> *> Sections = {&DynSym, &DynStr, &DynTab,
|
std::vector<OutputSection<ELFT> *> Sections = {&DynSym, &DynStr, &DynTab,
|
||||||
&ShStrTab};
|
&ShStrTab};
|
||||||
|
@ -231,7 +231,7 @@ public:
|
||||||
DynTab.Content.addValue(DT_NEEDED, DynStr.Content.getOffset(Lib));
|
DynTab.Content.addValue(DT_NEEDED, DynStr.Content.getOffset(Lib));
|
||||||
if (Stub.SoName)
|
if (Stub.SoName)
|
||||||
DynTab.Content.addValue(DT_SONAME,
|
DynTab.Content.addValue(DT_SONAME,
|
||||||
DynStr.Content.getOffset(Stub.SoName.getValue()));
|
DynStr.Content.getOffset(*Stub.SoName));
|
||||||
DynTab.Size = DynTab.Content.getSize();
|
DynTab.Size = DynTab.Content.getSize();
|
||||||
// Calculate sections' addresses and offsets.
|
// Calculate sections' addresses and offsets.
|
||||||
uint64_t CurrentOffset = sizeof(Elf_Ehdr);
|
uint64_t CurrentOffset = sizeof(Elf_Ehdr);
|
||||||
|
@ -250,8 +250,7 @@ public:
|
||||||
fillStrTabShdr(ShStrTab);
|
fillStrTabShdr(ShStrTab);
|
||||||
|
|
||||||
// Finish initializing the ELF header.
|
// Finish initializing the ELF header.
|
||||||
initELFHeader<ELFT>(ElfHeader,
|
initELFHeader<ELFT>(ElfHeader, static_cast<uint16_t>(*Stub.Target.Arch));
|
||||||
static_cast<uint16_t>(Stub.Target.Arch.getValue()));
|
|
||||||
ElfHeader.e_shstrndx = ShStrTab.Index;
|
ElfHeader.e_shstrndx = ShStrTab.Index;
|
||||||
ElfHeader.e_shnum = LastSection->Index + 1;
|
ElfHeader.e_shnum = LastSection->Index + 1;
|
||||||
ElfHeader.e_shoff =
|
ElfHeader.e_shoff =
|
||||||
|
|
|
@ -193,7 +193,7 @@ Expected<std::unique_ptr<IFSStub>> ifs::readIFSFromBuffer(StringRef Buf) {
|
||||||
std::make_error_code(std::errc::invalid_argument));
|
std::make_error_code(std::errc::invalid_argument));
|
||||||
if (Stub->Target.ArchString) {
|
if (Stub->Target.ArchString) {
|
||||||
Stub->Target.Arch =
|
Stub->Target.Arch =
|
||||||
ELF::convertArchNameToEMachine(Stub->Target.ArchString.getValue());
|
ELF::convertArchNameToEMachine(*Stub->Target.ArchString);
|
||||||
}
|
}
|
||||||
return std::move(Stub);
|
return std::move(Stub);
|
||||||
}
|
}
|
||||||
|
@ -266,7 +266,7 @@ Error ifs::validateIFSTarget(IFSStub &Stub, bool ParseTriple) {
|
||||||
ValidationEC);
|
ValidationEC);
|
||||||
}
|
}
|
||||||
if (ParseTriple) {
|
if (ParseTriple) {
|
||||||
IFSTarget TargetFromTriple = parseTriple(Stub.Target.Triple.getValue());
|
IFSTarget TargetFromTriple = parseTriple(*Stub.Target.Triple);
|
||||||
Stub.Target.Arch = TargetFromTriple.Arch;
|
Stub.Target.Arch = TargetFromTriple.Arch;
|
||||||
Stub.Target.BitWidth = TargetFromTriple.BitWidth;
|
Stub.Target.BitWidth = TargetFromTriple.BitWidth;
|
||||||
Stub.Target.Endianness = TargetFromTriple.Endianness;
|
Stub.Target.Endianness = TargetFromTriple.Endianness;
|
||||||
|
|
|
@ -643,7 +643,7 @@ Error LTO::addModule(InputFile &Input, unsigned ModI,
|
||||||
// If only some modules were split, flag this in the index so that
|
// If only some modules were split, flag this in the index so that
|
||||||
// we can skip or error on optimizations that need consistently split
|
// we can skip or error on optimizations that need consistently split
|
||||||
// modules (whole program devirt and lower type tests).
|
// modules (whole program devirt and lower type tests).
|
||||||
if (EnableSplitLTOUnit.getValue() != LTOInfo->EnableSplitLTOUnit)
|
if (*EnableSplitLTOUnit != LTOInfo->EnableSplitLTOUnit)
|
||||||
ThinLTO.CombinedIndex.setPartiallySplitLTOUnits();
|
ThinLTO.CombinedIndex.setPartiallySplitLTOUnits();
|
||||||
} else
|
} else
|
||||||
EnableSplitLTOUnit = LTOInfo->EnableSplitLTOUnit;
|
EnableSplitLTOUnit = LTOInfo->EnableSplitLTOUnit;
|
||||||
|
|
|
@ -1046,7 +1046,7 @@ Expected<Constant *> IRLinker::linkGlobalValueProto(GlobalValue *SGV,
|
||||||
if (Function *F = dyn_cast<Function>(NewGV))
|
if (Function *F = dyn_cast<Function>(NewGV))
|
||||||
if (auto Remangled = Intrinsic::remangleIntrinsicFunction(F)) {
|
if (auto Remangled = Intrinsic::remangleIntrinsicFunction(F)) {
|
||||||
NewGV->eraseFromParent();
|
NewGV->eraseFromParent();
|
||||||
NewGV = Remangled.getValue();
|
NewGV = *Remangled;
|
||||||
NeedsRenaming = false;
|
NeedsRenaming = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -188,7 +188,7 @@ public:
|
||||||
|
|
||||||
// TODO: Parse UniqueID
|
// TODO: Parse UniqueID
|
||||||
MCSectionWasm *WS = getContext().getWasmSection(
|
MCSectionWasm *WS = getContext().getWasmSection(
|
||||||
Name, Kind.getValue(), Flags, GroupName, MCContext::GenericSectionID);
|
Name, *Kind, Flags, GroupName, MCContext::GenericSectionID);
|
||||||
|
|
||||||
if (WS->getSegmentFlags() != Flags)
|
if (WS->getSegmentFlags() != Flags)
|
||||||
Parser->Error(loc, "changed section flags for " + Name +
|
Parser->Error(loc, "changed section flags for " + Name +
|
||||||
|
|
|
@ -448,7 +448,7 @@ void XCOFFObjectWriter::executePostLayoutBinding(MCAssembler &Asm,
|
||||||
SectionMap[MCSec] = DwarfSec.get();
|
SectionMap[MCSec] = DwarfSec.get();
|
||||||
|
|
||||||
DwarfSectionEntry SecEntry(MCSec->getName(),
|
DwarfSectionEntry SecEntry(MCSec->getName(),
|
||||||
MCSec->getDwarfSubtypeFlags().getValue(),
|
*MCSec->getDwarfSubtypeFlags(),
|
||||||
std::move(DwarfSec));
|
std::move(DwarfSec));
|
||||||
DwarfSections.push_back(std::move(SecEntry));
|
DwarfSections.push_back(std::move(SecEntry));
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -264,8 +264,7 @@ static Error processLoadCommands(const MachOConfig &MachOConfig, Object &Obj) {
|
||||||
if (LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_SEGMENT_64 ||
|
if (LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_SEGMENT_64 ||
|
||||||
LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_SEGMENT) {
|
LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_SEGMENT) {
|
||||||
return LC.Sections.empty() &&
|
return LC.Sections.empty() &&
|
||||||
MachOConfig.EmptySegmentsToRemove.contains(
|
MachOConfig.EmptySegmentsToRemove.contains(*LC.getSegmentName());
|
||||||
LC.getSegmentName().getValue());
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
|
@ -307,7 +307,7 @@ SubtargetFeatures ELFObjectFileBase::getRISCVFeatures() const {
|
||||||
// The Arch pattern is [rv32|rv64][i|e]version(_[m|a|f|d|c]version)*
|
// The Arch pattern is [rv32|rv64][i|e]version(_[m|a|f|d|c]version)*
|
||||||
// Version string pattern is (major)p(minor). Major and minor are optional.
|
// Version string pattern is (major)p(minor). Major and minor are optional.
|
||||||
// For example, a version number could be 2p0, 2, or p92.
|
// For example, a version number could be 2p0, 2, or p92.
|
||||||
StringRef Arch = Attr.getValue();
|
StringRef Arch = *Attr;
|
||||||
if (Arch.consume_front("rv32"))
|
if (Arch.consume_front("rv32"))
|
||||||
Features.AddFeature("64bit", false);
|
Features.AddFeature("64bit", false);
|
||||||
else if (Arch.consume_front("rv64"))
|
else if (Arch.consume_front("rv64"))
|
||||||
|
|
|
@ -1520,7 +1520,7 @@ Error WasmObjectFile::parseElemSection(ReadContext &Ctx) {
|
||||||
Error WasmObjectFile::parseDataSection(ReadContext &Ctx) {
|
Error WasmObjectFile::parseDataSection(ReadContext &Ctx) {
|
||||||
DataSection = Sections.size();
|
DataSection = Sections.size();
|
||||||
uint32_t Count = readVaruint32(Ctx);
|
uint32_t Count = readVaruint32(Ctx);
|
||||||
if (DataCount && Count != DataCount.getValue())
|
if (DataCount && Count != *DataCount)
|
||||||
return make_error<GenericBinaryError>(
|
return make_error<GenericBinaryError>(
|
||||||
"number of data segments does not match DataCount section");
|
"number of data segments does not match DataCount section");
|
||||||
DataSegments.reserve(Count);
|
DataSegments.reserve(Count);
|
||||||
|
|
|
@ -1342,7 +1342,7 @@ XCOFFTracebackTable::XCOFFTracebackTable(const uint8_t *Ptr, uint64_t &Size,
|
||||||
NumOfCtlAnchors = DE.getU32(Cur);
|
NumOfCtlAnchors = DE.getU32(Cur);
|
||||||
if (Cur && NumOfCtlAnchors) {
|
if (Cur && NumOfCtlAnchors) {
|
||||||
SmallVector<uint32_t, 8> Disp;
|
SmallVector<uint32_t, 8> Disp;
|
||||||
Disp.reserve(NumOfCtlAnchors.getValue());
|
Disp.reserve(*NumOfCtlAnchors);
|
||||||
for (uint32_t I = 0; I < NumOfCtlAnchors && Cur; ++I)
|
for (uint32_t I = 0; I < NumOfCtlAnchors && Cur; ++I)
|
||||||
Disp.push_back(DE.getU32(Cur));
|
Disp.push_back(DE.getU32(Cur));
|
||||||
if (Cur)
|
if (Cur)
|
||||||
|
@ -1369,7 +1369,7 @@ XCOFFTracebackTable::XCOFFTracebackTable(const uint8_t *Ptr, uint64_t &Size,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
VecExt = TBVecExtOrErr.get();
|
VecExt = TBVecExtOrErr.get();
|
||||||
VectorParmsNum = VecExt.getValue().getNumberOfVectorParms();
|
VectorParmsNum = VecExt->getNumberOfVectorParms();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -596,7 +596,7 @@ unsigned ELFState<ELFT>::toSectionIndex(StringRef S, StringRef LocSec,
|
||||||
const ELFYAML::SectionHeaderTable &SectionHeaders =
|
const ELFYAML::SectionHeaderTable &SectionHeaders =
|
||||||
Doc.getSectionHeaderTable();
|
Doc.getSectionHeaderTable();
|
||||||
if (SectionHeaders.IsImplicit ||
|
if (SectionHeaders.IsImplicit ||
|
||||||
(SectionHeaders.NoHeaders && !SectionHeaders.NoHeaders.getValue()) ||
|
(SectionHeaders.NoHeaders && !*SectionHeaders.NoHeaders) ||
|
||||||
SectionHeaders.isDefault())
|
SectionHeaders.isDefault())
|
||||||
return Index;
|
return Index;
|
||||||
|
|
||||||
|
|
|
@ -340,7 +340,7 @@ Optional<bool> KnownBits::eq(const KnownBits &LHS, const KnownBits &RHS) {
|
||||||
|
|
||||||
Optional<bool> KnownBits::ne(const KnownBits &LHS, const KnownBits &RHS) {
|
Optional<bool> KnownBits::ne(const KnownBits &LHS, const KnownBits &RHS) {
|
||||||
if (Optional<bool> KnownEQ = eq(LHS, RHS))
|
if (Optional<bool> KnownEQ = eq(LHS, RHS))
|
||||||
return Optional<bool>(!KnownEQ.getValue());
|
return Optional<bool>(!*KnownEQ);
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,7 +356,7 @@ Optional<bool> KnownBits::ugt(const KnownBits &LHS, const KnownBits &RHS) {
|
||||||
|
|
||||||
Optional<bool> KnownBits::uge(const KnownBits &LHS, const KnownBits &RHS) {
|
Optional<bool> KnownBits::uge(const KnownBits &LHS, const KnownBits &RHS) {
|
||||||
if (Optional<bool> IsUGT = ugt(RHS, LHS))
|
if (Optional<bool> IsUGT = ugt(RHS, LHS))
|
||||||
return Optional<bool>(!IsUGT.getValue());
|
return Optional<bool>(!*IsUGT);
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -380,7 +380,7 @@ Optional<bool> KnownBits::sgt(const KnownBits &LHS, const KnownBits &RHS) {
|
||||||
|
|
||||||
Optional<bool> KnownBits::sge(const KnownBits &LHS, const KnownBits &RHS) {
|
Optional<bool> KnownBits::sge(const KnownBits &LHS, const KnownBits &RHS) {
|
||||||
if (Optional<bool> KnownSGT = sgt(RHS, LHS))
|
if (Optional<bool> KnownSGT = sgt(RHS, LHS))
|
||||||
return Optional<bool>(!KnownSGT.getValue());
|
return Optional<bool>(!*KnownSGT);
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -415,7 +415,7 @@ bool AArch64MIPeepholeOpt::splitTwoPartImm(
|
||||||
Imm &= 0xFFFFFFFF;
|
Imm &= 0xFFFFFFFF;
|
||||||
OpcodePair Opcode;
|
OpcodePair Opcode;
|
||||||
if (auto R = SplitAndOpc(Imm, RegSize, Imm0, Imm1))
|
if (auto R = SplitAndOpc(Imm, RegSize, Imm0, Imm1))
|
||||||
Opcode = R.getValue();
|
Opcode = *R;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -417,7 +417,7 @@ bool AArch64StackTagging::isInterestingAlloca(const AllocaInst &AI) {
|
||||||
bool IsInteresting =
|
bool IsInteresting =
|
||||||
AI.getAllocatedType()->isSized() && AI.isStaticAlloca() &&
|
AI.getAllocatedType()->isSized() && AI.isStaticAlloca() &&
|
||||||
// alloca() may be called with 0 size, ignore it.
|
// alloca() may be called with 0 size, ignore it.
|
||||||
AI.getAllocationSizeInBits(*DL).getValue() > 0 &&
|
*AI.getAllocationSizeInBits(*DL) > 0 &&
|
||||||
// inalloca allocas are not treated as static, and we don't want
|
// inalloca allocas are not treated as static, and we don't want
|
||||||
// dynamic alloca instrumentation for them as well.
|
// dynamic alloca instrumentation for them as well.
|
||||||
!AI.isUsedWithInAlloca() &&
|
!AI.isUsedWithInAlloca() &&
|
||||||
|
@ -573,7 +573,7 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) {
|
||||||
End->eraseFromParent();
|
End->eraseFromParent();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uint64_t Size = Info.AI->getAllocationSizeInBits(*DL).getValue() / 8;
|
uint64_t Size = *Info.AI->getAllocationSizeInBits(*DL) / 8;
|
||||||
Value *Ptr = IRB.CreatePointerCast(TagPCall, IRB.getInt8PtrTy());
|
Value *Ptr = IRB.CreatePointerCast(TagPCall, IRB.getInt8PtrTy());
|
||||||
tagAlloca(AI, &*IRB.GetInsertPoint(), Ptr, Size);
|
tagAlloca(AI, &*IRB.GetInsertPoint(), Ptr, Size);
|
||||||
for (auto &RI : SInfo.RetVec) {
|
for (auto &RI : SInfo.RetVec) {
|
||||||
|
|
|
@ -392,7 +392,7 @@ AArch64TargetMachine::getSubtargetImpl(const Function &F) const {
|
||||||
if (VScaleRangeAttr.isValid()) {
|
if (VScaleRangeAttr.isValid()) {
|
||||||
Optional<unsigned> VScaleMax = VScaleRangeAttr.getVScaleRangeMax();
|
Optional<unsigned> VScaleMax = VScaleRangeAttr.getVScaleRangeMax();
|
||||||
MinSVEVectorSize = VScaleRangeAttr.getVScaleRangeMin() * 128;
|
MinSVEVectorSize = VScaleRangeAttr.getVScaleRangeMin() * 128;
|
||||||
MaxSVEVectorSize = VScaleMax ? VScaleMax.getValue() * 128 : 0;
|
MaxSVEVectorSize = VScaleMax ? *VScaleMax * 128 : 0;
|
||||||
} else {
|
} else {
|
||||||
MinSVEVectorSize = SVEVectorBitsMinOpt;
|
MinSVEVectorSize = SVEVectorBitsMinOpt;
|
||||||
MaxSVEVectorSize = SVEVectorBitsMaxOpt;
|
MaxSVEVectorSize = SVEVectorBitsMaxOpt;
|
||||||
|
|
|
@ -6743,7 +6743,7 @@ void AArch64InstructionSelector::renderTruncImm(MachineInstrBuilder &MIB,
|
||||||
Optional<int64_t> CstVal =
|
Optional<int64_t> CstVal =
|
||||||
getIConstantVRegSExtVal(MI.getOperand(0).getReg(), MRI);
|
getIConstantVRegSExtVal(MI.getOperand(0).getReg(), MRI);
|
||||||
assert(CstVal && "Expected constant value");
|
assert(CstVal && "Expected constant value");
|
||||||
MIB.addImm(CstVal.getValue());
|
MIB.addImm(*CstVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AArch64InstructionSelector::renderLogicalImm32(
|
void AArch64InstructionSelector::renderLogicalImm32(
|
||||||
|
|
|
@ -442,7 +442,7 @@ class CollectReachableCallees {
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (const auto &GI : *CGN) {
|
for (const auto &GI : *CGN) {
|
||||||
auto *RCB = cast<CallBase>(GI.first.getValue());
|
auto *RCB = cast<CallBase>(*GI.first);
|
||||||
auto *RCGN = GI.second;
|
auto *RCGN = GI.second;
|
||||||
|
|
||||||
if (auto *DCallee = RCGN->getFunction()) {
|
if (auto *DCallee = RCGN->getFunction()) {
|
||||||
|
|
|
@ -1514,7 +1514,7 @@ bool GCNTargetMachine::parseMachineFunctionInfo(
|
||||||
Arg = ArgDescriptor::createStack(A->StackOffset);
|
Arg = ArgDescriptor::createStack(A->StackOffset);
|
||||||
// Check and apply the optional mask.
|
// Check and apply the optional mask.
|
||||||
if (A->Mask)
|
if (A->Mask)
|
||||||
Arg = ArgDescriptor::createArg(Arg, A->Mask.getValue());
|
Arg = ArgDescriptor::createArg(Arg, *A->Mask);
|
||||||
|
|
||||||
MFI->NumUserSGPRs += UserSGPRs;
|
MFI->NumUserSGPRs += UserSGPRs;
|
||||||
MFI->NumSystemSGPRs += SystemSGPRs;
|
MFI->NumSystemSGPRs += SystemSGPRs;
|
||||||
|
|
|
@ -714,7 +714,7 @@ Optional<SIMemOpInfo> SIMemOpAccess::constructFromMIWithMMO(
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
SSID = IsSyncScopeInclusion.getValue() ? SSID : MMO->getSyncScopeID();
|
SSID = *IsSyncScopeInclusion ? SSID : MMO->getSyncScopeID();
|
||||||
Ordering = getMergedAtomicOrdering(Ordering, OpOrdering);
|
Ordering = getMergedAtomicOrdering(Ordering, OpOrdering);
|
||||||
assert(MMO->getFailureOrdering() != AtomicOrdering::Release &&
|
assert(MMO->getFailureOrdering() != AtomicOrdering::Release &&
|
||||||
MMO->getFailureOrdering() != AtomicOrdering::AcquireRelease);
|
MMO->getFailureOrdering() != AtomicOrdering::AcquireRelease);
|
||||||
|
@ -733,7 +733,7 @@ Optional<SIMemOpInfo> SIMemOpAccess::constructFromMIWithMMO(
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
std::tie(Scope, OrderingAddrSpace, IsCrossAddressSpaceOrdering) =
|
std::tie(Scope, OrderingAddrSpace, IsCrossAddressSpaceOrdering) =
|
||||||
ScopeOrNone.getValue();
|
*ScopeOrNone;
|
||||||
if ((OrderingAddrSpace == SIAtomicAddrSpace::NONE) ||
|
if ((OrderingAddrSpace == SIAtomicAddrSpace::NONE) ||
|
||||||
((OrderingAddrSpace & SIAtomicAddrSpace::ATOMIC) != OrderingAddrSpace) ||
|
((OrderingAddrSpace & SIAtomicAddrSpace::ATOMIC) != OrderingAddrSpace) ||
|
||||||
((InstrAddrSpace & SIAtomicAddrSpace::ATOMIC) == SIAtomicAddrSpace::NONE)) {
|
((InstrAddrSpace & SIAtomicAddrSpace::ATOMIC) == SIAtomicAddrSpace::NONE)) {
|
||||||
|
@ -795,7 +795,7 @@ Optional<SIMemOpInfo> SIMemOpAccess::getAtomicFenceInfo(
|
||||||
SIAtomicAddrSpace OrderingAddrSpace = SIAtomicAddrSpace::NONE;
|
SIAtomicAddrSpace OrderingAddrSpace = SIAtomicAddrSpace::NONE;
|
||||||
bool IsCrossAddressSpaceOrdering = false;
|
bool IsCrossAddressSpaceOrdering = false;
|
||||||
std::tie(Scope, OrderingAddrSpace, IsCrossAddressSpaceOrdering) =
|
std::tie(Scope, OrderingAddrSpace, IsCrossAddressSpaceOrdering) =
|
||||||
ScopeOrNone.getValue();
|
*ScopeOrNone;
|
||||||
|
|
||||||
if ((OrderingAddrSpace == SIAtomicAddrSpace::NONE) ||
|
if ((OrderingAddrSpace == SIAtomicAddrSpace::NONE) ||
|
||||||
((OrderingAddrSpace & SIAtomicAddrSpace::ATOMIC) != OrderingAddrSpace)) {
|
((OrderingAddrSpace & SIAtomicAddrSpace::ATOMIC) != OrderingAddrSpace)) {
|
||||||
|
|
|
@ -11385,7 +11385,7 @@ bool ARMAsmParser::parseDirectiveEabiAttr(SMLoc L) {
|
||||||
Error(TagLoc, "attribute name not recognised: " + Name);
|
Error(TagLoc, "attribute name not recognised: " + Name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Tag = Ret.getValue();
|
Tag = *Ret;
|
||||||
Parser.Lex();
|
Parser.Lex();
|
||||||
} else {
|
} else {
|
||||||
const MCExpr *AttrExpr;
|
const MCExpr *AttrExpr;
|
||||||
|
|
|
@ -390,7 +390,7 @@ MVEGatherScatterLowering::getVarAndConst(Value *Inst, int TypeScale) {
|
||||||
return ReturnFalse;
|
return ReturnFalse;
|
||||||
|
|
||||||
// Check that the constant is small enough for an incrementing gather
|
// Check that the constant is small enough for an incrementing gather
|
||||||
int64_t Immediate = Const.getValue() << TypeScale;
|
int64_t Immediate = *Const << TypeScale;
|
||||||
if (Immediate > 512 || Immediate < -512 || Immediate % 4 != 0)
|
if (Immediate > 512 || Immediate < -512 || Immediate % 4 != 0)
|
||||||
return ReturnFalse;
|
return ReturnFalse;
|
||||||
|
|
||||||
|
|
|
@ -923,8 +923,7 @@ bool NVPTXDAGToDAGISel::tryLoad(SDNode *N) {
|
||||||
SDValue Ops[] = { getI32Imm(isVolatile, dl), getI32Imm(CodeAddrSpace, dl),
|
SDValue Ops[] = { getI32Imm(isVolatile, dl), getI32Imm(CodeAddrSpace, dl),
|
||||||
getI32Imm(vecType, dl), getI32Imm(fromType, dl),
|
getI32Imm(vecType, dl), getI32Imm(fromType, dl),
|
||||||
getI32Imm(fromTypeWidth, dl), Addr, Chain };
|
getI32Imm(fromTypeWidth, dl), Addr, Chain };
|
||||||
NVPTXLD = CurDAG->getMachineNode(Opcode.getValue(), dl, TargetVT,
|
NVPTXLD = CurDAG->getMachineNode(*Opcode, dl, TargetVT, MVT::Other, Ops);
|
||||||
MVT::Other, Ops);
|
|
||||||
} else if (PointerSize == 64 ? SelectADDRsi64(N1.getNode(), N1, Base, Offset)
|
} else if (PointerSize == 64 ? SelectADDRsi64(N1.getNode(), N1, Base, Offset)
|
||||||
: SelectADDRsi(N1.getNode(), N1, Base, Offset)) {
|
: SelectADDRsi(N1.getNode(), N1, Base, Offset)) {
|
||||||
Opcode = pickOpcodeForVT(TargetVT, NVPTX::LD_i8_asi, NVPTX::LD_i16_asi,
|
Opcode = pickOpcodeForVT(TargetVT, NVPTX::LD_i8_asi, NVPTX::LD_i16_asi,
|
||||||
|
@ -936,8 +935,7 @@ bool NVPTXDAGToDAGISel::tryLoad(SDNode *N) {
|
||||||
SDValue Ops[] = { getI32Imm(isVolatile, dl), getI32Imm(CodeAddrSpace, dl),
|
SDValue Ops[] = { getI32Imm(isVolatile, dl), getI32Imm(CodeAddrSpace, dl),
|
||||||
getI32Imm(vecType, dl), getI32Imm(fromType, dl),
|
getI32Imm(vecType, dl), getI32Imm(fromType, dl),
|
||||||
getI32Imm(fromTypeWidth, dl), Base, Offset, Chain };
|
getI32Imm(fromTypeWidth, dl), Base, Offset, Chain };
|
||||||
NVPTXLD = CurDAG->getMachineNode(Opcode.getValue(), dl, TargetVT,
|
NVPTXLD = CurDAG->getMachineNode(*Opcode, dl, TargetVT, MVT::Other, Ops);
|
||||||
MVT::Other, Ops);
|
|
||||||
} else if (PointerSize == 64 ? SelectADDRri64(N1.getNode(), N1, Base, Offset)
|
} else if (PointerSize == 64 ? SelectADDRri64(N1.getNode(), N1, Base, Offset)
|
||||||
: SelectADDRri(N1.getNode(), N1, Base, Offset)) {
|
: SelectADDRri(N1.getNode(), N1, Base, Offset)) {
|
||||||
if (PointerSize == 64)
|
if (PointerSize == 64)
|
||||||
|
@ -955,8 +953,7 @@ bool NVPTXDAGToDAGISel::tryLoad(SDNode *N) {
|
||||||
SDValue Ops[] = { getI32Imm(isVolatile, dl), getI32Imm(CodeAddrSpace, dl),
|
SDValue Ops[] = { getI32Imm(isVolatile, dl), getI32Imm(CodeAddrSpace, dl),
|
||||||
getI32Imm(vecType, dl), getI32Imm(fromType, dl),
|
getI32Imm(vecType, dl), getI32Imm(fromType, dl),
|
||||||
getI32Imm(fromTypeWidth, dl), Base, Offset, Chain };
|
getI32Imm(fromTypeWidth, dl), Base, Offset, Chain };
|
||||||
NVPTXLD = CurDAG->getMachineNode(Opcode.getValue(), dl, TargetVT,
|
NVPTXLD = CurDAG->getMachineNode(*Opcode, dl, TargetVT, MVT::Other, Ops);
|
||||||
MVT::Other, Ops);
|
|
||||||
} else {
|
} else {
|
||||||
if (PointerSize == 64)
|
if (PointerSize == 64)
|
||||||
Opcode = pickOpcodeForVT(
|
Opcode = pickOpcodeForVT(
|
||||||
|
@ -974,8 +971,7 @@ bool NVPTXDAGToDAGISel::tryLoad(SDNode *N) {
|
||||||
SDValue Ops[] = { getI32Imm(isVolatile, dl), getI32Imm(CodeAddrSpace, dl),
|
SDValue Ops[] = { getI32Imm(isVolatile, dl), getI32Imm(CodeAddrSpace, dl),
|
||||||
getI32Imm(vecType, dl), getI32Imm(fromType, dl),
|
getI32Imm(vecType, dl), getI32Imm(fromType, dl),
|
||||||
getI32Imm(fromTypeWidth, dl), N1, Chain };
|
getI32Imm(fromTypeWidth, dl), N1, Chain };
|
||||||
NVPTXLD = CurDAG->getMachineNode(Opcode.getValue(), dl, TargetVT,
|
NVPTXLD = CurDAG->getMachineNode(*Opcode, dl, TargetVT, MVT::Other, Ops);
|
||||||
MVT::Other, Ops);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!NVPTXLD)
|
if (!NVPTXLD)
|
||||||
|
@ -1092,7 +1088,7 @@ bool NVPTXDAGToDAGISel::tryLoadVector(SDNode *N) {
|
||||||
SDValue Ops[] = { getI32Imm(IsVolatile, DL), getI32Imm(CodeAddrSpace, DL),
|
SDValue Ops[] = { getI32Imm(IsVolatile, DL), getI32Imm(CodeAddrSpace, DL),
|
||||||
getI32Imm(VecType, DL), getI32Imm(FromType, DL),
|
getI32Imm(VecType, DL), getI32Imm(FromType, DL),
|
||||||
getI32Imm(FromTypeWidth, DL), Addr, Chain };
|
getI32Imm(FromTypeWidth, DL), Addr, Chain };
|
||||||
LD = CurDAG->getMachineNode(Opcode.getValue(), DL, N->getVTList(), Ops);
|
LD = CurDAG->getMachineNode(*Opcode, DL, N->getVTList(), Ops);
|
||||||
} else if (PointerSize == 64
|
} else if (PointerSize == 64
|
||||||
? SelectADDRsi64(Op1.getNode(), Op1, Base, Offset)
|
? SelectADDRsi64(Op1.getNode(), Op1, Base, Offset)
|
||||||
: SelectADDRsi(Op1.getNode(), Op1, Base, Offset)) {
|
: SelectADDRsi(Op1.getNode(), Op1, Base, Offset)) {
|
||||||
|
@ -1119,7 +1115,7 @@ bool NVPTXDAGToDAGISel::tryLoadVector(SDNode *N) {
|
||||||
SDValue Ops[] = { getI32Imm(IsVolatile, DL), getI32Imm(CodeAddrSpace, DL),
|
SDValue Ops[] = { getI32Imm(IsVolatile, DL), getI32Imm(CodeAddrSpace, DL),
|
||||||
getI32Imm(VecType, DL), getI32Imm(FromType, DL),
|
getI32Imm(VecType, DL), getI32Imm(FromType, DL),
|
||||||
getI32Imm(FromTypeWidth, DL), Base, Offset, Chain };
|
getI32Imm(FromTypeWidth, DL), Base, Offset, Chain };
|
||||||
LD = CurDAG->getMachineNode(Opcode.getValue(), DL, N->getVTList(), Ops);
|
LD = CurDAG->getMachineNode(*Opcode, DL, N->getVTList(), Ops);
|
||||||
} else if (PointerSize == 64
|
} else if (PointerSize == 64
|
||||||
? SelectADDRri64(Op1.getNode(), Op1, Base, Offset)
|
? SelectADDRri64(Op1.getNode(), Op1, Base, Offset)
|
||||||
: SelectADDRri(Op1.getNode(), Op1, Base, Offset)) {
|
: SelectADDRri(Op1.getNode(), Op1, Base, Offset)) {
|
||||||
|
@ -1169,7 +1165,7 @@ bool NVPTXDAGToDAGISel::tryLoadVector(SDNode *N) {
|
||||||
getI32Imm(VecType, DL), getI32Imm(FromType, DL),
|
getI32Imm(VecType, DL), getI32Imm(FromType, DL),
|
||||||
getI32Imm(FromTypeWidth, DL), Base, Offset, Chain };
|
getI32Imm(FromTypeWidth, DL), Base, Offset, Chain };
|
||||||
|
|
||||||
LD = CurDAG->getMachineNode(Opcode.getValue(), DL, N->getVTList(), Ops);
|
LD = CurDAG->getMachineNode(*Opcode, DL, N->getVTList(), Ops);
|
||||||
} else {
|
} else {
|
||||||
if (PointerSize == 64) {
|
if (PointerSize == 64) {
|
||||||
switch (N->getOpcode()) {
|
switch (N->getOpcode()) {
|
||||||
|
@ -1217,7 +1213,7 @@ bool NVPTXDAGToDAGISel::tryLoadVector(SDNode *N) {
|
||||||
SDValue Ops[] = { getI32Imm(IsVolatile, DL), getI32Imm(CodeAddrSpace, DL),
|
SDValue Ops[] = { getI32Imm(IsVolatile, DL), getI32Imm(CodeAddrSpace, DL),
|
||||||
getI32Imm(VecType, DL), getI32Imm(FromType, DL),
|
getI32Imm(VecType, DL), getI32Imm(FromType, DL),
|
||||||
getI32Imm(FromTypeWidth, DL), Op1, Chain };
|
getI32Imm(FromTypeWidth, DL), Op1, Chain };
|
||||||
LD = CurDAG->getMachineNode(Opcode.getValue(), DL, N->getVTList(), Ops);
|
LD = CurDAG->getMachineNode(*Opcode, DL, N->getVTList(), Ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
MachineMemOperand *MemRef = cast<MemSDNode>(N)->getMemOperand();
|
MachineMemOperand *MemRef = cast<MemSDNode>(N)->getMemOperand();
|
||||||
|
@ -1361,7 +1357,7 @@ bool NVPTXDAGToDAGISel::tryLDGLDU(SDNode *N) {
|
||||||
if (!Opcode)
|
if (!Opcode)
|
||||||
return false;
|
return false;
|
||||||
SDValue Ops[] = { Addr, Chain };
|
SDValue Ops[] = { Addr, Chain };
|
||||||
LD = CurDAG->getMachineNode(Opcode.getValue(), DL, InstVTList, Ops);
|
LD = CurDAG->getMachineNode(*Opcode, DL, InstVTList, Ops);
|
||||||
} else if (TM.is64Bit() ? SelectADDRri64(Op1.getNode(), Op1, Base, Offset)
|
} else if (TM.is64Bit() ? SelectADDRri64(Op1.getNode(), Op1, Base, Offset)
|
||||||
: SelectADDRri(Op1.getNode(), Op1, Base, Offset)) {
|
: SelectADDRri(Op1.getNode(), Op1, Base, Offset)) {
|
||||||
if (TM.is64Bit()) {
|
if (TM.is64Bit()) {
|
||||||
|
@ -1508,7 +1504,7 @@ bool NVPTXDAGToDAGISel::tryLDGLDU(SDNode *N) {
|
||||||
if (!Opcode)
|
if (!Opcode)
|
||||||
return false;
|
return false;
|
||||||
SDValue Ops[] = {Base, Offset, Chain};
|
SDValue Ops[] = {Base, Offset, Chain};
|
||||||
LD = CurDAG->getMachineNode(Opcode.getValue(), DL, InstVTList, Ops);
|
LD = CurDAG->getMachineNode(*Opcode, DL, InstVTList, Ops);
|
||||||
} else {
|
} else {
|
||||||
if (TM.is64Bit()) {
|
if (TM.is64Bit()) {
|
||||||
switch (N->getOpcode()) {
|
switch (N->getOpcode()) {
|
||||||
|
@ -1654,7 +1650,7 @@ bool NVPTXDAGToDAGISel::tryLDGLDU(SDNode *N) {
|
||||||
if (!Opcode)
|
if (!Opcode)
|
||||||
return false;
|
return false;
|
||||||
SDValue Ops[] = { Op1, Chain };
|
SDValue Ops[] = { Op1, Chain };
|
||||||
LD = CurDAG->getMachineNode(Opcode.getValue(), DL, InstVTList, Ops);
|
LD = CurDAG->getMachineNode(*Opcode, DL, InstVTList, Ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
MachineMemOperand *MemRef = Mem->getMemOperand();
|
MachineMemOperand *MemRef = Mem->getMemOperand();
|
||||||
|
@ -1787,7 +1783,7 @@ bool NVPTXDAGToDAGISel::tryStore(SDNode *N) {
|
||||||
getI32Imm(toTypeWidth, dl),
|
getI32Imm(toTypeWidth, dl),
|
||||||
Addr,
|
Addr,
|
||||||
Chain};
|
Chain};
|
||||||
NVPTXST = CurDAG->getMachineNode(Opcode.getValue(), dl, MVT::Other, Ops);
|
NVPTXST = CurDAG->getMachineNode(*Opcode, dl, MVT::Other, Ops);
|
||||||
} else if (PointerSize == 64
|
} else if (PointerSize == 64
|
||||||
? SelectADDRsi64(BasePtr.getNode(), BasePtr, Base, Offset)
|
? SelectADDRsi64(BasePtr.getNode(), BasePtr, Base, Offset)
|
||||||
: SelectADDRsi(BasePtr.getNode(), BasePtr, Base, Offset)) {
|
: SelectADDRsi(BasePtr.getNode(), BasePtr, Base, Offset)) {
|
||||||
|
@ -1806,7 +1802,7 @@ bool NVPTXDAGToDAGISel::tryStore(SDNode *N) {
|
||||||
Base,
|
Base,
|
||||||
Offset,
|
Offset,
|
||||||
Chain};
|
Chain};
|
||||||
NVPTXST = CurDAG->getMachineNode(Opcode.getValue(), dl, MVT::Other, Ops);
|
NVPTXST = CurDAG->getMachineNode(*Opcode, dl, MVT::Other, Ops);
|
||||||
} else if (PointerSize == 64
|
} else if (PointerSize == 64
|
||||||
? SelectADDRri64(BasePtr.getNode(), BasePtr, Base, Offset)
|
? SelectADDRri64(BasePtr.getNode(), BasePtr, Base, Offset)
|
||||||
: SelectADDRri(BasePtr.getNode(), BasePtr, Base, Offset)) {
|
: SelectADDRri(BasePtr.getNode(), BasePtr, Base, Offset)) {
|
||||||
|
@ -1832,7 +1828,7 @@ bool NVPTXDAGToDAGISel::tryStore(SDNode *N) {
|
||||||
Base,
|
Base,
|
||||||
Offset,
|
Offset,
|
||||||
Chain};
|
Chain};
|
||||||
NVPTXST = CurDAG->getMachineNode(Opcode.getValue(), dl, MVT::Other, Ops);
|
NVPTXST = CurDAG->getMachineNode(*Opcode, dl, MVT::Other, Ops);
|
||||||
} else {
|
} else {
|
||||||
if (PointerSize == 64)
|
if (PointerSize == 64)
|
||||||
Opcode =
|
Opcode =
|
||||||
|
@ -1855,7 +1851,7 @@ bool NVPTXDAGToDAGISel::tryStore(SDNode *N) {
|
||||||
getI32Imm(toTypeWidth, dl),
|
getI32Imm(toTypeWidth, dl),
|
||||||
BasePtr,
|
BasePtr,
|
||||||
Chain};
|
Chain};
|
||||||
NVPTXST = CurDAG->getMachineNode(Opcode.getValue(), dl, MVT::Other, Ops);
|
NVPTXST = CurDAG->getMachineNode(*Opcode, dl, MVT::Other, Ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!NVPTXST)
|
if (!NVPTXST)
|
||||||
|
@ -2082,7 +2078,7 @@ bool NVPTXDAGToDAGISel::tryStoreVector(SDNode *N) {
|
||||||
|
|
||||||
StOps.push_back(Chain);
|
StOps.push_back(Chain);
|
||||||
|
|
||||||
ST = CurDAG->getMachineNode(Opcode.getValue(), DL, MVT::Other, StOps);
|
ST = CurDAG->getMachineNode(*Opcode, DL, MVT::Other, StOps);
|
||||||
|
|
||||||
MachineMemOperand *MemRef = cast<MemSDNode>(N)->getMemOperand();
|
MachineMemOperand *MemRef = cast<MemSDNode>(N)->getMemOperand();
|
||||||
CurDAG->setNodeMemRefs(cast<MachineSDNode>(ST), {MemRef});
|
CurDAG->setNodeMemRefs(cast<MachineSDNode>(ST), {MemRef});
|
||||||
|
@ -2164,7 +2160,7 @@ bool NVPTXDAGToDAGISel::tryLoadParam(SDNode *Node) {
|
||||||
Ops.push_back(Chain);
|
Ops.push_back(Chain);
|
||||||
Ops.push_back(Flag);
|
Ops.push_back(Flag);
|
||||||
|
|
||||||
ReplaceNode(Node, CurDAG->getMachineNode(Opcode.getValue(), DL, VTs, Ops));
|
ReplaceNode(Node, CurDAG->getMachineNode(*Opcode, DL, VTs, Ops));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2230,7 +2226,7 @@ bool NVPTXDAGToDAGISel::tryStoreRetval(SDNode *N) {
|
||||||
if (!Opcode)
|
if (!Opcode)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SDNode *Ret = CurDAG->getMachineNode(Opcode.getValue(), DL, MVT::Other, Ops);
|
SDNode *Ret = CurDAG->getMachineNode(*Opcode, DL, MVT::Other, Ops);
|
||||||
MachineMemOperand *MemRef = cast<MemSDNode>(N)->getMemOperand();
|
MachineMemOperand *MemRef = cast<MemSDNode>(N)->getMemOperand();
|
||||||
CurDAG->setNodeMemRefs(cast<MachineSDNode>(Ret), {MemRef});
|
CurDAG->setNodeMemRefs(cast<MachineSDNode>(Ret), {MemRef});
|
||||||
|
|
||||||
|
@ -2333,8 +2329,7 @@ bool NVPTXDAGToDAGISel::tryStoreParam(SDNode *N) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SDVTList RetVTs = CurDAG->getVTList(MVT::Other, MVT::Glue);
|
SDVTList RetVTs = CurDAG->getVTList(MVT::Other, MVT::Glue);
|
||||||
SDNode *Ret =
|
SDNode *Ret = CurDAG->getMachineNode(*Opcode, DL, RetVTs, Ops);
|
||||||
CurDAG->getMachineNode(Opcode.getValue(), DL, RetVTs, Ops);
|
|
||||||
MachineMemOperand *MemRef = cast<MemSDNode>(N)->getMemOperand();
|
MachineMemOperand *MemRef = cast<MemSDNode>(N)->getMemOperand();
|
||||||
CurDAG->setNodeMemRefs(cast<MachineSDNode>(Ret), {MemRef});
|
CurDAG->setNodeMemRefs(cast<MachineSDNode>(Ret), {MemRef});
|
||||||
|
|
||||||
|
|
|
@ -775,7 +775,7 @@ bool PPCFastISel::SelectBranch(const Instruction *I) {
|
||||||
if (!OptPPCPred)
|
if (!OptPPCPred)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PPC::Predicate PPCPred = OptPPCPred.getValue();
|
PPC::Predicate PPCPred = *OptPPCPred;
|
||||||
|
|
||||||
// Take advantage of fall-through opportunities.
|
// Take advantage of fall-through opportunities.
|
||||||
if (FuncInfo.MBB->isLayoutSuccessor(TBB)) {
|
if (FuncInfo.MBB->isLayoutSuccessor(TBB)) {
|
||||||
|
|
|
@ -2179,7 +2179,7 @@ bool RISCVAsmParser::parseDirectiveAttribute() {
|
||||||
Error(TagLoc, "attribute name not recognised: " + Name);
|
Error(TagLoc, "attribute name not recognised: " + Name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Tag = Ret.getValue();
|
Tag = *Ret;
|
||||||
Parser.Lex();
|
Parser.Lex();
|
||||||
} else {
|
} else {
|
||||||
const MCExpr *AttrExpr;
|
const MCExpr *AttrExpr;
|
||||||
|
|
|
@ -375,7 +375,7 @@ public:
|
||||||
auto Type = WebAssembly::parseType(Lexer.getTok().getString());
|
auto Type = WebAssembly::parseType(Lexer.getTok().getString());
|
||||||
if (!Type)
|
if (!Type)
|
||||||
return error("unknown type: ", Lexer.getTok());
|
return error("unknown type: ", Lexer.getTok());
|
||||||
Types.push_back(Type.getValue());
|
Types.push_back(*Type);
|
||||||
Parser.Lex();
|
Parser.Lex();
|
||||||
if (!isNext(AsmToken::Comma))
|
if (!isNext(AsmToken::Comma))
|
||||||
break;
|
break;
|
||||||
|
@ -817,8 +817,7 @@ public:
|
||||||
// Now set this symbol with the correct type.
|
// Now set this symbol with the correct type.
|
||||||
auto WasmSym = cast<MCSymbolWasm>(Ctx.getOrCreateSymbol(SymName));
|
auto WasmSym = cast<MCSymbolWasm>(Ctx.getOrCreateSymbol(SymName));
|
||||||
WasmSym->setType(wasm::WASM_SYMBOL_TYPE_GLOBAL);
|
WasmSym->setType(wasm::WASM_SYMBOL_TYPE_GLOBAL);
|
||||||
WasmSym->setGlobalType(
|
WasmSym->setGlobalType(wasm::WasmGlobalType{uint8_t(*Type), Mutable});
|
||||||
wasm::WasmGlobalType{uint8_t(Type.getValue()), Mutable});
|
|
||||||
// And emit the directive again.
|
// And emit the directive again.
|
||||||
TOut.emitGlobalType(WasmSym);
|
TOut.emitGlobalType(WasmSym);
|
||||||
return expect(AsmToken::EndOfStatement, "EOL");
|
return expect(AsmToken::EndOfStatement, "EOL");
|
||||||
|
@ -848,7 +847,7 @@ public:
|
||||||
// symbol
|
// symbol
|
||||||
auto WasmSym = cast<MCSymbolWasm>(Ctx.getOrCreateSymbol(SymName));
|
auto WasmSym = cast<MCSymbolWasm>(Ctx.getOrCreateSymbol(SymName));
|
||||||
WasmSym->setType(wasm::WASM_SYMBOL_TYPE_TABLE);
|
WasmSym->setType(wasm::WASM_SYMBOL_TYPE_TABLE);
|
||||||
wasm::WasmTableType Type = {uint8_t(ElemType.getValue()), Limits};
|
wasm::WasmTableType Type = {uint8_t(*ElemType), Limits};
|
||||||
WasmSym->setTableType(Type);
|
WasmSym->setTableType(Type);
|
||||||
TOut.emitTableType(WasmSym);
|
TOut.emitTableType(WasmSym);
|
||||||
return expect(AsmToken::EndOfStatement, "EOL");
|
return expect(AsmToken::EndOfStatement, "EOL");
|
||||||
|
|
|
@ -276,7 +276,7 @@ void WebAssemblyAsmPrinter::emitSymbolType(const MCSymbolWasm *Sym) {
|
||||||
if (!WasmTy)
|
if (!WasmTy)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (WasmTy.getValue()) {
|
switch (*WasmTy) {
|
||||||
case wasm::WASM_SYMBOL_TYPE_GLOBAL:
|
case wasm::WASM_SYMBOL_TYPE_GLOBAL:
|
||||||
getTargetStreamer()->emitGlobalType(Sym);
|
getTargetStreamer()->emitGlobalType(Sym);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -160,7 +160,7 @@ bool X86DiscriminateMemOps::runOnMachineFunction(MachineFunction &MF) {
|
||||||
}
|
}
|
||||||
// Since we were able to encode, bump the MemOpDiscriminators.
|
// Since we were able to encode, bump the MemOpDiscriminators.
|
||||||
++MemOpDiscriminators[L];
|
++MemOpDiscriminators[L];
|
||||||
DI = DI->cloneWithDiscriminator(EncodedDiscriminator.getValue());
|
DI = DI->cloneWithDiscriminator(*EncodedDiscriminator);
|
||||||
assert(DI && "DI should not be nullptr");
|
assert(DI && "DI should not be nullptr");
|
||||||
updateDebugInfo(&MI, DI);
|
updateDebugInfo(&MI, DI);
|
||||||
Changed = true;
|
Changed = true;
|
||||||
|
|
|
@ -501,7 +501,7 @@ void X86MCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
|
||||||
|
|
||||||
for (const MachineOperand &MO : MI->operands())
|
for (const MachineOperand &MO : MI->operands())
|
||||||
if (auto MaybeMCOp = LowerMachineOperand(MI, MO))
|
if (auto MaybeMCOp = LowerMachineOperand(MI, MO))
|
||||||
OutMI.addOperand(MaybeMCOp.getValue());
|
OutMI.addOperand(*MaybeMCOp);
|
||||||
|
|
||||||
// Handle a few special cases to eliminate operand modifiers.
|
// Handle a few special cases to eliminate operand modifiers.
|
||||||
switch (OutMI.getOpcode()) {
|
switch (OutMI.getOpcode()) {
|
||||||
|
@ -1317,7 +1317,7 @@ void X86AsmPrinter::LowerFAULTING_OP(const MachineInstr &FaultingMI,
|
||||||
E = FaultingMI.operands_end();
|
E = FaultingMI.operands_end();
|
||||||
I != E; ++I)
|
I != E; ++I)
|
||||||
if (auto MaybeOperand = MCIL.LowerMachineOperand(&FaultingMI, *I))
|
if (auto MaybeOperand = MCIL.LowerMachineOperand(&FaultingMI, *I))
|
||||||
MI.addOperand(MaybeOperand.getValue());
|
MI.addOperand(*MaybeOperand);
|
||||||
|
|
||||||
OutStreamer->AddComment("on-fault: " + HandlerLabel->getName());
|
OutStreamer->AddComment("on-fault: " + HandlerLabel->getName());
|
||||||
OutStreamer->emitInstruction(MI, getSubtargetInfo());
|
OutStreamer->emitInstruction(MI, getSubtargetInfo());
|
||||||
|
@ -1382,7 +1382,7 @@ void X86AsmPrinter::LowerPATCHABLE_OP(const MachineInstr &MI,
|
||||||
MCI.setOpcode(Opcode);
|
MCI.setOpcode(Opcode);
|
||||||
for (auto &MO : drop_begin(MI.operands(), 2))
|
for (auto &MO : drop_begin(MI.operands(), 2))
|
||||||
if (auto MaybeOperand = MCIL.LowerMachineOperand(&MI, MO))
|
if (auto MaybeOperand = MCIL.LowerMachineOperand(&MI, MO))
|
||||||
MCI.addOperand(MaybeOperand.getValue());
|
MCI.addOperand(*MaybeOperand);
|
||||||
|
|
||||||
SmallString<256> Code;
|
SmallString<256> Code;
|
||||||
SmallVector<MCFixup, 4> Fixups;
|
SmallVector<MCFixup, 4> Fixups;
|
||||||
|
@ -1758,7 +1758,7 @@ void X86AsmPrinter::LowerPATCHABLE_RET(const MachineInstr &MI,
|
||||||
Ret.setOpcode(OpCode);
|
Ret.setOpcode(OpCode);
|
||||||
for (auto &MO : drop_begin(MI.operands()))
|
for (auto &MO : drop_begin(MI.operands()))
|
||||||
if (auto MaybeOperand = MCIL.LowerMachineOperand(&MI, MO))
|
if (auto MaybeOperand = MCIL.LowerMachineOperand(&MI, MO))
|
||||||
Ret.addOperand(MaybeOperand.getValue());
|
Ret.addOperand(*MaybeOperand);
|
||||||
OutStreamer->emitInstruction(Ret, getSubtargetInfo());
|
OutStreamer->emitInstruction(Ret, getSubtargetInfo());
|
||||||
emitX86Nops(*OutStreamer, 10, Subtarget);
|
emitX86Nops(*OutStreamer, 10, Subtarget);
|
||||||
recordSled(CurSled, MI, SledKind::FUNCTION_EXIT, 2);
|
recordSled(CurSled, MI, SledKind::FUNCTION_EXIT, 2);
|
||||||
|
@ -1797,7 +1797,7 @@ void X86AsmPrinter::LowerPATCHABLE_TAIL_CALL(const MachineInstr &MI,
|
||||||
OutStreamer->AddComment("TAILCALL");
|
OutStreamer->AddComment("TAILCALL");
|
||||||
for (auto &MO : drop_begin(MI.operands()))
|
for (auto &MO : drop_begin(MI.operands()))
|
||||||
if (auto MaybeOperand = MCIL.LowerMachineOperand(&MI, MO))
|
if (auto MaybeOperand = MCIL.LowerMachineOperand(&MI, MO))
|
||||||
TC.addOperand(MaybeOperand.getValue());
|
TC.addOperand(*MaybeOperand);
|
||||||
OutStreamer->emitInstruction(TC, getSubtargetInfo());
|
OutStreamer->emitInstruction(TC, getSubtargetInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1391,7 +1391,7 @@ struct AllocaUseVisitor : PtrUseVisitor<AllocaUseVisitor> {
|
||||||
bool getShouldLiveOnFrame() const {
|
bool getShouldLiveOnFrame() const {
|
||||||
if (!ShouldLiveOnFrame)
|
if (!ShouldLiveOnFrame)
|
||||||
ShouldLiveOnFrame = computeShouldLiveOnFrame();
|
ShouldLiveOnFrame = computeShouldLiveOnFrame();
|
||||||
return ShouldLiveOnFrame.getValue();
|
return *ShouldLiveOnFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool getMayWriteBeforeCoroBegin() const { return MayWriteBeforeCoroBegin; }
|
bool getMayWriteBeforeCoroBegin() const { return MayWriteBeforeCoroBegin; }
|
||||||
|
@ -1793,7 +1793,7 @@ static void insertSpills(const FrameDataInfo &FrameData, coro::Shape &Shape) {
|
||||||
auto *FramePtr = GetFramePointer(Alloca);
|
auto *FramePtr = GetFramePointer(Alloca);
|
||||||
auto *FramePtrRaw =
|
auto *FramePtrRaw =
|
||||||
Builder.CreateBitCast(FramePtr, Type::getInt8PtrTy(C));
|
Builder.CreateBitCast(FramePtr, Type::getInt8PtrTy(C));
|
||||||
auto &Value = Alias.second.getValue();
|
auto &Value = *Alias.second;
|
||||||
auto ITy = IntegerType::get(C, Value.getBitWidth());
|
auto ITy = IntegerType::get(C, Value.getBitWidth());
|
||||||
auto *AliasPtr = Builder.CreateGEP(Type::getInt8Ty(C), FramePtrRaw,
|
auto *AliasPtr = Builder.CreateGEP(Type::getInt8Ty(C), FramePtrRaw,
|
||||||
ConstantInt::get(ITy, Value));
|
ConstantInt::get(ITy, Value));
|
||||||
|
|
|
@ -2892,7 +2892,7 @@ private:
|
||||||
KnownUBInsts.insert(I);
|
KnownUBInsts.insert(I);
|
||||||
return llvm::None;
|
return llvm::None;
|
||||||
}
|
}
|
||||||
if (!SimplifiedV.getValue())
|
if (!*SimplifiedV)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
V = *SimplifiedV;
|
V = *SimplifiedV;
|
||||||
}
|
}
|
||||||
|
@ -5540,7 +5540,7 @@ struct AAValueSimplifyImpl : AAValueSimplify {
|
||||||
A.recordDependence(AA, *this, DepClassTy::OPTIONAL);
|
A.recordDependence(AA, *this, DepClassTy::OPTIONAL);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (auto *C = COpt.getValue()) {
|
if (auto *C = *COpt) {
|
||||||
SimplifiedAssociatedValue = C;
|
SimplifiedAssociatedValue = C;
|
||||||
A.recordDependence(AA, *this, DepClassTy::OPTIONAL);
|
A.recordDependence(AA, *this, DepClassTy::OPTIONAL);
|
||||||
return true;
|
return true;
|
||||||
|
@ -6736,7 +6736,7 @@ struct AAPrivatizablePtrArgument final : public AAPrivatizablePtrImpl {
|
||||||
|
|
||||||
// Avoid arguments with padding for now.
|
// Avoid arguments with padding for now.
|
||||||
if (!getIRPosition().hasAttr(Attribute::ByVal) &&
|
if (!getIRPosition().hasAttr(Attribute::ByVal) &&
|
||||||
!ArgumentPromotionPass::isDenselyPacked(PrivatizableType.getValue(),
|
!ArgumentPromotionPass::isDenselyPacked(*PrivatizableType,
|
||||||
A.getInfoCache().getDL())) {
|
A.getInfoCache().getDL())) {
|
||||||
LLVM_DEBUG(dbgs() << "[AAPrivatizablePtr] Padding detected\n");
|
LLVM_DEBUG(dbgs() << "[AAPrivatizablePtr] Padding detected\n");
|
||||||
return indicatePessimisticFixpoint();
|
return indicatePessimisticFixpoint();
|
||||||
|
@ -6745,7 +6745,7 @@ struct AAPrivatizablePtrArgument final : public AAPrivatizablePtrImpl {
|
||||||
// Collect the types that will replace the privatizable type in the function
|
// Collect the types that will replace the privatizable type in the function
|
||||||
// signature.
|
// signature.
|
||||||
SmallVector<Type *, 16> ReplacementTypes;
|
SmallVector<Type *, 16> ReplacementTypes;
|
||||||
identifyReplacementTypes(PrivatizableType.getValue(), ReplacementTypes);
|
identifyReplacementTypes(*PrivatizableType, ReplacementTypes);
|
||||||
|
|
||||||
// Verify callee and caller agree on how the promoted argument would be
|
// Verify callee and caller agree on how the promoted argument would be
|
||||||
// passed.
|
// passed.
|
||||||
|
@ -7061,7 +7061,7 @@ struct AAPrivatizablePtrArgument final : public AAPrivatizablePtrImpl {
|
||||||
// When no alignment is specified for the load instruction,
|
// When no alignment is specified for the load instruction,
|
||||||
// natural alignment is assumed.
|
// natural alignment is assumed.
|
||||||
createReplacementValues(
|
createReplacementValues(
|
||||||
AlignAA.getAssumedAlign(), PrivatizableType.getValue(), ACS,
|
AlignAA.getAssumedAlign(), *PrivatizableType, ACS,
|
||||||
ACS.getCallArgOperand(ARI.getReplacedArg().getArgNo()),
|
ACS.getCallArgOperand(ARI.getReplacedArg().getArgNo()),
|
||||||
NewArgOperands);
|
NewArgOperands);
|
||||||
};
|
};
|
||||||
|
@ -7069,7 +7069,7 @@ struct AAPrivatizablePtrArgument final : public AAPrivatizablePtrImpl {
|
||||||
// Collect the types that will replace the privatizable type in the function
|
// Collect the types that will replace the privatizable type in the function
|
||||||
// signature.
|
// signature.
|
||||||
SmallVector<Type *, 16> ReplacementTypes;
|
SmallVector<Type *, 16> ReplacementTypes;
|
||||||
identifyReplacementTypes(PrivatizableType.getValue(), ReplacementTypes);
|
identifyReplacementTypes(*PrivatizableType, ReplacementTypes);
|
||||||
|
|
||||||
// Register a rewrite of the argument.
|
// Register a rewrite of the argument.
|
||||||
if (A.registerFunctionSignatureRewrite(*Arg, ReplacementTypes,
|
if (A.registerFunctionSignatureRewrite(*Arg, ReplacementTypes,
|
||||||
|
|
|
@ -777,7 +777,7 @@ static void findConstants(IRSimilarityCandidate &C, DenseSet<unsigned> &NotSame,
|
||||||
for (Value *V : (*IDIt).OperVals) {
|
for (Value *V : (*IDIt).OperVals) {
|
||||||
// Since these are stored before any outlining, they will be in the
|
// Since these are stored before any outlining, they will be in the
|
||||||
// global value numbering.
|
// global value numbering.
|
||||||
unsigned GVN = C.getGVN(V).getValue();
|
unsigned GVN = *C.getGVN(V);
|
||||||
if (isa<Constant>(V))
|
if (isa<Constant>(V))
|
||||||
if (NotSame.contains(GVN) && !Seen.contains(GVN)) {
|
if (NotSame.contains(GVN) && !Seen.contains(GVN)) {
|
||||||
Inputs.push_back(GVN);
|
Inputs.push_back(GVN);
|
||||||
|
@ -1194,7 +1194,7 @@ static Optional<unsigned> getGVNForPHINode(OutlinableRegion &Region,
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Collect the canonical numbers of the values in the PHINode.
|
// Collect the canonical numbers of the values in the PHINode.
|
||||||
unsigned GVN = OGVN.getValue();
|
unsigned GVN = *OGVN;
|
||||||
OGVN = Cand.getCanonicalNum(GVN);
|
OGVN = Cand.getCanonicalNum(GVN);
|
||||||
assert(OGVN && "No GVN found for incoming value?");
|
assert(OGVN && "No GVN found for incoming value?");
|
||||||
PHIGVNs.push_back(*OGVN);
|
PHIGVNs.push_back(*OGVN);
|
||||||
|
@ -1223,7 +1223,7 @@ static Optional<unsigned> getGVNForPHINode(OutlinableRegion &Region,
|
||||||
assert(PrevBlock && "Expected a predecessor not in the reigon!");
|
assert(PrevBlock && "Expected a predecessor not in the reigon!");
|
||||||
OGVN = Cand.getGVN(PrevBlock);
|
OGVN = Cand.getGVN(PrevBlock);
|
||||||
}
|
}
|
||||||
GVN = OGVN.getValue();
|
GVN = *OGVN;
|
||||||
OGVN = Cand.getCanonicalNum(GVN);
|
OGVN = Cand.getCanonicalNum(GVN);
|
||||||
assert(OGVN && "No GVN found for incoming block?");
|
assert(OGVN && "No GVN found for incoming block?");
|
||||||
PHIGVNs.push_back(*OGVN);
|
PHIGVNs.push_back(*OGVN);
|
||||||
|
|
|
@ -975,7 +975,7 @@ Instruction *InstCombinerImpl::visitTrunc(TruncInst &Trunc) {
|
||||||
Attribute Attr =
|
Attribute Attr =
|
||||||
Trunc.getFunction()->getFnAttribute(Attribute::VScaleRange);
|
Trunc.getFunction()->getFnAttribute(Attribute::VScaleRange);
|
||||||
if (Optional<unsigned> MaxVScale = Attr.getVScaleRangeMax()) {
|
if (Optional<unsigned> MaxVScale = Attr.getVScaleRangeMax()) {
|
||||||
if (Log2_32(MaxVScale.getValue()) < DestWidth) {
|
if (Log2_32(*MaxVScale) < DestWidth) {
|
||||||
Value *VScale = Builder.CreateVScale(ConstantInt::get(DestTy, 1));
|
Value *VScale = Builder.CreateVScale(ConstantInt::get(DestTy, 1));
|
||||||
return replaceInstUsesWith(Trunc, VScale);
|
return replaceInstUsesWith(Trunc, VScale);
|
||||||
}
|
}
|
||||||
|
@ -1347,7 +1347,7 @@ Instruction *InstCombinerImpl::visitZExt(ZExtInst &CI) {
|
||||||
Attribute Attr = CI.getFunction()->getFnAttribute(Attribute::VScaleRange);
|
Attribute Attr = CI.getFunction()->getFnAttribute(Attribute::VScaleRange);
|
||||||
if (Optional<unsigned> MaxVScale = Attr.getVScaleRangeMax()) {
|
if (Optional<unsigned> MaxVScale = Attr.getVScaleRangeMax()) {
|
||||||
unsigned TypeWidth = Src->getType()->getScalarSizeInBits();
|
unsigned TypeWidth = Src->getType()->getScalarSizeInBits();
|
||||||
if (Log2_32(MaxVScale.getValue()) < TypeWidth) {
|
if (Log2_32(*MaxVScale) < TypeWidth) {
|
||||||
Value *VScale = Builder.CreateVScale(ConstantInt::get(DestTy, 1));
|
Value *VScale = Builder.CreateVScale(ConstantInt::get(DestTy, 1));
|
||||||
return replaceInstUsesWith(CI, VScale);
|
return replaceInstUsesWith(CI, VScale);
|
||||||
}
|
}
|
||||||
|
@ -1620,7 +1620,7 @@ Instruction *InstCombinerImpl::visitSExt(SExtInst &CI) {
|
||||||
CI.getFunction()->hasFnAttribute(Attribute::VScaleRange)) {
|
CI.getFunction()->hasFnAttribute(Attribute::VScaleRange)) {
|
||||||
Attribute Attr = CI.getFunction()->getFnAttribute(Attribute::VScaleRange);
|
Attribute Attr = CI.getFunction()->getFnAttribute(Attribute::VScaleRange);
|
||||||
if (Optional<unsigned> MaxVScale = Attr.getVScaleRangeMax()) {
|
if (Optional<unsigned> MaxVScale = Attr.getVScaleRangeMax()) {
|
||||||
if (Log2_32(MaxVScale.getValue()) < (SrcBitSize - 1)) {
|
if (Log2_32(*MaxVScale) < (SrcBitSize - 1)) {
|
||||||
Value *VScale = Builder.CreateVScale(ConstantInt::get(DestTy, 1));
|
Value *VScale = Builder.CreateVScale(ConstantInt::get(DestTy, 1));
|
||||||
return replaceInstUsesWith(CI, VScale);
|
return replaceInstUsesWith(CI, VScale);
|
||||||
}
|
}
|
||||||
|
|
|
@ -313,8 +313,7 @@ public:
|
||||||
auto PreheaderCount = BFI->getBlockProfileCount(L.getLoopPreheader());
|
auto PreheaderCount = BFI->getBlockProfileCount(L.getLoopPreheader());
|
||||||
// If the average loop trip count is not greater than 1.5, we skip
|
// If the average loop trip count is not greater than 1.5, we skip
|
||||||
// promotion.
|
// promotion.
|
||||||
if (PreheaderCount &&
|
if (PreheaderCount && (*PreheaderCount * 3) >= (*InstrCount * 2))
|
||||||
(PreheaderCount.getValue() * 3) >= (InstrCount.getValue() * 2))
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1619,7 +1619,7 @@ static void fixFuncEntryCount(PGOUseFunc &Func, LoopInfo &LI,
|
||||||
continue;
|
continue;
|
||||||
auto BFICount = NBFI.getBlockProfileCount(&BBI);
|
auto BFICount = NBFI.getBlockProfileCount(&BBI);
|
||||||
CountValue = Func.getBBInfo(&BBI).CountValue;
|
CountValue = Func.getBBInfo(&BBI).CountValue;
|
||||||
BFICountValue = BFICount.getValue();
|
BFICountValue = *BFICount;
|
||||||
SumCount.add(APFloat(CountValue * 1.0), APFloat::rmNearestTiesToEven);
|
SumCount.add(APFloat(CountValue * 1.0), APFloat::rmNearestTiesToEven);
|
||||||
SumBFICount.add(APFloat(BFICountValue * 1.0), APFloat::rmNearestTiesToEven);
|
SumBFICount.add(APFloat(BFICountValue * 1.0), APFloat::rmNearestTiesToEven);
|
||||||
}
|
}
|
||||||
|
@ -1672,7 +1672,7 @@ static void verifyFuncBFI(PGOUseFunc &Func, LoopInfo &LI,
|
||||||
NonZeroBBNum++;
|
NonZeroBBNum++;
|
||||||
auto BFICount = NBFI.getBlockProfileCount(&BBI);
|
auto BFICount = NBFI.getBlockProfileCount(&BBI);
|
||||||
if (BFICount)
|
if (BFICount)
|
||||||
BFICountValue = BFICount.getValue();
|
BFICountValue = *BFICount;
|
||||||
|
|
||||||
if (HotBBOnly) {
|
if (HotBBOnly) {
|
||||||
bool rawIsHot = CountValue >= HotCountThreshold;
|
bool rawIsHot = CountValue >= HotCountThreshold;
|
||||||
|
|
|
@ -1188,9 +1188,7 @@ bool GVNPass::AnalyzeLoadAvailability(LoadInst *Load, MemDepResult DepInfo,
|
||||||
canCoerceMustAliasedValueToLoad(DepLoad, LoadType, DL)) {
|
canCoerceMustAliasedValueToLoad(DepLoad, LoadType, DL)) {
|
||||||
const auto ClobberOff = MD->getClobberOffset(DepLoad);
|
const auto ClobberOff = MD->getClobberOffset(DepLoad);
|
||||||
// GVN has no deal with a negative offset.
|
// GVN has no deal with a negative offset.
|
||||||
Offset = (ClobberOff == None || ClobberOff.getValue() < 0)
|
Offset = (ClobberOff == None || *ClobberOff < 0) ? -1 : *ClobberOff;
|
||||||
? -1
|
|
||||||
: ClobberOff.getValue();
|
|
||||||
}
|
}
|
||||||
if (Offset == -1)
|
if (Offset == -1)
|
||||||
Offset =
|
Offset =
|
||||||
|
|
|
@ -1414,7 +1414,7 @@ bool LoopConstrainer::run() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SubRanges SR = MaybeSR.getValue();
|
SubRanges SR = *MaybeSR;
|
||||||
bool Increasing = MainLoopStructure.IndVarIncreasing;
|
bool Increasing = MainLoopStructure.IndVarIncreasing;
|
||||||
IntegerType *IVTy =
|
IntegerType *IVTy =
|
||||||
cast<IntegerType>(Range.getBegin()->getType());
|
cast<IntegerType>(Range.getBegin()->getType());
|
||||||
|
@ -1927,7 +1927,7 @@ bool InductiveRangeCheckElimination::run(
|
||||||
<< FailureReason << "\n";);
|
<< FailureReason << "\n";);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
LoopStructure LS = MaybeLoopStructure.getValue();
|
LoopStructure LS = *MaybeLoopStructure;
|
||||||
if (!isProfitableToTransform(*L, LS))
|
if (!isProfitableToTransform(*L, LS))
|
||||||
return false;
|
return false;
|
||||||
const SCEVAddRecExpr *IndVar =
|
const SCEVAddRecExpr *IndVar =
|
||||||
|
|
|
@ -777,7 +777,7 @@ unsigned LoopPredication::collectChecks(SmallVectorImpl<Value *> &Checks,
|
||||||
if (ICmpInst *ICI = dyn_cast<ICmpInst>(Condition)) {
|
if (ICmpInst *ICI = dyn_cast<ICmpInst>(Condition)) {
|
||||||
if (auto NewRangeCheck = widenICmpRangeCheck(ICI, Expander,
|
if (auto NewRangeCheck = widenICmpRangeCheck(ICI, Expander,
|
||||||
Guard)) {
|
Guard)) {
|
||||||
Checks.push_back(NewRangeCheck.getValue());
|
Checks.push_back(*NewRangeCheck);
|
||||||
NumWidened++;
|
NumWidened++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,7 +304,7 @@ static ArrayRef<Use> GetDeoptBundleOperands(const CallBase *Call) {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DeoptBundle.getValue().Inputs;
|
return DeoptBundle->Inputs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Compute the live-in set for every basic block in the function
|
/// Compute the live-in set for every basic block in the function
|
||||||
|
|
|
@ -222,7 +222,7 @@ static bool addDiscriminators(Function &F) {
|
||||||
<< DIL->getColumn() << ":" << Discriminator << " "
|
<< DIL->getColumn() << ":" << Discriminator << " "
|
||||||
<< I << "\n");
|
<< I << "\n");
|
||||||
} else {
|
} else {
|
||||||
I.setDebugLoc(NewDIL.getValue());
|
I.setDebugLoc(*NewDIL);
|
||||||
LLVM_DEBUG(dbgs() << DIL->getFilename() << ":" << DIL->getLine() << ":"
|
LLVM_DEBUG(dbgs() << DIL->getFilename() << ":" << DIL->getLine() << ":"
|
||||||
<< DIL->getColumn() << ":" << Discriminator << " " << I
|
<< DIL->getColumn() << ":" << Discriminator << " " << I
|
||||||
<< "\n");
|
<< "\n");
|
||||||
|
@ -260,7 +260,7 @@ static bool addDiscriminators(Function &F) {
|
||||||
<< CurrentDIL->getLine() << ":" << CurrentDIL->getColumn()
|
<< CurrentDIL->getLine() << ":" << CurrentDIL->getColumn()
|
||||||
<< ":" << Discriminator << " " << I << "\n");
|
<< ":" << Discriminator << " " << I << "\n");
|
||||||
} else {
|
} else {
|
||||||
I.setDebugLoc(NewDIL.getValue());
|
I.setDebugLoc(*NewDIL);
|
||||||
Changed = true;
|
Changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -485,7 +485,7 @@ bool llvm::wouldInstructionBeTriviallyDead(Instruction *I,
|
||||||
|
|
||||||
if (auto *FPI = dyn_cast<ConstrainedFPIntrinsic>(I)) {
|
if (auto *FPI = dyn_cast<ConstrainedFPIntrinsic>(I)) {
|
||||||
Optional<fp::ExceptionBehavior> ExBehavior = FPI->getExceptionBehavior();
|
Optional<fp::ExceptionBehavior> ExBehavior = FPI->getExceptionBehavior();
|
||||||
return ExBehavior.getValue() != fp::ebStrict;
|
return *ExBehavior != fp::ebStrict;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -513,7 +513,7 @@ LoopUnrollResult llvm::UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI,
|
||||||
if (const DILocation *DIL = I.getDebugLoc()) {
|
if (const DILocation *DIL = I.getDebugLoc()) {
|
||||||
auto NewDIL = DIL->cloneByMultiplyingDuplicationFactor(ULO.Count);
|
auto NewDIL = DIL->cloneByMultiplyingDuplicationFactor(ULO.Count);
|
||||||
if (NewDIL)
|
if (NewDIL)
|
||||||
I.setDebugLoc(NewDIL.getValue());
|
I.setDebugLoc(*NewDIL);
|
||||||
else
|
else
|
||||||
LLVM_DEBUG(dbgs()
|
LLVM_DEBUG(dbgs()
|
||||||
<< "Failed to create new discriminator: "
|
<< "Failed to create new discriminator: "
|
||||||
|
|
|
@ -356,7 +356,7 @@ llvm::UnrollAndJamLoop(Loop *L, unsigned Count, unsigned TripCount,
|
||||||
if (const DILocation *DIL = I.getDebugLoc()) {
|
if (const DILocation *DIL = I.getDebugLoc()) {
|
||||||
auto NewDIL = DIL->cloneByMultiplyingDuplicationFactor(Count);
|
auto NewDIL = DIL->cloneByMultiplyingDuplicationFactor(Count);
|
||||||
if (NewDIL)
|
if (NewDIL)
|
||||||
I.setDebugLoc(NewDIL.getValue());
|
I.setDebugLoc(*NewDIL);
|
||||||
else
|
else
|
||||||
LLVM_DEBUG(dbgs()
|
LLVM_DEBUG(dbgs()
|
||||||
<< "Failed to create new discriminator: "
|
<< "Failed to create new discriminator: "
|
||||||
|
|
|
@ -144,7 +144,7 @@ void StackInfoBuilder::visit(Instruction &Inst) {
|
||||||
|
|
||||||
uint64_t getAllocaSizeInBytes(const AllocaInst &AI) {
|
uint64_t getAllocaSizeInBytes(const AllocaInst &AI) {
|
||||||
auto DL = AI.getModule()->getDataLayout();
|
auto DL = AI.getModule()->getDataLayout();
|
||||||
return AI.getAllocationSizeInBits(DL).getValue() / 8;
|
return *AI.getAllocationSizeInBits(DL) / 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
void alignAndPadAlloca(memtag::AllocaInfo &Info, llvm::Align Alignment) {
|
void alignAndPadAlloca(memtag::AllocaInfo &Info, llvm::Align Alignment) {
|
||||||
|
|
|
@ -933,7 +933,7 @@ void InnerLoopVectorizer::setDebugLocFromInst(
|
||||||
auto NewDIL =
|
auto NewDIL =
|
||||||
DIL->cloneByMultiplyingDuplicationFactor(UF * VF.getKnownMinValue());
|
DIL->cloneByMultiplyingDuplicationFactor(UF * VF.getKnownMinValue());
|
||||||
if (NewDIL)
|
if (NewDIL)
|
||||||
Builder.SetCurrentDebugLocation(NewDIL.getValue());
|
Builder.SetCurrentDebugLocation(*NewDIL);
|
||||||
else
|
else
|
||||||
LLVM_DEBUG(dbgs()
|
LLVM_DEBUG(dbgs()
|
||||||
<< "Failed to create new discriminator: "
|
<< "Failed to create new discriminator: "
|
||||||
|
@ -5319,7 +5319,7 @@ VectorizationFactor LoopVectorizationCostModel::selectVectorizationFactor(
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
unsigned AssumedMinimumVscale = 1;
|
unsigned AssumedMinimumVscale = 1;
|
||||||
if (Optional<unsigned> VScale = getVScaleForTuning())
|
if (Optional<unsigned> VScale = getVScaleForTuning())
|
||||||
AssumedMinimumVscale = VScale.getValue();
|
AssumedMinimumVscale = *VScale;
|
||||||
unsigned Width =
|
unsigned Width =
|
||||||
Candidate.Width.isScalable()
|
Candidate.Width.isScalable()
|
||||||
? Candidate.Width.getKnownMinValue() * AssumedMinimumVscale
|
? Candidate.Width.getKnownMinValue() * AssumedMinimumVscale
|
||||||
|
@ -5537,7 +5537,7 @@ LoopVectorizationCostModel::selectEpilogueVectorizationFactor(
|
||||||
if (MainLoopVF.isScalable()) {
|
if (MainLoopVF.isScalable()) {
|
||||||
EstimatedRuntimeVF = ElementCount::getFixed(MainLoopVF.getKnownMinValue());
|
EstimatedRuntimeVF = ElementCount::getFixed(MainLoopVF.getKnownMinValue());
|
||||||
if (Optional<unsigned> VScale = getVScaleForTuning())
|
if (Optional<unsigned> VScale = getVScaleForTuning())
|
||||||
EstimatedRuntimeVF *= VScale.getValue();
|
EstimatedRuntimeVF *= *VScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &NextVF : ProfitableVFs)
|
for (auto &NextVF : ProfitableVFs)
|
||||||
|
|
|
@ -1597,7 +1597,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BestOp.Idx) {
|
if (BestOp.Idx) {
|
||||||
getData(BestOp.Idx.getValue(), Lane).IsUsed = IsUsed;
|
getData(*BestOp.Idx, Lane).IsUsed = IsUsed;
|
||||||
return BestOp.Idx;
|
return BestOp.Idx;
|
||||||
}
|
}
|
||||||
// If we could not find a good match return None.
|
// If we could not find a good match return None.
|
||||||
|
@ -1938,7 +1938,7 @@ public:
|
||||||
if (BestIdx) {
|
if (BestIdx) {
|
||||||
// Swap the current operand with the one returned by
|
// Swap the current operand with the one returned by
|
||||||
// getBestOperand().
|
// getBestOperand().
|
||||||
swap(OpIdx, BestIdx.getValue(), Lane);
|
swap(OpIdx, *BestIdx, Lane);
|
||||||
} else {
|
} else {
|
||||||
// We failed to find a best operand, set mode to 'Failed'.
|
// We failed to find a best operand, set mode to 'Failed'.
|
||||||
ReorderingModes[OpIdx] = ReorderingMode::Failed;
|
ReorderingModes[OpIdx] = ReorderingMode::Failed;
|
||||||
|
@ -2557,7 +2557,7 @@ private:
|
||||||
ScalarToTreeEntry[V] = Last;
|
ScalarToTreeEntry[V] = Last;
|
||||||
}
|
}
|
||||||
// Update the scheduler bundle to point to this TreeEntry.
|
// Update the scheduler bundle to point to this TreeEntry.
|
||||||
ScheduleData *BundleMember = Bundle.getValue();
|
ScheduleData *BundleMember = *Bundle;
|
||||||
assert((BundleMember || isa<PHINode>(S.MainOp) ||
|
assert((BundleMember || isa<PHINode>(S.MainOp) ||
|
||||||
isVectorLikeInstWithConstOps(S.MainOp) ||
|
isVectorLikeInstWithConstOps(S.MainOp) ||
|
||||||
doesNotNeedToSchedule(VL)) &&
|
doesNotNeedToSchedule(VL)) &&
|
||||||
|
|
|
@ -387,7 +387,7 @@ VPInstruction *VPlanSlp::buildGraph(ArrayRef<VPValue *> Values) {
|
||||||
return markFailed();
|
return markFailed();
|
||||||
|
|
||||||
assert(getOpcode(Values) && "Opcodes for all values must match");
|
assert(getOpcode(Values) && "Opcodes for all values must match");
|
||||||
unsigned ValuesOpcode = getOpcode(Values).getValue();
|
unsigned ValuesOpcode = *getOpcode(Values);
|
||||||
|
|
||||||
SmallVector<VPValue *, 4> CombinedOperands;
|
SmallVector<VPValue *, 4> CombinedOperands;
|
||||||
if (areCommutative(Values)) {
|
if (areCommutative(Values)) {
|
||||||
|
|
|
@ -538,7 +538,7 @@ void SourceCoverageViewHTML::renderLine(raw_ostream &OS, LineRef L,
|
||||||
auto Highlight = [&](const std::string &Snippet, unsigned LC, unsigned RC) {
|
auto Highlight = [&](const std::string &Snippet, unsigned LC, unsigned RC) {
|
||||||
if (getOptions().Debug)
|
if (getOptions().Debug)
|
||||||
HighlightedRanges.emplace_back(LC, RC);
|
HighlightedRanges.emplace_back(LC, RC);
|
||||||
return tag("span", Snippet, std::string(Color.getValue()));
|
return tag("span", Snippet, std::string(*Color));
|
||||||
};
|
};
|
||||||
|
|
||||||
auto CheckIfUncovered = [&](const CoverageSegment *S) {
|
auto CheckIfUncovered = [&](const CoverageSegment *S) {
|
||||||
|
|
|
@ -519,7 +519,7 @@ int main(int argc, char *argv[]) {
|
||||||
// TODO: Remove OutputFormat flag in the next revision.
|
// TODO: Remove OutputFormat flag in the next revision.
|
||||||
WithColor::warning() << "--output-format option is deprecated, please use "
|
WithColor::warning() << "--output-format option is deprecated, please use "
|
||||||
"--output-{FILE_FORMAT} options instead\n";
|
"--output-{FILE_FORMAT} options instead\n";
|
||||||
switch (Config.OutputFormat.getValue()) {
|
switch (*Config.OutputFormat) {
|
||||||
case FileFormat::TBD: {
|
case FileFormat::TBD: {
|
||||||
std::error_code SysErr;
|
std::error_code SysErr;
|
||||||
raw_fd_ostream Out(*Config.Output, SysErr);
|
raw_fd_ostream Out(*Config.Output, SysErr);
|
||||||
|
|
|
@ -1066,7 +1066,7 @@ int main(int argc, char **argv) {
|
||||||
CodeGen.setAttrs(codegen::getMAttrs());
|
CodeGen.setAttrs(codegen::getMAttrs());
|
||||||
|
|
||||||
if (auto FT = codegen::getExplicitFileType())
|
if (auto FT = codegen::getExplicitFileType())
|
||||||
CodeGen.setFileType(FT.getValue());
|
CodeGen.setFileType(*FT);
|
||||||
|
|
||||||
if (!OutputFilename.empty()) {
|
if (!OutputFilename.empty()) {
|
||||||
if (SaveLinkedModuleFile) {
|
if (SaveLinkedModuleFile) {
|
||||||
|
|
|
@ -241,7 +241,7 @@ static int run(int argc, char **argv) {
|
||||||
Conf.Options = codegen::InitTargetOptionsFromCodeGenFlags(Triple());
|
Conf.Options = codegen::InitTargetOptionsFromCodeGenFlags(Triple());
|
||||||
Conf.MAttrs = codegen::getMAttrs();
|
Conf.MAttrs = codegen::getMAttrs();
|
||||||
if (auto RM = codegen::getExplicitRelocModel())
|
if (auto RM = codegen::getExplicitRelocModel())
|
||||||
Conf.RelocModel = RM.getValue();
|
Conf.RelocModel = *RM;
|
||||||
Conf.CodeModel = codegen::getExplicitCodeModel();
|
Conf.CodeModel = codegen::getExplicitCodeModel();
|
||||||
|
|
||||||
Conf.DebugPassManager = DebugPassManager;
|
Conf.DebugPassManager = DebugPassManager;
|
||||||
|
@ -288,7 +288,7 @@ static int run(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto FT = codegen::getExplicitFileType())
|
if (auto FT = codegen::getExplicitFileType())
|
||||||
Conf.CGFileType = FT.getValue();
|
Conf.CGFileType = *FT;
|
||||||
|
|
||||||
Conf.OverrideTriple = OverrideTriple;
|
Conf.OverrideTriple = OverrideTriple;
|
||||||
Conf.DefaultTriple = DefaultTriple;
|
Conf.DefaultTriple = DefaultTriple;
|
||||||
|
|
|
@ -2129,7 +2129,7 @@ void objdump::printSymbol(const ObjectFile *O, const SymbolRef &Symbol,
|
||||||
dyn_cast<const XCOFFObjectFile>(O), Symbol);
|
dyn_cast<const XCOFFObjectFile>(O), Symbol);
|
||||||
if (SymRef) {
|
if (SymRef) {
|
||||||
|
|
||||||
Expected<StringRef> NameOrErr = SymRef.getValue().getName();
|
Expected<StringRef> NameOrErr = SymRef->getName();
|
||||||
|
|
||||||
if (NameOrErr) {
|
if (NameOrErr) {
|
||||||
outs() << " (csect:";
|
outs() << " (csect:";
|
||||||
|
@ -2289,7 +2289,7 @@ static void printFaultMaps(const ObjectFile *Obj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
StringRef FaultMapContents =
|
StringRef FaultMapContents =
|
||||||
unwrapOrError(FaultMapSection.getValue().getContents(), Obj->getFileName());
|
unwrapOrError(FaultMapSection->getContents(), Obj->getFileName());
|
||||||
FaultMapParser FMP(FaultMapContents.bytes_begin(),
|
FaultMapParser FMP(FaultMapContents.bytes_begin(),
|
||||||
FaultMapContents.bytes_end());
|
FaultMapContents.bytes_end());
|
||||||
|
|
||||||
|
|
|
@ -450,9 +450,7 @@ void dumpDebugLines(DWARFContext &DCtx, DWARFYAML::Data &Y) {
|
||||||
|
|
||||||
default:
|
default:
|
||||||
for (uint8_t i = 0;
|
for (uint8_t i = 0;
|
||||||
i <
|
i < (*DebugLines.StandardOpcodeLengths)[NewOp.Opcode - 1]; ++i)
|
||||||
DebugLines.StandardOpcodeLengths.getValue()[NewOp.Opcode - 1];
|
|
||||||
++i)
|
|
||||||
NewOp.StandardOpcodeData.push_back(LineData.getULEB128(&Offset));
|
NewOp.StandardOpcodeData.push_back(LineData.getULEB128(&Offset));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue