File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
llvm/lib/Transforms/Utils Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 2323#include " llvm/IR/Dominators.h"
2424#include " llvm/IR/MDBuilder.h"
2525#include " llvm/IR/PassManager.h"
26+ #include " llvm/IR/ProfDataUtils.h"
2627#include " llvm/Support/CommandLine.h"
2728#include " llvm/Transforms/Utils/BasicBlockUtils.h"
2829#include " llvm/Transforms/Utils/Cloning.h"
@@ -109,8 +110,12 @@ void LoopVersioning::versionLoop(
109110 // Insert the conditional branch based on the result of the memchecks.
110111 Instruction *OrigTerm = RuntimeCheckBB->getTerminator ();
111112 Builder.SetInsertPoint (OrigTerm);
112- Builder.CreateCondBr (RuntimeCheck, NonVersionedLoop->getLoopPreheader (),
113+ auto *BI = Builder.CreateCondBr (RuntimeCheck, NonVersionedLoop->getLoopPreheader (),
113114 VersionedLoop->getLoopPreheader ());
115+ // We don't know what the probability of executing the versioned vs the
116+ // unversioned variants is.
117+ setExplicitlyUnknownBranchWeightsIfProfiled (
118+ *BI, *BI->getParent ()->getParent (), DEBUG_TYPE);
114119 OrigTerm->eraseFromParent ();
115120
116121 // The loops merge in the original exit block. This is now dominated by the
You can’t perform that action at this time.
0 commit comments