Take advantage of TargetData when available; we know that the atomic intrinsics

only dereference the element they point to directly with no pointer arithmetic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84159 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky
2009-10-15 00:36:35 +00:00
parent cd2ae14ce3
commit 22c031296c

View File

@ -307,6 +307,7 @@ BasicAliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
return NoModRef;
}
if (TD) {
if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(CS.getInstruction())) {
switch (II->getIntrinsicID()) {
default: break;
@ -321,13 +322,17 @@ BasicAliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
case Intrinsic::atomic_load_max:
case Intrinsic::atomic_load_min:
case Intrinsic::atomic_load_umax:
case Intrinsic::atomic_load_umin:
if (alias(II->getOperand(1), Size, P, Size) == NoAlias)
case Intrinsic::atomic_load_umin: {
Value *Op1 = II->getOperand(1);
unsigned Op1Size = TD->getTypeStoreSize(Op1->getType());
if (alias(Op1, Op1Size, P, Size) == NoAlias)
return NoModRef;
break;
}
}
}
}
}
// The AliasAnalysis base class has some smarts, lets use them.
return AliasAnalysis::getModRefInfo(CS, P, Size);