diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/IR/Instructions.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/IR/Instructions.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/contrib/llvm-project/llvm/lib/IR/Instructions.cpp b/contrib/llvm-project/llvm/lib/IR/Instructions.cpp index 6a91edb75dd2..b333f40f3ce9 100644 --- a/contrib/llvm-project/llvm/lib/IR/Instructions.cpp +++ b/contrib/llvm-project/llvm/lib/IR/Instructions.cpp @@ -1696,6 +1696,10 @@ StringRef AtomicRMWInst::getOperationName(BinOp Op) { return "fadd"; case AtomicRMWInst::FSub: return "fsub"; + case AtomicRMWInst::FMax: + return "fmax"; + case AtomicRMWInst::FMin: + return "fmin"; case AtomicRMWInst::BAD_BINOP: return "<invalid operation>"; } @@ -4423,10 +4427,9 @@ MDNode *SwitchInstProfUpdateWrapper::buildProfBranchWeightsMD() { assert(SI.getNumSuccessors() == Weights->size() && "num of prof branch_weights must accord with num of successors"); - bool AllZeroes = - all_of(Weights.getValue(), [](uint32_t W) { return W == 0; }); + bool AllZeroes = all_of(Weights.value(), [](uint32_t W) { return W == 0; }); - if (AllZeroes || Weights.getValue().size() < 2) + if (AllZeroes || Weights.value().size() < 2) return nullptr; return MDBuilder(SI.getParent()->getContext()).createBranchWeights(*Weights); @@ -4460,8 +4463,8 @@ SwitchInstProfUpdateWrapper::removeCase(SwitchInst::CaseIt I) { // Copy the last case to the place of the removed one and shrink. // This is tightly coupled with the way SwitchInst::removeCase() removes // the cases in SwitchInst::removeCase(CaseIt). - Weights.getValue()[I->getCaseIndex() + 1] = Weights.getValue().back(); - Weights.getValue().pop_back(); + Weights.value()[I->getCaseIndex() + 1] = Weights.value().back(); + Weights.value().pop_back(); } return SI.removeCase(I); } @@ -4474,10 +4477,10 @@ void SwitchInstProfUpdateWrapper::addCase( if (!Weights && W && *W) { Changed = true; Weights = SmallVector<uint32_t, 8>(SI.getNumSuccessors(), 0); - Weights.getValue()[SI.getNumSuccessors() - 1] = *W; + Weights.value()[SI.getNumSuccessors() - 1] = *W; } else if (Weights) { Changed = true; - Weights.getValue().push_back(W.value_or(0)); + Weights.value().push_back(W.value_or(0)); } if (Weights) assert(SI.getNumSuccessors() == Weights->size() && |