[llvm-commits] [llvm] r118788 - in /llvm/trunk: lib/Transforms/Scalar/Sink.cpp test/Analysis/TypeBasedAliasAnalysis/sink.ll
Chris Lattner
clattner at apple.com
Thu Nov 11 09:59:33 PST 2010
On Nov 11, 2010, at 8:21 AM, Dan Gohman wrote:
> Author: djg
> Date: Thu Nov 11 10:21:47 2010
> New Revision: 118788
>
> URL: http://llvm.org/viewvc/llvm-project?rev=118788&view=rev
> Log:
> Make Sink tbaa-aware.
Makes sense, a minor API suggestion:
> +++ llvm/trunk/lib/Transforms/Scalar/Sink.cpp Thu Nov 11 10:21:47 2010
> @@ -15,6 +15,7 @@
> #define DEBUG_TYPE "sink"
> #include "llvm/Transforms/Scalar.h"
> #include "llvm/IntrinsicInst.h"
> +#include "llvm/LLVMContext.h"
> #include "llvm/Analysis/Dominators.h"
> #include "llvm/Analysis/LoopInfo.h"
> #include "llvm/Analysis/AliasAnalysis.h"
> @@ -158,9 +159,11 @@
>
> Value *Ptr = L->getPointerOperand();
> uint64_t Size = AA->getTypeStoreSize(L->getType());
> + const MDNode *TBAAInfo = L->getMetadata(LLVMContext::MD_tbaa);
> + AliasAnalysis::Location Loc(Ptr, Size, TBAAInfo);
How about adding a static member to Location so that you could use something like this (likewise for other mem operations):
AliasAnalysis::Location Loc = AliasAnalysis::Location::getLoadLoc(L);
This has the dual advantage of making the code simpler, and also not requiring an LLVMContext.h #include.
-Chris
More information about the llvm-commits
mailing list