AA metadata refactoring (introduce AAMDNodes)
[oota-llvm.git] / lib / Transforms / IPO / ArgumentPromotion.cpp
index 097a351e30b175f1756a8c286be90ef92f2e75e6..f66a4735f46b86008511e8bd751f1bee6ed66c73 100644 (file)
@@ -720,9 +720,11 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
           // of the previous load.
           LoadInst *newLoad = new LoadInst(V, V->getName()+".val", Call);
           newLoad->setAlignment(OrigLoad->getAlignment());
-          // Transfer the TBAA info too.
-          newLoad->setMetadata(LLVMContext::MD_tbaa,
-                               OrigLoad->getMetadata(LLVMContext::MD_tbaa));
+          // Transfer the AA info too.
+          AAMDNodes AAInfo;
+          OrigLoad->getAAMetadata(AAInfo);
+          newLoad->setAAMetadata(AAInfo);
+
           Args.push_back(newLoad);
           AA.copyValue(OrigLoad, Args.back());
         }