]> granicus.if.org Git - clang/commitdiff
[CodeGen] Fix propagation of TBAA info for atomic accesses
authorIvan A. Kosarev <ikosarev@accesssoftek.com>
Tue, 3 Oct 2017 11:31:42 +0000 (11:31 +0000)
committerIvan A. Kosarev <ikosarev@accesssoftek.com>
Tue, 3 Oct 2017 11:31:42 +0000 (11:31 +0000)
This patch fixes clang to propagate complete TBAA information for
atomic accesses and not just the final access types. Prepared
against D38456 and requires it to be committed first.

This is part of D37826 reworked to be a separate patch to
simplify review.

Differential Revision: https://reviews.llvm.org/D38460

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314784 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGAtomic.cpp

index 73d76e35fd596e37d44964bd52800b1a2f94f806..c03e06d571e0e8a8640043827f787f4f50404126 100644 (file)
@@ -98,7 +98,7 @@ namespace {
         LVal = LValue::MakeBitfield(Address(Addr, lvalue.getAlignment()),
                                     BFI, lvalue.getType(),
                                     lvalue.getBaseInfo());
-        LVal.setTBAAAccessType(lvalue.getTBAAAccessType());
+        LVal.setTBAAInfo(lvalue.getTBAAInfo());
         AtomicTy = C.getIntTypeForBitwidth(AtomicSizeInBits, OrigBFI.IsSigned);
         if (AtomicTy.isNull()) {
           llvm::APInt Size(
@@ -1692,8 +1692,8 @@ EmitAtomicUpdateValue(CodeGenFunction &CGF, AtomicInfo &Atomics, RValue OldRVal,
           DesiredAddr, AtomicLVal.getExtVectorElts(), AtomicLVal.getType(),
           AtomicLVal.getBaseInfo());
     }
-    UpdateLVal.setTBAAAccessType(AtomicLVal.getTBAAAccessType());
-    DesiredLVal.setTBAAAccessType(AtomicLVal.getTBAAAccessType());
+    UpdateLVal.setTBAAInfo(AtomicLVal.getTBAAInfo());
+    DesiredLVal.setTBAAInfo(AtomicLVal.getTBAAInfo());
     UpRVal = CGF.EmitLoadOfLValue(UpdateLVal, SourceLocation());
   }
   // Store new value in the corresponding memory area
@@ -1789,7 +1789,7 @@ static void EmitAtomicUpdateValue(CodeGenFunction &CGF, AtomicInfo &Atomics,
         DesiredAddr, AtomicLVal.getExtVectorElts(), AtomicLVal.getType(),
         AtomicLVal.getBaseInfo());
   }
-  DesiredLVal.setTBAAAccessType(AtomicLVal.getTBAAAccessType());
+  DesiredLVal.setTBAAInfo(AtomicLVal.getTBAAInfo());
   // Store new value in the corresponding memory area
   assert(UpdateRVal.isScalar());
   CGF.EmitStoreThroughLValue(UpdateRVal, DesiredLVal);