diff options
author | Paul Kirth <paulkirth@google.com> | 2022-06-29 21:31:17 +0000 |
---|---|---|
committer | Paul Kirth <paulkirth@google.com> | 2022-07-27 21:13:54 +0000 |
commit | 300c9a78819b4608b96bb26f9320bea6b8a0c4d0 (patch) | |
tree | 2beb7b299bfce398ecf2e6ca70fe6c8889e4d64f /llvm/lib/Transforms/Utils/LoopUtils.cpp | |
parent | 6047deb7c2aa94d9bc2b70b49799d22cce778bd4 (diff) | |
download | llvm-300c9a78819b4608b96bb26f9320bea6b8a0c4d0.zip llvm-300c9a78819b4608b96bb26f9320bea6b8a0c4d0.tar.gz llvm-300c9a78819b4608b96bb26f9320bea6b8a0c4d0.tar.bz2 |
[llvm][NFC] Refactor code to use ProfDataUtils
In this patch we replace common code patterns with the use of utility
functions for dealing with profiling metadata. There should be no change
in functionality, as the existing checks should be preserved in all
cases.
Reviewed By: bogner, davidxl
Differential Revision: https://reviews.llvm.org/D128860
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUtils.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp index 349063d..03272e5f 100644 --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -38,6 +38,7 @@ #include "llvm/IR/MDBuilder.h" #include "llvm/IR/Module.h" #include "llvm/IR/PatternMatch.h" +#include "llvm/IR/ProfDataUtils.h" #include "llvm/IR/ValueHandle.h" #include "llvm/InitializePasses.h" #include "llvm/Pass.h" @@ -789,7 +790,7 @@ getEstimatedTripCount(BranchInst *ExitingBranch, Loop *L, // know the number of times the backedge was taken, vs. the number of times // we exited the loop. uint64_t LoopWeight, ExitWeight; - if (!ExitingBranch->extractProfMetadata(LoopWeight, ExitWeight)) + if (!extractBranchWeights(*ExitingBranch, LoopWeight, ExitWeight)) return None; if (L->contains(ExitingBranch->getSuccessor(1))) |