Author: Kazu Hirata Date: 2020-11-24T22:52:30-08:00 New Revision: 1c82d320893c9e93d8bd1d4a2aded7e4df4bdf30
URL: https://github.com/llvm/llvm-project/commit/1c82d320893c9e93d8bd1d4a2aded7e4df4bdf30 DIFF: https://github.com/llvm/llvm-project/commit/1c82d320893c9e93d8bd1d4a2aded7e4df4bdf30.diff LOG: [CHR] Use pred_size (NFC) Added: Modified: llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp Removed: ################################################################################ diff --git a/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp b/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp index a99c58b74fb1..9bfb176dcd7f 100644 --- a/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp +++ b/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp @@ -1609,9 +1609,7 @@ static void insertTrivialPHIs(CHRScope *Scope, // Insert a trivial phi for I (phi [&I, P0], [&I, P1], ...) at // ExitBlock. Replace I with the new phi in UI unless UI is another // phi at ExitBlock. - unsigned PredCount = std::distance(pred_begin(ExitBlock), - pred_end(ExitBlock)); - PHINode *PN = PHINode::Create(I.getType(), PredCount, "", + PHINode *PN = PHINode::Create(I.getType(), pred_size(ExitBlock), "", &ExitBlock->front()); for (BasicBlock *Pred : predecessors(ExitBlock)) { PN->addIncoming(&I, Pred); _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits