summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2013-01-05 16:44:07 +0000
committerChris Lattner <sabre@nondot.org>2013-01-05 16:44:07 +0000
commit261304248f4f2cd0d9f0f85f91d400bcedeb0f45 (patch)
treebe6b45477f82e5690c5a232673520fef39785f7d /lib
parente4b4edd72ae596ac8d1fdbc6e77f61e331f6775d (diff)
downloadllvm-261304248f4f2cd0d9f0f85f91d400bcedeb0f45.tar.gz
llvm-261304248f4f2cd0d9f0f85f91d400bcedeb0f45.tar.bz2
llvm-261304248f4f2cd0d9f0f85f91d400bcedeb0f45.tar.xz
switch from pointer equality comparison to MDNode::getMostGenericTBAA
when merging two TBAA tags, pointed out by Nuno. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171627 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp8
-rw-r--r--lib/Transforms/Scalar/LICM.cpp8
-rw-r--r--lib/Transforms/Utils/MetaRenamer.cpp1
3 files changed, 9 insertions, 8 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index 7388e713e5..337cfe32a8 100644
--- a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
@@ -803,10 +803,10 @@ bool InstCombiner::SimplifyStoreAtEndOfBlock(StoreInst &SI) {
NewSI->setDebugLoc(OtherStore->getDebugLoc());
// If the two stores had the same TBAA tag, preserve it.
- if (MDNode *TBAATag1 = SI.getMetadata(LLVMContext::MD_tbaa))
- if (MDNode *TBAATag2 = OtherStore->getMetadata(LLVMContext::MD_tbaa))
- if (TBAATag1 == TBAATag2)
- NewSI->setMetadata(LLVMContext::MD_tbaa, TBAATag1);
+ if (MDNode *TBAATag = SI.getMetadata(LLVMContext::MD_tbaa))
+ if ((TBAATag = MDNode::getMostGenericTBAA(TBAATag,
+ OtherStore->getMetadata(LLVMContext::MD_tbaa))))
+ NewSI->setMetadata(LLVMContext::MD_tbaa, TBAATag);
// Nuke the old stores.
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index 9335363ab2..dc6bef71d1 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/lib/Transforms/Scalar/LICM.cpp
@@ -46,6 +46,7 @@
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/Metadata.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
@@ -816,10 +817,11 @@ void LICM::PromoteAliasSet(AliasSet &AS,
if (LoopUses.empty()) {
// On the first load/store, just take its TBAA tag.
TBAATag = Use->getMetadata(LLVMContext::MD_tbaa);
- } else if (TBAATag && TBAATag != Use->getMetadata(LLVMContext::MD_tbaa)) {
- TBAATag = 0;
+ } else if (TBAATag) {
+ TBAATag = MDNode::getMostGenericTBAA(TBAATag,
+ Use->getMetadata(LLVMContext::MD_tbaa));
}
-
+
LoopUses.push_back(Use);
}
}
diff --git a/lib/Transforms/Utils/MetaRenamer.cpp b/lib/Transforms/Utils/MetaRenamer.cpp
index f8f57b385b..2715aa08bc 100644
--- a/lib/Transforms/Utils/MetaRenamer.cpp
+++ b/lib/Transforms/Utils/MetaRenamer.cpp
@@ -22,7 +22,6 @@
#include "llvm/IR/Type.h"
#include "llvm/Pass.h"
#include "llvm/TypeFinder.h"
-
using namespace llvm;
namespace {