summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2016-09-03 22:26:11 +0000
committerXinliang David Li <davidxl@google.com>2016-09-03 22:26:11 +0000
commit7a28a7fbd893413678ad70a92696a78147de7b82 (patch)
tree3eca12e73f5fc8ca555eb963ab9fce49f77e5d8d
parent8d4cb1a06071250c82ac301a81496f979055484d (diff)
downloadbcm5719-llvm-7a28a7fbd893413678ad70a92696a78147de7b82.tar.gz
bcm5719-llvm-7a28a7fbd893413678ad70a92696a78147de7b82.zip
Cleanup : Use metadata preserving API for branch creation
Use the wrapper API in IRBuilder that does meta data copy to create new branch in LoopUnswitch. llvm-svn: 280602
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnswitch.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
index d419e723860..6c1f9c4a103 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -763,15 +763,10 @@ void LoopUnswitch::EmitPreheaderBranchOnCondition(Value *LIC, Constant *Val,
}
// Insert the new branch.
- BranchInst *BI = BranchInst::Create(TrueDest, FalseDest, BranchVal, InsertPt);
- if (TI) {
- // FIXME: check why white list is needed here:
- unsigned WL[3] = {LLVMContext::MD_dbg, LLVMContext::MD_prof,
- LLVMContext::MD_make_implicit};
- BI->copyMetadata(*TI, makeArrayRef(&WL[0], 3));
- if (Swapped)
- BI->swapProfMetadata();
- }
+ BranchInst *BI =
+ IRBuilder<>(InsertPt).CreateCondBr(BranchVal, TrueDest, FalseDest, TI);
+ if (Swapped)
+ BI->swapProfMetadata();
// If either edge is critical, split it. This helps preserve LoopSimplify
// form for enclosing loops.
OpenPOWER on IntegriCloud