summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-04-30 00:55:59 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-04-30 00:55:59 +0000
commit47cf2affbdb8a8152b84965134282581692baace (patch)
tree7f35f302fead07fd1a2695b9749d6e44e0d47d08 /llvm/lib/Transforms
parent1befea2bdcb2514298441fd15adf89e65548faeb (diff)
downloadbcm5719-llvm-47cf2affbdb8a8152b84965134282581692baace.tar.gz
bcm5719-llvm-47cf2affbdb8a8152b84965134282581692baace.zip
[LowerGuardIntrinsics] Keep track of !make.implicit metadata
If a guard call being lowered by LowerGuardIntrinsics has the `!make.implicit` metadata attached, then reattach the metadata to the branch in the resulting expanded form of the intrinsic. This allows us to implement null checks as guards and still get the benefit of implicit null checks. llvm-svn: 268148
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LowerGuardIntrinsic.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LowerGuardIntrinsic.cpp b/llvm/lib/Transforms/Scalar/LowerGuardIntrinsic.cpp
index a58346c2b1c..7ba17069f42 100644
--- a/llvm/lib/Transforms/Scalar/LowerGuardIntrinsic.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerGuardIntrinsic.cpp
@@ -56,6 +56,9 @@ static void MakeGuardControlFlowExplicit(Function *DeoptIntrinsic,
CheckBI->getSuccessor(0)->setName("guarded");
CheckBI->getSuccessor(1)->setName("deopt");
+ if (auto *MD = CI->getMetadata(LLVMContext::MD_make_implicit))
+ CheckBI->setMetadata(LLVMContext::MD_make_implicit, MD);
+
IRBuilder<> B(DeoptBlockTerm);
auto *DeoptCall = B.CreateCall(DeoptIntrinsic, Args, {DeoptOB}, "");
OpenPOWER on IntegriCloud