[llvm-commits] [llvm] r164728 - in /llvm/trunk: include/llvm/IRBuilder.h lib/VMCore/IRBuilder.cpp
Dan Gohman
gohman at apple.com
Wed Sep 26 15:17:14 PDT 2012
Author: djg
Date: Wed Sep 26 17:17:14 2012
New Revision: 164728
URL: http://llvm.org/viewvc/llvm-project?rev=164728&view=rev
Log:
Add IRBuilder code for adding !tbaa.struct metadata tags to llvm.memcpy calls.
Modified:
llvm/trunk/include/llvm/IRBuilder.h
llvm/trunk/lib/VMCore/IRBuilder.cpp
Modified: llvm/trunk/include/llvm/IRBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IRBuilder.h?rev=164728&r1=164727&r2=164728&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IRBuilder.h (original)
+++ llvm/trunk/include/llvm/IRBuilder.h Wed Sep 26 17:17:14 2012
@@ -285,12 +285,15 @@
/// If the pointers aren't i8*, they will be converted. If a TBAA tag is
/// specified, it will be added to the instruction.
CallInst *CreateMemCpy(Value *Dst, Value *Src, uint64_t Size, unsigned Align,
- bool isVolatile = false, MDNode *TBAATag = 0) {
- return CreateMemCpy(Dst, Src, getInt64(Size), Align, isVolatile, TBAATag);
+ bool isVolatile = false, MDNode *TBAATag = 0,
+ MDNode *TBAAStructTag = 0) {
+ return CreateMemCpy(Dst, Src, getInt64(Size), Align, isVolatile, TBAATag,
+ TBAAStructTag);
}
CallInst *CreateMemCpy(Value *Dst, Value *Src, Value *Size, unsigned Align,
- bool isVolatile = false, MDNode *TBAATag = 0);
+ bool isVolatile = false, MDNode *TBAATag = 0,
+ MDNode *TBAAStructTag = 0);
/// CreateMemMove - Create and insert a memmove between the specified
/// pointers. If the pointers aren't i8*, they will be converted. If a TBAA
Modified: llvm/trunk/lib/VMCore/IRBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/IRBuilder.cpp?rev=164728&r1=164727&r2=164728&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/IRBuilder.cpp (original)
+++ llvm/trunk/lib/VMCore/IRBuilder.cpp Wed Sep 26 17:17:14 2012
@@ -80,7 +80,7 @@
CallInst *IRBuilderBase::
CreateMemCpy(Value *Dst, Value *Src, Value *Size, unsigned Align,
- bool isVolatile, MDNode *TBAATag) {
+ bool isVolatile, MDNode *TBAATag, MDNode *TBAAStructTag) {
Dst = getCastedInt8PtrValue(Dst);
Src = getCastedInt8PtrValue(Src);
@@ -94,6 +94,10 @@
// Set the TBAA info if present.
if (TBAATag)
CI->setMetadata(LLVMContext::MD_tbaa, TBAATag);
+
+ // Set the TBAA Struct info if present.
+ if (TBAAStructTag)
+ CI->setMetadata(LLVMContext::MD_tbaa_struct, TBAAStructTag);
return CI;
}
More information about the llvm-commits
mailing list