Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Transforms/Utils/GuardUtils.cpp
Show All 39 Lines | void llvm::makeGuardControlFlowExplicit(Function *DeoptIntrinsic, | ||||
// SplitBlockAndInsertIfThen inserts control flow that branches to | // SplitBlockAndInsertIfThen inserts control flow that branches to | ||||
// DeoptBlockTerm if the condition is true. We want the opposite. | // DeoptBlockTerm if the condition is true. We want the opposite. | ||||
CheckBI->swapSuccessors(); | CheckBI->swapSuccessors(); | ||||
CheckBI->getSuccessor(0)->setName("guarded"); | CheckBI->getSuccessor(0)->setName("guarded"); | ||||
CheckBI->getSuccessor(1)->setName("deopt"); | CheckBI->getSuccessor(1)->setName("deopt"); | ||||
if (auto *MD = Guard->getMetadata(LLVMContext::MD_make_implicit)) | |||||
CheckBI->setMetadata(LLVMContext::MD_make_implicit, MD); | |||||
MDBuilder MDB(Guard->getContext()); | MDBuilder MDB(Guard->getContext()); | ||||
CheckBI->setMetadata(LLVMContext::MD_prof, | CheckBI->setMetadata(LLVMContext::MD_make_implicit, | ||||
mkazantsev: I don't get it... Why do you want to remove !prof from them? | |||||
MDB.createBranchWeights(PredicatePassBranchWeight, 1)); | MDB.createBranchWeights(PredicatePassBranchWeight, 1)); | ||||
IRBuilder<> B(DeoptBlockTerm); | IRBuilder<> B(DeoptBlockTerm); | ||||
auto *DeoptCall = B.CreateCall(DeoptIntrinsic, Args, {DeoptOB}, ""); | auto *DeoptCall = B.CreateCall(DeoptIntrinsic, Args, {DeoptOB}, ""); | ||||
if (DeoptIntrinsic->getReturnType()->isVoidTy()) { | if (DeoptIntrinsic->getReturnType()->isVoidTy()) { | ||||
B.CreateRetVoid(); | B.CreateRetVoid(); | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |
I don't get it... Why do you want to remove !prof from them?