Author: kosarev
Date: Tue Oct  3 04:31:42 2017
New Revision: 314784

URL: http://llvm.org/viewvc/llvm-project?rev=314784&view=rev
Log:
[CodeGen] Fix propagation of TBAA info for atomic accesses

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

Modified:
    cfe/trunk/lib/CodeGen/CGAtomic.cpp

Modified: cfe/trunk/lib/CodeGen/CGAtomic.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGAtomic.cpp?rev=314784&r1=314783&r2=314784&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGAtomic.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGAtomic.cpp Tue Oct  3 04:31:42 2017
@@ -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 &C
           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(CodeGe
         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);


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to