when merging two alias sets together, be sure to propagate the volatility of
authorChris Lattner <sabre@nondot.org>
Wed, 23 May 2007 06:36:35 +0000 (06:36 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 23 May 2007 06:36:35 +0000 (06:36 +0000)
the inner set.  This fixes PR1435 and Transforms/LICM/2007-05-22-VolatileSink.ll

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

lib/Analysis/AliasSetTracker.cpp

index 7f976200086eee14e89c7b454b8ad2397da8eaec..0397af7e979fce11be064f15f8cb82d6bc21f05a 100644 (file)
@@ -351,9 +351,11 @@ void AliasSetTracker::add(const AliasSetTracker &AST) {
       // Loop over all of the pointers in this alias set...
       AliasSet::iterator I = AS.begin(), E = AS.end();
       bool X;
-      for (; I != E; ++I)
-        addPointer(I.getPointer(), I.getSize(),
-                   (AliasSet::AccessType)AS.AccessTy, X);
+      for (; I != E; ++I) {
+        AliasSet &NewAS = addPointer(I.getPointer(), I.getSize(),
+                                     (AliasSet::AccessType)AS.AccessTy, X);
+        if (AS.isVolatile()) NewAS.setVolatile();
+      }
     }
 }