mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-25 00:29:20 +00:00
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:
parent
cd2ae14ce3
commit
22c031296c
@ -307,24 +307,29 @@ BasicAliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
|
||||
return NoModRef;
|
||||
}
|
||||
|
||||
if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(CS.getInstruction())) {
|
||||
switch (II->getIntrinsicID()) {
|
||||
default: break;
|
||||
case Intrinsic::atomic_cmp_swap:
|
||||
case Intrinsic::atomic_swap:
|
||||
case Intrinsic::atomic_load_add:
|
||||
case Intrinsic::atomic_load_sub:
|
||||
case Intrinsic::atomic_load_and:
|
||||
case Intrinsic::atomic_load_nand:
|
||||
case Intrinsic::atomic_load_or:
|
||||
case Intrinsic::atomic_load_xor:
|
||||
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)
|
||||
return NoModRef;
|
||||
break;
|
||||
if (TD) {
|
||||
if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(CS.getInstruction())) {
|
||||
switch (II->getIntrinsicID()) {
|
||||
default: break;
|
||||
case Intrinsic::atomic_cmp_swap:
|
||||
case Intrinsic::atomic_swap:
|
||||
case Intrinsic::atomic_load_add:
|
||||
case Intrinsic::atomic_load_sub:
|
||||
case Intrinsic::atomic_load_and:
|
||||
case Intrinsic::atomic_load_nand:
|
||||
case Intrinsic::atomic_load_or:
|
||||
case Intrinsic::atomic_load_xor:
|
||||
case Intrinsic::atomic_load_max:
|
||||
case Intrinsic::atomic_load_min:
|
||||
case Intrinsic::atomic_load_umax:
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user