diff options
author | Justin Holewinski <jholewinski@nvidia.com> | 2013-05-21 14:37:16 +0000 |
---|---|---|
committer | Justin Holewinski <jholewinski@nvidia.com> | 2013-05-21 14:37:16 +0000 |
commit | c2b7f5fa511420b99dd8238ab4ba769a6a6015a5 (patch) | |
tree | 5cc400d5bf21514da489c673ac6ad7e39c8d499b /lib/CodeGen | |
parent | 75e9ee8b7fc2b7c91239f4b9b8d77087fd8ea4e4 (diff) | |
download | external_llvm-c2b7f5fa511420b99dd8238ab4ba769a6a6015a5.zip external_llvm-c2b7f5fa511420b99dd8238ab4ba769a6a6015a5.tar.gz external_llvm-c2b7f5fa511420b99dd8238ab4ba769a6a6015a5.tar.bz2 |
Drop @llvm.annotation and @llvm.ptr.annotation intrinsics during codegen.
The intrinsic calls are dropped, but the annotated value is propagated.
Fixes PR 15253
Original patch by Zeng Bin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182387 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/IntrinsicLowering.cpp | 6 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index 07f0ccf..d894f66 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/lib/CodeGen/IntrinsicLowering.cpp @@ -453,6 +453,12 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { CI->replaceAllUsesWith(ConstantInt::get(CI->getType(), 1)); break; + case Intrinsic::annotation: + case Intrinsic::ptr_annotation: + // Just drop the annotation, but forward the value + CI->replaceAllUsesWith(CI->getOperand(0)); + break; + case Intrinsic::var_annotation: break; // Strip out annotate intrinsic diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 4c6d028..c12cf52 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -5037,6 +5037,11 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) { setValue(&I, Res); return 0; } + case Intrinsic::annotation: + case Intrinsic::ptr_annotation: + // Drop the intrinsic, but forward the value + setValue(&I, getValue(I.getOperand(0))); + return 0; case Intrinsic::var_annotation: // Discard annotate attributes return 0; |