From 9f9488ba33a0118cb0f45b9913bf298823778fb0 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 6 Jul 2016 00:26:41 +0000 Subject: [PATCH] [CFLAA] Split into Anders+Steens analysis. StratifiedSets (as implemented) is very fast, but its accuracy is also limited. If we take a more aggressive andersens-like approach, we can be way more accurate, but we'll also end up being slower. So, we've decided to split CFLAA into CFLSteensAA and CFLAndersAA. Long-term, we want to end up in a place where CFLSteens is queried first; if it can provide an answer, great (since queries are basically map lookups). Otherwise, we'll fall back to CFLAnders, BasicAA, etc. This patch splits everything out so we can try to do something like that when we get a reasonable CFLAnders implementation. Patch by Jia Chen. Differential Revision: http://reviews.llvm.org/D21910 llvm-svn: 274589 --- .../llvm/Analysis/CFLAndersAliasAnalysis.h | 74 ++++++++++++ ...iasAnalysis.h => CFLSteensAliasAnalysis.h} | 54 ++++----- include/llvm/InitializePasses.h | 3 +- include/llvm/LinkAllPasses.h | 6 +- lib/Analysis/AliasAnalysis.cpp | 20 +++- lib/Analysis/Analysis.cpp | 3 +- lib/Analysis/CFLAndersAliasAnalysis.cpp | 58 ++++++++++ ...nalysis.cpp => CFLSteensAliasAnalysis.cpp} | 106 +++++++++--------- lib/Analysis/CMakeLists.txt | 3 +- lib/CodeGen/TargetPassConfig.cpp | 36 +++++- lib/Passes/PassBuilder.cpp | 6 +- lib/Passes/PassRegistry.def | 5 +- lib/Transforms/IPO/PassManagerBuilder.cpp | 36 +++++- .../{ => Steensgaard}/arguments-globals.ll | 2 +- .../{ => Steensgaard}/arguments.ll | 2 +- .../{ => Steensgaard}/asm-global-bugfix.ll | 2 +- .../{ => Steensgaard}/attr-escape.ll | 4 +- .../{ => Steensgaard}/basic-interproc.ll | 4 +- .../{ => Steensgaard}/branch-alias.ll | 2 +- .../{ => Steensgaard}/const-expr-gep.ll | 8 +- .../{ => Steensgaard}/constant-over-index.ll | 2 +- .../{ => Steensgaard}/empty.ll | 2 +- .../full-store-partial-alias.ll | 8 +- .../{ => Steensgaard}/gep-index-no-alias.ll | 4 +- .../gep-signed-arithmetic.ll | 4 +- .../interproc-arg-deref-escape.ll | 4 +- .../{ => Steensgaard}/interproc-arg-escape.ll | 4 +- .../{ => Steensgaard}/interproc-ret-arg.ll | 4 +- .../interproc-ret-deref-arg-multilevel.ll | 4 +- .../interproc-ret-deref-arg.ll | 4 +- .../{ => Steensgaard}/interproc-ret-escape.ll | 4 +- .../interproc-ret-ref-arg-multilevel.ll | 4 +- .../interproc-ret-ref-arg.ll | 4 +- .../interproc-ret-unknown.ll | 4 +- .../interproc-store-arg-multilevel.ll | 4 +- .../interproc-store-arg-unknown.ll | 4 +- .../{ => Steensgaard}/interproc-store-arg.ll | 4 +- .../{ => Steensgaard}/malloc-and-free.ll | 4 +- .../{ => Steensgaard}/multilevel-combine.ll | 2 +- .../{ => Steensgaard}/multilevel.ll | 2 +- .../{ => Steensgaard}/must-and-partial.ll | 6 +- .../{ => Steensgaard}/opaque-call-alias.ll | 2 +- .../{ => Steensgaard}/phi-and-select.ll | 2 +- .../{ => Steensgaard}/pr27213.ll | 4 +- .../{ => Steensgaard}/simple.ll | 4 +- .../stratified-attrs-indexing.ll | 4 +- .../CFLAliasAnalysis/{ => Steensgaard}/va.ll | 2 +- 47 files changed, 368 insertions(+), 166 deletions(-) create mode 100644 include/llvm/Analysis/CFLAndersAliasAnalysis.h rename include/llvm/Analysis/{CFLAliasAnalysis.h => CFLSteensAliasAnalysis.h} (71%) create mode 100644 lib/Analysis/CFLAndersAliasAnalysis.cpp rename lib/Analysis/{CFLAliasAnalysis.cpp => CFLSteensAliasAnalysis.cpp} (91%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/arguments-globals.ll (83%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/arguments.ll (78%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/asm-global-bugfix.ll (82%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/attr-escape.ll (92%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/basic-interproc.ll (68%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/branch-alias.ll (95%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/const-expr-gep.ll (81%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/constant-over-index.ll (90%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/empty.ll (75%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/full-store-partial-alias.ll (81%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/gep-index-no-alias.ll (62%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/gep-signed-arithmetic.ll (69%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/interproc-arg-deref-escape.ll (78%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/interproc-arg-escape.ll (76%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/interproc-ret-arg.ll (70%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/interproc-ret-deref-arg-multilevel.ll (85%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/interproc-ret-deref-arg.ll (75%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/interproc-ret-escape.ll (78%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/interproc-ret-ref-arg-multilevel.ll (86%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/interproc-ret-ref-arg.ll (79%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/interproc-ret-unknown.ll (79%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/interproc-store-arg-multilevel.ll (85%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/interproc-store-arg-unknown.ll (76%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/interproc-store-arg.ll (79%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/malloc-and-free.ll (74%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/multilevel-combine.ll (85%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/multilevel.ll (86%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/must-and-partial.ll (85%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/opaque-call-alias.ll (83%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/phi-and-select.ll (87%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/pr27213.ll (79%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/simple.ll (71%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/stratified-attrs-indexing.ll (88%) rename test/Analysis/CFLAliasAnalysis/{ => Steensgaard}/va.ll (86%) diff --git a/include/llvm/Analysis/CFLAndersAliasAnalysis.h b/include/llvm/Analysis/CFLAndersAliasAnalysis.h new file mode 100644 index 00000000000..2a056c590d2 --- /dev/null +++ b/include/llvm/Analysis/CFLAndersAliasAnalysis.h @@ -0,0 +1,74 @@ +//=- CFLAndersAliasAnalysis.h - Unification-based Alias Analysis ---*- C++-*-=// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// \file +/// This is the interface for LLVM's inclusion-based alias analysis +/// implemented with CFL graph reachability. +/// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ANALYSIS_CFLANDERSALIASANALYSIS_H +#define LLVM_ANALYSIS_CFLANDERSALIASANALYSIS_H + +#include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/IR/Function.h" +#include "llvm/Pass.h" + +namespace llvm { + +class CFLAndersAAResult : public AAResultBase { + friend AAResultBase; + +public: + explicit CFLAndersAAResult(); + + AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB) { + // Dummy implementation + return AAResultBase::alias(LocA, LocB); + } +}; + +/// Analysis pass providing a never-invalidated alias analysis result. +/// +/// FIXME: We really should refactor CFL to use the analysis more heavily, and +/// in particular to leverage invalidation to trigger re-computation. +class CFLAndersAA : public AnalysisInfoMixin { + friend AnalysisInfoMixin; + static char PassID; + +public: + typedef CFLAndersAAResult Result; + + CFLAndersAAResult run(Function &F, AnalysisManager &AM); +}; + +/// Legacy wrapper pass to provide the CFLAndersAAResult object. +class CFLAndersAAWrapperPass : public ImmutablePass { + std::unique_ptr Result; + +public: + static char ID; + + CFLAndersAAWrapperPass(); + + CFLAndersAAResult &getResult() { return *Result; } + const CFLAndersAAResult &getResult() const { return *Result; } + + void initializePass() override; + void getAnalysisUsage(AnalysisUsage &AU) const override; +}; + +//===--------------------------------------------------------------------===// +// +// createCFLAndersAAWrapperPass - This pass implements a set-based approach to +// alias analysis. +// +ImmutablePass *createCFLAndersAAWrapperPass(); +} + +#endif diff --git a/include/llvm/Analysis/CFLAliasAnalysis.h b/include/llvm/Analysis/CFLSteensAliasAnalysis.h similarity index 71% rename from include/llvm/Analysis/CFLAliasAnalysis.h rename to include/llvm/Analysis/CFLSteensAliasAnalysis.h index 02cc8fbfe7f..c323c4bfb59 100644 --- a/include/llvm/Analysis/CFLAliasAnalysis.h +++ b/include/llvm/Analysis/CFLSteensAliasAnalysis.h @@ -1,4 +1,4 @@ -//===- CFLAliasAnalysis.h - CFL-Based Alias Analysis Interface ---*- C++ -*-==// +//=- CFLSteensAliasAnalysis.h - Unification-based Alias Analysis ---*- C++-*-=// // // The LLVM Compiler Infrastructure // @@ -7,12 +7,13 @@ // //===----------------------------------------------------------------------===// /// \file -/// This is the interface for LLVM's primary stateless and local alias analysis. +/// This is the interface for LLVM's unification-based alias analysis +/// implemented with CFL graph reachability. /// //===----------------------------------------------------------------------===// -#ifndef LLVM_ANALYSIS_CFLALIASANALYSIS_H -#define LLVM_ANALYSIS_CFLALIASANALYSIS_H +#ifndef LLVM_ANALYSIS_CFLSTEENSALIASANALYSIS_H +#define LLVM_ANALYSIS_CFLSTEENSALIASANALYSIS_H #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/None.h" @@ -28,14 +29,14 @@ namespace llvm { class TargetLibraryInfo; -class CFLAAResult : public AAResultBase { - friend AAResultBase; +class CFLSteensAAResult : public AAResultBase { + friend AAResultBase; class FunctionInfo; public: - explicit CFLAAResult(const TargetLibraryInfo &); - CFLAAResult(CFLAAResult &&Arg); - ~CFLAAResult(); + explicit CFLSteensAAResult(const TargetLibraryInfo &); + CFLSteensAAResult(CFLSteensAAResult &&Arg); + ~CFLSteensAAResult(); /// Handle invalidation events from the new pass manager. /// @@ -59,10 +60,9 @@ public: // Comparisons between global variables and other constants should be // handled by BasicAA. - // TODO: ConstantExpr handling -- CFLAA may report NoAlias when comparing - // a GlobalValue and ConstantExpr, but every query needs to have at least - // one Value tied to a Function, and neither GlobalValues nor ConstantExprs - // are. + // CFLSteensAA may report NoAlias when comparing a GlobalValue and + // ConstantExpr, but every query needs to have at least one Value tied to a + // Function, and neither GlobalValues nor ConstantExprs are. if (isa(LocA.Ptr) && isa(LocB.Ptr)) return AAResultBase::alias(LocA, LocB); @@ -85,7 +85,7 @@ public: private: struct FunctionHandle final : public CallbackVH { - FunctionHandle(Function *Fn, CFLAAResult *Result) + FunctionHandle(Function *Fn, CFLSteensAAResult *Result) : CallbackVH(Fn), Result(Result) { assert(Fn != nullptr); assert(Result != nullptr); @@ -95,7 +95,7 @@ private: void allUsesReplacedWith(Value *) override { removeSelfFromCache(); } private: - CFLAAResult *Result; + CFLSteensAAResult *Result; void removeSelfFromCache() { assert(Result != nullptr); @@ -122,27 +122,27 @@ private: /// /// FIXME: We really should refactor CFL to use the analysis more heavily, and /// in particular to leverage invalidation to trigger re-computation of sets. -class CFLAA : public AnalysisInfoMixin { - friend AnalysisInfoMixin; +class CFLSteensAA : public AnalysisInfoMixin { + friend AnalysisInfoMixin; static char PassID; public: - typedef CFLAAResult Result; + typedef CFLSteensAAResult Result; - CFLAAResult run(Function &F, AnalysisManager &AM); + CFLSteensAAResult run(Function &F, AnalysisManager &AM); }; -/// Legacy wrapper pass to provide the CFLAAResult object. -class CFLAAWrapperPass : public ImmutablePass { - std::unique_ptr Result; +/// Legacy wrapper pass to provide the CFLSteensAAResult object. +class CFLSteensAAWrapperPass : public ImmutablePass { + std::unique_ptr Result; public: static char ID; - CFLAAWrapperPass(); + CFLSteensAAWrapperPass(); - CFLAAResult &getResult() { return *Result; } - const CFLAAResult &getResult() const { return *Result; } + CFLSteensAAResult &getResult() { return *Result; } + const CFLSteensAAResult &getResult() const { return *Result; } void initializePass() override; void getAnalysisUsage(AnalysisUsage &AU) const override; @@ -150,10 +150,10 @@ public: //===--------------------------------------------------------------------===// // -// createCFLAAWrapperPass - This pass implements a set-based approach to +// createCFLSteensAAWrapperPass - This pass implements a set-based approach to // alias analysis. // -ImmutablePass *createCFLAAWrapperPass(); +ImmutablePass *createCFLSteensAAWrapperPass(); } #endif diff --git a/include/llvm/InitializePasses.h b/include/llvm/InitializePasses.h index c07b05e9c3c..67a74e012aa 100644 --- a/include/llvm/InitializePasses.h +++ b/include/llvm/InitializePasses.h @@ -82,7 +82,8 @@ void initializeCFGOnlyViewerPass(PassRegistry&); void initializeCFGPrinterPass(PassRegistry&); void initializeCFGSimplifyPassPass(PassRegistry&); void initializeCFGViewerPass(PassRegistry&); -void initializeCFLAAWrapperPassPass(PassRegistry&); +void initializeCFLAndersAAWrapperPassPass(PassRegistry&); +void initializeCFLSteensAAWrapperPassPass(PassRegistry&); void initializeCallGraphDOTPrinterPass(PassRegistry&); void initializeCallGraphPrinterLegacyPassPass(PassRegistry&); void initializeCallGraphViewerPass(PassRegistry&); diff --git a/include/llvm/LinkAllPasses.h b/include/llvm/LinkAllPasses.h index 9e1bb2c5d23..a12913e9999 100644 --- a/include/llvm/LinkAllPasses.h +++ b/include/llvm/LinkAllPasses.h @@ -19,7 +19,8 @@ #include "llvm/Analysis/AliasSetTracker.h" #include "llvm/Analysis/AliasAnalysisEvaluator.h" #include "llvm/Analysis/BasicAliasAnalysis.h" -#include "llvm/Analysis/CFLAliasAnalysis.h" +#include "llvm/Analysis/CFLAndersAliasAnalysis.h" +#include "llvm/Analysis/CFLSteensAliasAnalysis.h" #include "llvm/Analysis/CallPrinter.h" #include "llvm/Analysis/DomPrinter.h" #include "llvm/Analysis/GlobalsModRef.h" @@ -73,7 +74,8 @@ namespace { (void) llvm::createCallGraphDOTPrinterPass(); (void) llvm::createCallGraphViewerPass(); (void) llvm::createCFGSimplificationPass(); - (void) llvm::createCFLAAWrapperPass(); + (void) llvm::createCFLAndersAAWrapperPass(); + (void) llvm::createCFLSteensAAWrapperPass(); (void) llvm::createStructurizeCFGPass(); (void) llvm::createConstantMergePass(); (void) llvm::createConstantPropagationPass(); diff --git a/lib/Analysis/AliasAnalysis.cpp b/lib/Analysis/AliasAnalysis.cpp index a9d4610ed67..643e9da1db1 100644 --- a/lib/Analysis/AliasAnalysis.cpp +++ b/lib/Analysis/AliasAnalysis.cpp @@ -27,7 +27,8 @@ #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/BasicAliasAnalysis.h" #include "llvm/Analysis/CFG.h" -#include "llvm/Analysis/CFLAliasAnalysis.h" +#include "llvm/Analysis/CFLAndersAliasAnalysis.h" +#include "llvm/Analysis/CFLSteensAliasAnalysis.h" #include "llvm/Analysis/CaptureTracking.h" #include "llvm/Analysis/GlobalsModRef.h" #include "llvm/Analysis/ObjCARCAliasAnalysis.h" @@ -552,7 +553,8 @@ char AAResultsWrapperPass::ID = 0; INITIALIZE_PASS_BEGIN(AAResultsWrapperPass, "aa", "Function Alias Analysis Results", false, true) INITIALIZE_PASS_DEPENDENCY(BasicAAWrapperPass) -INITIALIZE_PASS_DEPENDENCY(CFLAAWrapperPass) +INITIALIZE_PASS_DEPENDENCY(CFLAndersAAWrapperPass) +INITIALIZE_PASS_DEPENDENCY(CFLSteensAAWrapperPass) INITIALIZE_PASS_DEPENDENCY(ExternalAAWrapperPass) INITIALIZE_PASS_DEPENDENCY(GlobalsAAWrapperPass) INITIALIZE_PASS_DEPENDENCY(ObjCARCAAWrapperPass) @@ -603,7 +605,9 @@ bool AAResultsWrapperPass::runOnFunction(Function &F) { AAR->addAAResult(WrapperPass->getResult()); if (auto *WrapperPass = getAnalysisIfAvailable()) AAR->addAAResult(WrapperPass->getResult()); - if (auto *WrapperPass = getAnalysisIfAvailable()) + if (auto *WrapperPass = getAnalysisIfAvailable()) + AAR->addAAResult(WrapperPass->getResult()); + if (auto *WrapperPass = getAnalysisIfAvailable()) AAR->addAAResult(WrapperPass->getResult()); // If available, run an external AA providing callback over the results as @@ -630,7 +634,8 @@ void AAResultsWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const { AU.addUsedIfAvailable(); AU.addUsedIfAvailable(); AU.addUsedIfAvailable(); - AU.addUsedIfAvailable(); + AU.addUsedIfAvailable(); + AU.addUsedIfAvailable(); } AAResults llvm::createLegacyPMAAResults(Pass &P, Function &F, @@ -652,7 +657,9 @@ AAResults llvm::createLegacyPMAAResults(Pass &P, Function &F, AAR.addAAResult(WrapperPass->getResult()); if (auto *WrapperPass = P.getAnalysisIfAvailable()) AAR.addAAResult(WrapperPass->getResult()); - if (auto *WrapperPass = P.getAnalysisIfAvailable()) + if (auto *WrapperPass = P.getAnalysisIfAvailable()) + AAR.addAAResult(WrapperPass->getResult()); + if (auto *WrapperPass = P.getAnalysisIfAvailable()) AAR.addAAResult(WrapperPass->getResult()); return AAR; @@ -695,5 +702,6 @@ void llvm::getAAResultsAnalysisUsage(AnalysisUsage &AU) { AU.addUsedIfAvailable(); AU.addUsedIfAvailable(); AU.addUsedIfAvailable(); - AU.addUsedIfAvailable(); + AU.addUsedIfAvailable(); + AU.addUsedIfAvailable(); } diff --git a/lib/Analysis/Analysis.cpp b/lib/Analysis/Analysis.cpp index aba3c7dbde2..099ac15245c 100644 --- a/lib/Analysis/Analysis.cpp +++ b/lib/Analysis/Analysis.cpp @@ -34,7 +34,8 @@ void llvm::initializeAnalysis(PassRegistry &Registry) { initializeCFGPrinterPass(Registry); initializeCFGOnlyViewerPass(Registry); initializeCFGOnlyPrinterPass(Registry); - initializeCFLAAWrapperPassPass(Registry); + initializeCFLAndersAAWrapperPassPass(Registry); + initializeCFLSteensAAWrapperPassPass(Registry); initializeDependenceAnalysisWrapperPassPass(Registry); initializeDelinearizationPass(Registry); initializeDemandedBitsWrapperPassPass(Registry); diff --git a/lib/Analysis/CFLAndersAliasAnalysis.cpp b/lib/Analysis/CFLAndersAliasAnalysis.cpp new file mode 100644 index 00000000000..8db2051d673 --- /dev/null +++ b/lib/Analysis/CFLAndersAliasAnalysis.cpp @@ -0,0 +1,58 @@ +//- CFLAndersAliasAnalysis.cpp - Unification-based Alias Analysis ---*- C++-*-// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements a CFL-based, summary-based alias analysis algorithm. It +// differs from CFLSteensAliasAnalysis in its inclusion-based nature while +// CFLSteensAliasAnalysis is unification-based. This pass has worse performance +// than CFLSteensAliasAnalysis (the worst case complexity of +// CFLAndersAliasAnalysis is cubic, while the worst case complexity of +// CFLSteensAliasAnalysis is almost linear), but it is able to yield more +// precise analysis result. The precision of this analysis is roughly the same +// as that of an one level context-sensitive Andersen's algorithm. +// +//===----------------------------------------------------------------------===// + +// N.B. AliasAnalysis as a whole is phrased as a FunctionPass at the moment, and +// CFLAndersAA is interprocedural. This is *technically* A Bad Thing, because +// FunctionPasses are only allowed to inspect the Function that they're being +// run on. Realistically, this likely isn't a problem until we allow +// FunctionPasses to run concurrently. + +#include "llvm/Analysis/CFLAndersAliasAnalysis.h" +#include "llvm/Pass.h" + +using namespace llvm; + +#define DEBUG_TYPE "cfl-anders-aa" + +CFLAndersAAResult::CFLAndersAAResult() = default; + +char CFLAndersAA::PassID; + +CFLAndersAAResult CFLAndersAA::run(Function &F, AnalysisManager &AM) { + return CFLAndersAAResult(); +} + +char CFLAndersAAWrapperPass::ID = 0; +INITIALIZE_PASS(CFLAndersAAWrapperPass, "cfl-anders-aa", + "Inclusion-Based CFL Alias Analysis", false, true) + +ImmutablePass *llvm::createCFLAndersAAWrapperPass() { + return new CFLAndersAAWrapperPass(); +} + +CFLAndersAAWrapperPass::CFLAndersAAWrapperPass() : ImmutablePass(ID) { + initializeCFLAndersAAWrapperPassPass(*PassRegistry::getPassRegistry()); +} + +void CFLAndersAAWrapperPass::initializePass() {} + +void CFLAndersAAWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const { + AU.setPreservesAll(); +} diff --git a/lib/Analysis/CFLAliasAnalysis.cpp b/lib/Analysis/CFLSteensAliasAnalysis.cpp similarity index 91% rename from lib/Analysis/CFLAliasAnalysis.cpp rename to lib/Analysis/CFLSteensAliasAnalysis.cpp index b480fc01340..7da2cf22f40 100644 --- a/lib/Analysis/CFLAliasAnalysis.cpp +++ b/lib/Analysis/CFLSteensAliasAnalysis.cpp @@ -1,4 +1,4 @@ -//===- CFLAliasAnalysis.cpp - CFL-Based Alias Analysis Implementation ------==// +//- CFLSteensAliasAnalysis.cpp - Unification-based Alias Analysis ---*- C++-*-// // // The LLVM Compiler Infrastructure // @@ -7,14 +7,16 @@ // //===----------------------------------------------------------------------===// // -// This file implements a CFL-based context-insensitive alias analysis -// algorithm. It does not depend on types. The algorithm is a mixture of the one -// described in "Demand-driven alias analysis for C" by Xin Zheng and Radu -// Rugina, and "Fast algorithms for Dyck-CFL-reachability with applications to -// Alias Analysis" by Zhang Q, Lyu M R, Yuan H, and Su Z. -- to summarize the -// papers, we build a graph of the uses of a variable, where each node is a -// memory location, and each edge is an action that happened on that memory -// location. The "actions" can be one of Dereference, Reference, or Assign. +// This file implements a CFL-base, summary-based alias analysis algorithm. It +// does not depend on types. The algorithm is a mixture of the one described in +// "Demand-driven alias analysis for C" by Xin Zheng and Radu Rugina, and "Fast +// algorithms for Dyck-CFL-reachability with applications to Alias Analysis" by +// Zhang Q, Lyu M R, Yuan H, and Su Z. -- to summarize the papers, we build a +// graph of the uses of a variable, where each node is a memory location, and +// each edge is an action that happened on that memory location. The "actions" +// can be one of Dereference, Reference, or Assign. The precision of this +// analysis is roughly the same as that of an one level context-sensitive +// Steensgaard's algorithm. // // Two variables are considered as aliasing iff you can reach one value's node // from the other value's node and the language formed by concatenating all of @@ -28,12 +30,12 @@ //===----------------------------------------------------------------------===// // N.B. AliasAnalysis as a whole is phrased as a FunctionPass at the moment, and -// CFLAA is interprocedural. This is *technically* A Bad Thing, because +// CFLSteensAA is interprocedural. This is *technically* A Bad Thing, because // FunctionPasses are only allowed to inspect the Function that they're being // run on. Realistically, this likely isn't a problem until we allow // FunctionPasses to run concurrently. -#include "llvm/Analysis/CFLAliasAnalysis.h" +#include "llvm/Analysis/CFLSteensAliasAnalysis.h" #include "StratifiedSets.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/None.h" @@ -56,13 +58,13 @@ using namespace llvm; -#define DEBUG_TYPE "cfl-aa" +#define DEBUG_TYPE "cfl-steens-aa" -CFLAAResult::CFLAAResult(const TargetLibraryInfo &TLI) +CFLSteensAAResult::CFLSteensAAResult(const TargetLibraryInfo &TLI) : AAResultBase(), TLI(TLI) {} -CFLAAResult::CFLAAResult(CFLAAResult &&Arg) +CFLSteensAAResult::CFLSteensAAResult(CFLSteensAAResult &&Arg) : AAResultBase(std::move(Arg)), TLI(Arg.TLI) {} -CFLAAResult::~CFLAAResult() {} +CFLSteensAAResult::~CFLSteensAAResult() {} /// We use InterfaceValue to describe parameters/return value, as well as /// potential memory locations that are pointed to by parameters/return value, @@ -98,7 +100,7 @@ struct ExternalAttribute { }; /// Information we have about a function and would like to keep around. -class CFLAAResult::FunctionInfo { +class CFLSteensAAResult::FunctionInfo { StratifiedSets Sets; // RetParamRelations is a collection of ExternalRelations. @@ -300,7 +302,7 @@ struct InterprocAttr { /// Gets the edges our graph should have, based on an Instruction* class GetEdgesVisitor : public InstVisitor { - CFLAAResult &AA; + CFLSteensAAResult &AA; const TargetLibraryInfo &TLI; CFLGraph &Graph; @@ -343,7 +345,7 @@ class GetEdgesVisitor : public InstVisitor { } public: - GetEdgesVisitor(CFLAAResult &AA, const TargetLibraryInfo &TLI, + GetEdgesVisitor(CFLSteensAAResult &AA, const TargetLibraryInfo &TLI, CFLGraph &Graph, SmallVectorImpl &ReturnValues, SmallPtrSetImpl &Externals, SmallPtrSetImpl &Escapes, @@ -603,7 +605,7 @@ public: class CFLGraphBuilder { // Input of the builder - CFLAAResult &Analysis; + CFLSteensAAResult &Analysis; const TargetLibraryInfo &TLI; // Output of the builder @@ -662,7 +664,7 @@ class CFLGraphBuilder { } public: - CFLGraphBuilder(CFLAAResult &Analysis, const TargetLibraryInfo &TLI, + CFLGraphBuilder(CFLSteensAAResult &Analysis, const TargetLibraryInfo &TLI, Function &Fn) : Analysis(Analysis), TLI(TLI) { buildGraphFrom(Fn); @@ -800,9 +802,9 @@ static bool canSkipAddingToSets(Value *Val) { return false; } -CFLAAResult::FunctionInfo::FunctionInfo(Function &Fn, - const SmallVectorImpl &RetVals, - StratifiedSets S) +CFLSteensAAResult::FunctionInfo::FunctionInfo( + Function &Fn, const SmallVectorImpl &RetVals, + StratifiedSets S) : Sets(std::move(S)) { // Historically, an arbitrary upper-bound of 50 args was selected. We may want // to remove this if it doesn't really matter in practice. @@ -868,7 +870,7 @@ CFLAAResult::FunctionInfo::FunctionInfo(Function &Fn, } // Builds the graph + StratifiedSets for a function. -CFLAAResult::FunctionInfo CFLAAResult::buildSetsFrom(Function *Fn) { +CFLSteensAAResult::FunctionInfo CFLSteensAAResult::buildSetsFrom(Function *Fn) { CFLGraphBuilder GraphBuilder(*this, TLI, *Fn); StratifiedSetsBuilder SetBuilder; @@ -951,7 +953,7 @@ CFLAAResult::FunctionInfo CFLAAResult::buildSetsFrom(Function *Fn) { return FunctionInfo(*Fn, GraphBuilder.getReturnValues(), SetBuilder.build()); } -void CFLAAResult::scan(Function *Fn) { +void CFLSteensAAResult::scan(Function *Fn) { auto InsertPair = Cache.insert(std::make_pair(Fn, Optional())); (void)InsertPair; assert(InsertPair.second && @@ -966,12 +968,12 @@ void CFLAAResult::scan(Function *Fn) { Handles.push_front(FunctionHandle(Fn, this)); } -void CFLAAResult::evict(Function *Fn) { Cache.erase(Fn); } +void CFLSteensAAResult::evict(Function *Fn) { Cache.erase(Fn); } /// Ensures that the given function is available in the cache, and returns the /// entry. -const Optional & -CFLAAResult::ensureCached(Function *Fn) { +const Optional & +CFLSteensAAResult::ensureCached(Function *Fn) { auto Iter = Cache.find(Fn); if (Iter == Cache.end()) { scan(Fn); @@ -982,8 +984,8 @@ CFLAAResult::ensureCached(Function *Fn) { return Iter->second; } -AliasResult CFLAAResult::query(const MemoryLocation &LocA, - const MemoryLocation &LocB) { +AliasResult CFLSteensAAResult::query(const MemoryLocation &LocA, + const MemoryLocation &LocB) { auto *ValA = const_cast(LocA.Ptr); auto *ValB = const_cast(LocB.Ptr); @@ -996,7 +998,8 @@ AliasResult CFLAAResult::query(const MemoryLocation &LocA, if (!MaybeFnA.hasValue() && !MaybeFnB.hasValue()) { // The only times this is known to happen are when globals + InlineAsm are // involved - DEBUG(dbgs() << "CFLAA: could not extract parent function information.\n"); + DEBUG(dbgs() + << "CFLSteensAA: could not extract parent function information.\n"); return MayAlias; } @@ -1027,8 +1030,8 @@ AliasResult CFLAAResult::query(const MemoryLocation &LocA, auto AttrsB = Sets.getLink(SetB.Index).Attrs; // If both values are local (meaning the corresponding set has attribute - // AttrNone or AttrEscaped), then we know that CFLAA fully models them: they - // may-alias each other if and only if they are in the same set + // AttrNone or AttrEscaped), then we know that CFLSteensAA fully models them: + // they may-alias each other if and only if they are in the same set. // If at least one value is non-local (meaning it either is global/argument or // it comes from unknown sources like integer cast), the situation becomes a // bit more interesting. We follow three general rules described below: @@ -1047,8 +1050,8 @@ AliasResult CFLAAResult::query(const MemoryLocation &LocA, return NoAlias; } -ModRefInfo CFLAAResult::getArgModRefInfo(ImmutableCallSite CS, - unsigned ArgIdx) { +ModRefInfo CFLSteensAAResult::getArgModRefInfo(ImmutableCallSite CS, + unsigned ArgIdx) { if (auto CalledFunc = CS.getCalledFunction()) { auto &MaybeInfo = ensureCached(const_cast(CalledFunc)); if (!MaybeInfo.hasValue()) @@ -1075,7 +1078,8 @@ ModRefInfo CFLAAResult::getArgModRefInfo(ImmutableCallSite CS, return MRI_ModRef; } -FunctionModRefBehavior CFLAAResult::getModRefBehavior(ImmutableCallSite CS) { +FunctionModRefBehavior +CFLSteensAAResult::getModRefBehavior(ImmutableCallSite CS) { // If we know the callee, try analyzing it if (auto CalledFunc = CS.getCalledFunction()) return getModRefBehavior(CalledFunc); @@ -1084,7 +1088,7 @@ FunctionModRefBehavior CFLAAResult::getModRefBehavior(ImmutableCallSite CS) { return FMRB_UnknownModRefBehavior; } -FunctionModRefBehavior CFLAAResult::getModRefBehavior(const Function *F) { +FunctionModRefBehavior CFLSteensAAResult::getModRefBehavior(const Function *F) { assert(F != nullptr); // TODO: Remove the const_cast @@ -1118,28 +1122,30 @@ FunctionModRefBehavior CFLAAResult::getModRefBehavior(const Function *F) { : FMRB_UnknownModRefBehavior; } -char CFLAA::PassID; +char CFLSteensAA::PassID; -CFLAAResult CFLAA::run(Function &F, AnalysisManager &AM) { - return CFLAAResult(AM.getResult(F)); +CFLSteensAAResult CFLSteensAA::run(Function &F, AnalysisManager &AM) { + return CFLSteensAAResult(AM.getResult(F)); } -char CFLAAWrapperPass::ID = 0; -INITIALIZE_PASS(CFLAAWrapperPass, "cfl-aa", "CFL-Based Alias Analysis", false, - true) +char CFLSteensAAWrapperPass::ID = 0; +INITIALIZE_PASS(CFLSteensAAWrapperPass, "cfl-steens-aa", + "Unification-Based CFL Alias Analysis", false, true) -ImmutablePass *llvm::createCFLAAWrapperPass() { return new CFLAAWrapperPass(); } - -CFLAAWrapperPass::CFLAAWrapperPass() : ImmutablePass(ID) { - initializeCFLAAWrapperPassPass(*PassRegistry::getPassRegistry()); +ImmutablePass *llvm::createCFLSteensAAWrapperPass() { + return new CFLSteensAAWrapperPass(); } -void CFLAAWrapperPass::initializePass() { +CFLSteensAAWrapperPass::CFLSteensAAWrapperPass() : ImmutablePass(ID) { + initializeCFLSteensAAWrapperPassPass(*PassRegistry::getPassRegistry()); +} + +void CFLSteensAAWrapperPass::initializePass() { auto &TLIWP = getAnalysis(); - Result.reset(new CFLAAResult(TLIWP.getTLI())); + Result.reset(new CFLSteensAAResult(TLIWP.getTLI())); } -void CFLAAWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const { +void CFLSteensAAWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired(); } diff --git a/lib/Analysis/CMakeLists.txt b/lib/Analysis/CMakeLists.txt index 56ab9a0b384..79b164cf646 100644 --- a/lib/Analysis/CMakeLists.txt +++ b/lib/Analysis/CMakeLists.txt @@ -10,7 +10,8 @@ add_llvm_library(LLVMAnalysis BranchProbabilityInfo.cpp CFG.cpp CFGPrinter.cpp - CFLAliasAnalysis.cpp + CFLAndersAliasAnalysis.cpp + CFLSteensAliasAnalysis.cpp CGSCCPassManager.cpp CallGraph.cpp CallGraphSCCPass.cpp diff --git a/lib/CodeGen/TargetPassConfig.cpp b/lib/CodeGen/TargetPassConfig.cpp index 1b30cc8ee54..332a8b7e323 100644 --- a/lib/CodeGen/TargetPassConfig.cpp +++ b/lib/CodeGen/TargetPassConfig.cpp @@ -15,7 +15,8 @@ #include "llvm/CodeGen/TargetPassConfig.h" #include "llvm/Analysis/BasicAliasAnalysis.h" -#include "llvm/Analysis/CFLAliasAnalysis.h" +#include "llvm/Analysis/CFLAndersAliasAnalysis.h" +#include "llvm/Analysis/CFLSteensAliasAnalysis.h" #include "llvm/Analysis/CallGraphSCCPass.h" #include "llvm/Analysis/Passes.h" #include "llvm/Analysis/ScopedNoAliasAA.h" @@ -110,9 +111,19 @@ cl::opt MISchedPostRA("misched-postra", cl::Hidden, static cl::opt EarlyLiveIntervals("early-live-intervals", cl::Hidden, cl::desc("Run live interval analysis earlier in the pipeline")); -static cl::opt UseCFLAA("use-cfl-aa-in-codegen", - cl::init(false), cl::Hidden, - cl::desc("Enable the new, experimental CFL alias analysis in CodeGen")); +// Experimental option to use CFL-AA in codegen +enum class CFLAAType { None, Steensgaard, Andersen, Both }; +static cl::opt UseCFLAA( + "use-cfl-aa-in-codegen", cl::init(CFLAAType::None), cl::Hidden, + cl::desc("Enable the new, experimental CFL alias analysis in CodeGen"), + cl::values(clEnumValN(CFLAAType::None, "none", "Disable CFL-AA"), + clEnumValN(CFLAAType::Steensgaard, "steens", + "Enable unification-based CFL-AA"), + clEnumValN(CFLAAType::Andersen, "anders", + "Enable inclusion-based CFL-AA"), + clEnumValN(CFLAAType::Both, "both", + "Enable both variants of CFL-AA"), + clEnumValEnd)); cl::opt UseIPRA("enable-ipra", cl::init(false), cl::Hidden, cl::desc("Enable interprocedural register allocation " @@ -414,12 +425,25 @@ void TargetPassConfig::addVerifyPass(const std::string &Banner) { /// Add common target configurable passes that perform LLVM IR to IR transforms /// following machine independent optimization. void TargetPassConfig::addIRPasses() { + switch (UseCFLAA) { + case CFLAAType::Steensgaard: + addPass(createCFLSteensAAWrapperPass()); + break; + case CFLAAType::Andersen: + addPass(createCFLAndersAAWrapperPass()); + break; + case CFLAAType::Both: + addPass(createCFLAndersAAWrapperPass()); + addPass(createCFLSteensAAWrapperPass()); + break; + default: + break; + } + // Basic AliasAnalysis support. // Add TypeBasedAliasAnalysis before BasicAliasAnalysis so that // BasicAliasAnalysis wins if they disagree. This is intended to help // support "obvious" type-punning idioms. - if (UseCFLAA) - addPass(createCFLAAWrapperPass()); addPass(createTypeBasedAAWrapperPass()); addPass(createScopedNoAliasAAWrapperPass()); addPass(createBasicAAWrapperPass()); diff --git a/lib/Passes/PassBuilder.cpp b/lib/Passes/PassBuilder.cpp index fe9e4cffcbd..5ebe98361d0 100644 --- a/lib/Passes/PassBuilder.cpp +++ b/lib/Passes/PassBuilder.cpp @@ -24,7 +24,8 @@ #include "llvm/Analysis/BlockFrequencyInfo.h" #include "llvm/Analysis/BlockFrequencyInfoImpl.h" #include "llvm/Analysis/BranchProbabilityInfo.h" -#include "llvm/Analysis/CFLAliasAnalysis.h" +#include "llvm/Analysis/CFLAndersAliasAnalysis.h" +#include "llvm/Analysis/CFLSteensAliasAnalysis.h" #include "llvm/Analysis/CGSCCPassManager.h" #include "llvm/Analysis/CallGraph.h" #include "llvm/Analysis/DemandedBits.h" @@ -692,7 +693,8 @@ bool PassBuilder::parsePassPipeline(ModulePassManager &MPM, DebugLogging) || !PipelineText.empty()) return false; - MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(std::move(CGPM), DebugLogging)); + MPM.addPass( + createModuleToPostOrderCGSCCPassAdaptor(std::move(CGPM), DebugLogging)); return true; } diff --git a/lib/Passes/PassRegistry.def b/lib/Passes/PassRegistry.def index b1c9d6d815e..9190844951b 100644 --- a/lib/Passes/PassRegistry.def +++ b/lib/Passes/PassRegistry.def @@ -27,7 +27,7 @@ MODULE_ANALYSIS("targetlibinfo", TargetLibraryAnalysis()) MODULE_ANALYSIS("verify", VerifierAnalysis()) #ifndef MODULE_ALIAS_ANALYSIS -#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \ +#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \ MODULE_ANALYSIS(NAME, CREATE_PASS) #endif MODULE_ALIAS_ANALYSIS("globals-aa", GlobalsAA()) @@ -110,7 +110,8 @@ FUNCTION_ANALYSIS("verify", VerifierAnalysis()) FUNCTION_ANALYSIS(NAME, CREATE_PASS) #endif FUNCTION_ALIAS_ANALYSIS("basic-aa", BasicAA()) -FUNCTION_ALIAS_ANALYSIS("cfl-aa", CFLAA()) +FUNCTION_ALIAS_ANALYSIS("cfl-anders-aa", CFLAndersAA()) +FUNCTION_ALIAS_ANALYSIS("cfl-steens-aa", CFLSteensAA()) FUNCTION_ALIAS_ANALYSIS("scev-aa", SCEVAA()) FUNCTION_ALIAS_ANALYSIS("scoped-noalias-aa", ScopedNoAliasAA()) FUNCTION_ALIAS_ANALYSIS("type-based-aa", TypeBasedAA()) diff --git a/lib/Transforms/IPO/PassManagerBuilder.cpp b/lib/Transforms/IPO/PassManagerBuilder.cpp index 2a209b34ccf..e283d26f5c1 100644 --- a/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -16,7 +16,8 @@ #include "llvm-c/Transforms/PassManagerBuilder.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/BasicAliasAnalysis.h" -#include "llvm/Analysis/CFLAliasAnalysis.h" +#include "llvm/Analysis/CFLAndersAliasAnalysis.h" +#include "llvm/Analysis/CFLSteensAliasAnalysis.h" #include "llvm/Analysis/GlobalsModRef.h" #include "llvm/Analysis/Passes.h" #include "llvm/Analysis/ScopedNoAliasAA.h" @@ -79,9 +80,19 @@ RunSLPAfterLoopVectorization("run-slp-after-loop-vectorization", cl::desc("Run the SLP vectorizer (and BB vectorizer) after the Loop " "vectorizer instead of before")); -static cl::opt UseCFLAA("use-cfl-aa", - cl::init(false), cl::Hidden, - cl::desc("Enable the new, experimental CFL alias analysis")); +// Experimental option to use CFL-AA +enum class CFLAAType { None, Steensgaard, Andersen, Both }; +static cl::opt + UseCFLAA("use-cfl-aa", cl::init(CFLAAType::None), cl::Hidden, + cl::desc("Enable the new, experimental CFL alias analysis"), + cl::values(clEnumValN(CFLAAType::None, "none", "Disable CFL-AA"), + clEnumValN(CFLAAType::Steensgaard, "steens", + "Enable unification-based CFL-AA"), + clEnumValN(CFLAAType::Andersen, "anders", + "Enable inclusion-based CFL-AA"), + clEnumValN(CFLAAType::Both, "both", + "Enable both variants of CFL-aa"), + clEnumValEnd)); static cl::opt EnableMLSM("mlsm", cl::init(true), cl::Hidden, @@ -169,11 +180,24 @@ void PassManagerBuilder::addExtensionsToPM(ExtensionPointTy ETy, void PassManagerBuilder::addInitialAliasAnalysisPasses( legacy::PassManagerBase &PM) const { + switch (UseCFLAA) { + case CFLAAType::Steensgaard: + PM.add(createCFLSteensAAWrapperPass()); + break; + case CFLAAType::Andersen: + PM.add(createCFLAndersAAWrapperPass()); + break; + case CFLAAType::Both: + PM.add(createCFLSteensAAWrapperPass()); + PM.add(createCFLAndersAAWrapperPass()); + break; + default: + break; + } + // Add TypeBasedAliasAnalysis before BasicAliasAnalysis so that // BasicAliasAnalysis wins if they disagree. This is intended to help // support "obvious" type-punning idioms. - if (UseCFLAA) - PM.add(createCFLAAWrapperPass()); PM.add(createTypeBasedAAWrapperPass()); PM.add(createScopedNoAliasAAWrapperPass()); } diff --git a/test/Analysis/CFLAliasAnalysis/arguments-globals.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/arguments-globals.ll similarity index 83% rename from test/Analysis/CFLAliasAnalysis/arguments-globals.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/arguments-globals.ll index 4844577d6fe..aa3cada3bec 100644 --- a/test/Analysis/CFLAliasAnalysis/arguments-globals.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/arguments-globals.ll @@ -3,7 +3,7 @@ ; (Everything should alias everything, because args can alias globals, so the ; aliasing sets should of args+alloca+global should be combined) -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s ; CHECK: Function: test diff --git a/test/Analysis/CFLAliasAnalysis/arguments.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/arguments.ll similarity index 78% rename from test/Analysis/CFLAliasAnalysis/arguments.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/arguments.ll index f3e6679c35e..85f3bc64e0d 100644 --- a/test/Analysis/CFLAliasAnalysis/arguments.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/arguments.ll @@ -1,7 +1,7 @@ ; This testcase ensures that CFL AA gives conservative answers on variables ; that involve arguments. -; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -cfl-steens-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s ; CHECK: Function: test diff --git a/test/Analysis/CFLAliasAnalysis/asm-global-bugfix.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/asm-global-bugfix.ll similarity index 82% rename from test/Analysis/CFLAliasAnalysis/asm-global-bugfix.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/asm-global-bugfix.ll index ec2de54e3ee..341aafdab86 100644 --- a/test/Analysis/CFLAliasAnalysis/asm-global-bugfix.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/asm-global-bugfix.ll @@ -2,7 +2,7 @@ ; whether two values that didn't belong to a function (i.e. two globals, etc) ; aliased. -; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -cfl-steens-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s @G = private unnamed_addr constant [1 x i8] c"\00", align 1 diff --git a/test/Analysis/CFLAliasAnalysis/attr-escape.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/attr-escape.ll similarity index 92% rename from test/Analysis/CFLAliasAnalysis/attr-escape.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/attr-escape.ll index 068085e73d4..3adce6a923b 100644 --- a/test/Analysis/CFLAliasAnalysis/attr-escape.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/attr-escape.ll @@ -1,7 +1,7 @@ ; This testcase ensures that CFL AA handles escaped values no more conservative than it should -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s ; CHECK-LABEL: Function: test_local ; CHECK: NoAlias: i32* %a, i32* %b diff --git a/test/Analysis/CFLAliasAnalysis/basic-interproc.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/basic-interproc.ll similarity index 68% rename from test/Analysis/CFLAliasAnalysis/basic-interproc.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/basic-interproc.ll index 2f3206f31ac..8a1d62ebd24 100644 --- a/test/Analysis/CFLAliasAnalysis/basic-interproc.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/basic-interproc.ll @@ -1,8 +1,8 @@ ; This testcase ensures that CFL AA won't be too conservative when trying to do ; interprocedural analysis on simple callee -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s ; CHECK-LABEL: Function: noop_callee ; CHECK: MayAlias: i32* %arg1, i32* %arg2 diff --git a/test/Analysis/CFLAliasAnalysis/branch-alias.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/branch-alias.ll similarity index 95% rename from test/Analysis/CFLAliasAnalysis/branch-alias.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/branch-alias.ll index dbbf035f344..4158d4a6464 100644 --- a/test/Analysis/CFLAliasAnalysis/branch-alias.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/branch-alias.ll @@ -13,7 +13,7 @@ ; int* ShouldAliasA = *AliasA1; ; } -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s ; CHECK: Function: ptr_test define void @ptr_test() #0 { diff --git a/test/Analysis/CFLAliasAnalysis/const-expr-gep.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/const-expr-gep.ll similarity index 81% rename from test/Analysis/CFLAliasAnalysis/const-expr-gep.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/const-expr-gep.ll index 11b60dd33b5..c35f6a03cdb 100644 --- a/test/Analysis/CFLAliasAnalysis/const-expr-gep.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/const-expr-gep.ll @@ -1,8 +1,8 @@ ; This testcase consists of alias relations which should be completely -; resolvable by cfl-aa, but require analysis of getelementptr constant exprs. +; resolvable by cfl-steens-aa, but require analysis of getelementptr constant exprs. ; Derived from BasicAA/2003-12-11-ConstExprGEP.ll -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s %T = type { i32, [10 x i8] } @@ -10,7 +10,7 @@ @G2 = external global %T ; TODO: Quite a few of these are MayAlias because we don't yet consider -; constant offsets in CFLAA. If we start doing so, then we'll need to +; constant offsets in CFLSteensAA. If we start doing so, then we'll need to ; change these test cases ; CHECK: Function: test @@ -36,7 +36,7 @@ define void @simplecheck(i32* %arg0) { ret void } -; Ensure that CFLAA properly identifies and handles escaping variables (i.e. +; Ensure that CFLSteensAA properly identifies and handles escaping variables (i.e. ; globals) in nested ConstantExprs ; CHECK: Function: checkNesting diff --git a/test/Analysis/CFLAliasAnalysis/constant-over-index.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/constant-over-index.ll similarity index 90% rename from test/Analysis/CFLAliasAnalysis/constant-over-index.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/constant-over-index.ll index a8e00aaed37..09e62fcd85a 100644 --- a/test/Analysis/CFLAliasAnalysis/constant-over-index.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/constant-over-index.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -cfl-aa -aa-eval -print-all-alias-modref-info 2>&1 | FileCheck %s +; RUN: opt < %s -cfl-steens-aa -aa-eval -print-all-alias-modref-info 2>&1 | FileCheck %s ; CFL AA currently returns PartialAlias, BasicAA returns MayAlias, both seem ; acceptable (although we might decide that we don't want PartialAlias, and if diff --git a/test/Analysis/CFLAliasAnalysis/empty.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/empty.ll similarity index 75% rename from test/Analysis/CFLAliasAnalysis/empty.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/empty.ll index 907fa481d86..f8714de2c2f 100644 --- a/test/Analysis/CFLAliasAnalysis/empty.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/empty.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" diff --git a/test/Analysis/CFLAliasAnalysis/full-store-partial-alias.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/full-store-partial-alias.ll similarity index 81% rename from test/Analysis/CFLAliasAnalysis/full-store-partial-alias.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/full-store-partial-alias.ll index 3503e16898c..39ea845f2a3 100644 --- a/test/Analysis/CFLAliasAnalysis/full-store-partial-alias.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/full-store-partial-alias.ll @@ -1,10 +1,10 @@ -; RUN: opt -S -disable-basicaa -tbaa -cfl-aa -gvn < %s | FileCheck -check-prefix=CFLAA %s +; RUN: opt -S -disable-basicaa -tbaa -cfl-steens-aa -gvn < %s | FileCheck -check-prefix=CFLSteensAA %s ; RUN: opt -S -disable-basicaa -tbaa -gvn < %s | FileCheck %s ; Adapted from the BasicAA full-store-partial-alias.ll test. ; CFL AA could notice that the store stores to the entire %u object, ; so the %tmp5 load is PartialAlias with the store and suppress TBAA. -; FIXME: However, right now, CFLAA cannot prove PartialAlias here +; FIXME: However, right now, CFLSteensAA cannot prove PartialAlias here ; Without CFL AA, TBAA should say that %tmp5 is NoAlias with the store. target datalayout = "e-p:64:64:64" @@ -15,8 +15,8 @@ target datalayout = "e-p:64:64:64" @endianness_test = global i64 1, align 8 define i32 @signbit(double %x) nounwind { -; FIXME: This would be ret i32 %tmp5.lobit if CFLAA could prove PartialAlias -; CFLAA: ret i32 0 +; FIXME: This would be ret i32 %tmp5.lobit if CFLSteensAA could prove PartialAlias +; CFLSteensAA: ret i32 0 ; CHECK: ret i32 0 entry: %u = alloca %union.anon, align 8 diff --git a/test/Analysis/CFLAliasAnalysis/gep-index-no-alias.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/gep-index-no-alias.ll similarity index 62% rename from test/Analysis/CFLAliasAnalysis/gep-index-no-alias.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/gep-index-no-alias.ll index 20664d08096..906b71c5aab 100644 --- a/test/Analysis/CFLAliasAnalysis/gep-index-no-alias.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/gep-index-no-alias.ll @@ -1,7 +1,7 @@ ; This testcase ensures that gep result does not alias gep indices -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-no-aliases -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-no-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-no-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-no-aliases -disable-output 2>&1 | FileCheck %s ; CHECK: Function: foo ; CHECK: [2 x i32]* %a, [2 x i32]* %b diff --git a/test/Analysis/CFLAliasAnalysis/gep-signed-arithmetic.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/gep-signed-arithmetic.ll similarity index 69% rename from test/Analysis/CFLAliasAnalysis/gep-signed-arithmetic.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/gep-signed-arithmetic.ll index 1edbb9fff56..34095cedf73 100644 --- a/test/Analysis/CFLAliasAnalysis/gep-signed-arithmetic.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/gep-signed-arithmetic.ll @@ -1,9 +1,9 @@ -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s ; Derived from BasicAA/2010-09-15-GEP-SignedArithmetic.ll target datalayout = "e-p:32:32:32" -; FIXME: This could be PartialAlias but CFLAA can't currently prove it +; FIXME: This could be PartialAlias but CFLSteensAA can't currently prove it ; CHECK: 1 may alias response define i32 @test(i32 %indvar) nounwind { diff --git a/test/Analysis/CFLAliasAnalysis/interproc-arg-deref-escape.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-arg-deref-escape.ll similarity index 78% rename from test/Analysis/CFLAliasAnalysis/interproc-arg-deref-escape.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-arg-deref-escape.ll index 8753e30e67c..8c92d281a80 100644 --- a/test/Analysis/CFLAliasAnalysis/interproc-arg-deref-escape.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-arg-deref-escape.ll @@ -1,8 +1,8 @@ ; This testcase ensures that CFL AA answers queries soundly when callee tries ; to escape the memory pointed to by its parameters -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s declare void @opaque(i32*) define void @escape_arg_deref(i32** %arg) { diff --git a/test/Analysis/CFLAliasAnalysis/interproc-arg-escape.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-arg-escape.ll similarity index 76% rename from test/Analysis/CFLAliasAnalysis/interproc-arg-escape.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-arg-escape.ll index 46683ffaed9..0dfcae79203 100644 --- a/test/Analysis/CFLAliasAnalysis/interproc-arg-escape.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-arg-escape.ll @@ -1,8 +1,8 @@ ; This testcase ensures that CFL AA answers queries soundly when callee tries ; to escape its parameters -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s declare void @opaque(i32*) define void @escape_arg(i32* %arg) { diff --git a/test/Analysis/CFLAliasAnalysis/interproc-ret-arg.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-arg.ll similarity index 70% rename from test/Analysis/CFLAliasAnalysis/interproc-ret-arg.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-arg.ll index af6d8c0c90a..e071e7e46c2 100644 --- a/test/Analysis/CFLAliasAnalysis/interproc-ret-arg.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-arg.ll @@ -1,8 +1,8 @@ ; This testcase ensures that CFL AA answers queries soundly when callee tries ; to return one of its parameters -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s define i32* @return_arg_callee(i32* %arg1, i32* %arg2) { ret i32* %arg1 diff --git a/test/Analysis/CFLAliasAnalysis/interproc-ret-deref-arg-multilevel.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-deref-arg-multilevel.ll similarity index 85% rename from test/Analysis/CFLAliasAnalysis/interproc-ret-deref-arg-multilevel.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-deref-arg-multilevel.ll index fe249cf63b6..3c7c6149982 100644 --- a/test/Analysis/CFLAliasAnalysis/interproc-ret-deref-arg-multilevel.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-deref-arg-multilevel.ll @@ -1,8 +1,8 @@ ; This testcase ensures that CFL AA answers queries soundly when callee tries ; to return the multi-level dereference of one of its parameters -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s define i32* @return_deref_arg_multilevel_callee(i32*** %arg1) { %deref = load i32**, i32*** %arg1 diff --git a/test/Analysis/CFLAliasAnalysis/interproc-ret-deref-arg.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-deref-arg.ll similarity index 75% rename from test/Analysis/CFLAliasAnalysis/interproc-ret-deref-arg.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-deref-arg.ll index e2c5c6079da..e1db5d34f34 100644 --- a/test/Analysis/CFLAliasAnalysis/interproc-ret-deref-arg.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-deref-arg.ll @@ -1,8 +1,8 @@ ; This testcase ensures that CFL AA answers queries soundly when callee tries ; to return the dereference of one of its parameters -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s define i32* @return_deref_arg_callee(i32** %arg1) { %deref = load i32*, i32** %arg1 diff --git a/test/Analysis/CFLAliasAnalysis/interproc-ret-escape.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-escape.ll similarity index 78% rename from test/Analysis/CFLAliasAnalysis/interproc-ret-escape.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-escape.ll index 82229dbfd48..5019e51d7b8 100644 --- a/test/Analysis/CFLAliasAnalysis/interproc-ret-escape.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-escape.ll @@ -1,8 +1,8 @@ ; This testcase ensures that CFL AA answers queries soundly when callee tries ; to return an escaped pointer -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s declare noalias i8* @malloc(i64) declare void @opaque(i32*) diff --git a/test/Analysis/CFLAliasAnalysis/interproc-ret-ref-arg-multilevel.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-ref-arg-multilevel.ll similarity index 86% rename from test/Analysis/CFLAliasAnalysis/interproc-ret-ref-arg-multilevel.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-ref-arg-multilevel.ll index 007be801895..e94cbbbdf30 100644 --- a/test/Analysis/CFLAliasAnalysis/interproc-ret-ref-arg-multilevel.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-ref-arg-multilevel.ll @@ -1,8 +1,8 @@ ; This testcase ensures that CFL AA answers queries soundly when callee tries ; to return the multi-level reference of one of its parameters -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s declare noalias i8* @malloc(i64) diff --git a/test/Analysis/CFLAliasAnalysis/interproc-ret-ref-arg.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-ref-arg.ll similarity index 79% rename from test/Analysis/CFLAliasAnalysis/interproc-ret-ref-arg.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-ref-arg.ll index f0879cf3320..aae642c424d 100644 --- a/test/Analysis/CFLAliasAnalysis/interproc-ret-ref-arg.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-ref-arg.ll @@ -1,8 +1,8 @@ ; This testcase ensures that CFL AA answers queries soundly when callee tries ; to return the reference of one of its parameters -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s declare noalias i8* @malloc(i64) diff --git a/test/Analysis/CFLAliasAnalysis/interproc-ret-unknown.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-unknown.ll similarity index 79% rename from test/Analysis/CFLAliasAnalysis/interproc-ret-unknown.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-unknown.ll index 3df53d3c5af..bc4a9bc901b 100644 --- a/test/Analysis/CFLAliasAnalysis/interproc-ret-unknown.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-ret-unknown.ll @@ -1,8 +1,8 @@ ; This testcase ensures that CFL AA answers queries soundly when callee tries ; to return an unknown pointer -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s @g = external global i32 define i32* @return_unknown_callee(i32* %arg1, i32* %arg2) { diff --git a/test/Analysis/CFLAliasAnalysis/interproc-store-arg-multilevel.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-store-arg-multilevel.ll similarity index 85% rename from test/Analysis/CFLAliasAnalysis/interproc-store-arg-multilevel.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-store-arg-multilevel.ll index c21869645dc..f5b61687ad7 100644 --- a/test/Analysis/CFLAliasAnalysis/interproc-store-arg-multilevel.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-store-arg-multilevel.ll @@ -1,8 +1,8 @@ ; This testcase ensures that CFL AA answers queries soundly when callee tries ; to mutate the memory pointed to by its parameters -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s declare noalias i8* @malloc(i64) diff --git a/test/Analysis/CFLAliasAnalysis/interproc-store-arg-unknown.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-store-arg-unknown.ll similarity index 76% rename from test/Analysis/CFLAliasAnalysis/interproc-store-arg-unknown.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-store-arg-unknown.ll index 84f340e34af..a90514c58fa 100644 --- a/test/Analysis/CFLAliasAnalysis/interproc-store-arg-unknown.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-store-arg-unknown.ll @@ -1,8 +1,8 @@ ; This testcase ensures that CFL AA answers queries soundly when callee tries ; to mutate the memory pointed to by its parameters -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s @g = external global i32 diff --git a/test/Analysis/CFLAliasAnalysis/interproc-store-arg.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-store-arg.ll similarity index 79% rename from test/Analysis/CFLAliasAnalysis/interproc-store-arg.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-store-arg.ll index e17cab75487..e520de4d0b1 100644 --- a/test/Analysis/CFLAliasAnalysis/interproc-store-arg.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/interproc-store-arg.ll @@ -1,8 +1,8 @@ ; This testcase ensures that CFL AA answers queries soundly when callee tries ; to mutate the memory pointed to by its parameters -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s define void @store_arg_callee(i32** %arg1, i32* %arg2) { store i32* %arg2, i32** %arg1 diff --git a/test/Analysis/CFLAliasAnalysis/malloc-and-free.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/malloc-and-free.ll similarity index 74% rename from test/Analysis/CFLAliasAnalysis/malloc-and-free.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/malloc-and-free.ll index 8b8ee4a5e4a..76c97db8038 100644 --- a/test/Analysis/CFLAliasAnalysis/malloc-and-free.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/malloc-and-free.ll @@ -1,7 +1,7 @@ ; This testcase ensures that CFL AA handles malloc and free in a sound and precise manner -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-no-aliases -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-no-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-no-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-no-aliases -disable-output 2>&1 | FileCheck %s declare noalias i8* @malloc(i64) declare noalias i8* @calloc(i64, i64) diff --git a/test/Analysis/CFLAliasAnalysis/multilevel-combine.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/multilevel-combine.ll similarity index 85% rename from test/Analysis/CFLAliasAnalysis/multilevel-combine.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/multilevel-combine.ll index be671bfc4ca..32abe9d8f74 100644 --- a/test/Analysis/CFLAliasAnalysis/multilevel-combine.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/multilevel-combine.ll @@ -8,7 +8,7 @@ ; } ; -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s %T = type { i32, [10 x i8] } diff --git a/test/Analysis/CFLAliasAnalysis/multilevel.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/multilevel.ll similarity index 86% rename from test/Analysis/CFLAliasAnalysis/multilevel.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/multilevel.ll index d42dca442ea..ea06b7430bc 100644 --- a/test/Analysis/CFLAliasAnalysis/multilevel.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/multilevel.ll @@ -6,7 +6,7 @@ ; *m; ; *n; -; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -cfl-steens-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s %T = type { i32, [10 x i8] } diff --git a/test/Analysis/CFLAliasAnalysis/must-and-partial.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/must-and-partial.ll similarity index 85% rename from test/Analysis/CFLAliasAnalysis/must-and-partial.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/must-and-partial.ll index 5bcc3f99102..cc03870b794 100644 --- a/test/Analysis/CFLAliasAnalysis/must-and-partial.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/must-and-partial.ll @@ -1,11 +1,11 @@ -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info 2>&1 | FileCheck %s ; When merging MustAlias and PartialAlias, merge to PartialAlias ; instead of MayAlias. target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" -; FIXME: This could be PartialAlias but CFLAA can't currently prove it +; FIXME: This could be PartialAlias but CFLSteensAA can't currently prove it ; CHECK: MayAlias: i16* %bigbase0, i8* %phi define i8 @test0(i1 %x) { entry: @@ -25,7 +25,7 @@ green: ret i8 %loaded } -; FIXME: This could be PartialAlias but CFLAA can't currently prove it +; FIXME: This could be PartialAlias but CFLSteensAA can't currently prove it ; CHECK: MayAlias: i16* %bigbase1, i8* %sel define i8 @test1(i1 %x) { entry: diff --git a/test/Analysis/CFLAliasAnalysis/opaque-call-alias.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/opaque-call-alias.ll similarity index 83% rename from test/Analysis/CFLAliasAnalysis/opaque-call-alias.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/opaque-call-alias.ll index 083b5ef3d82..a03b104778b 100644 --- a/test/Analysis/CFLAliasAnalysis/opaque-call-alias.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/opaque-call-alias.ll @@ -2,7 +2,7 @@ ; its own stratified set. This would make cases like the one in @test say that ; nothing (except %Escapes and %Arg) can alias -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s ; CHECK: Function: test ; CHECK: NoAlias: i8* %Arg, i8* %Escapes diff --git a/test/Analysis/CFLAliasAnalysis/phi-and-select.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/phi-and-select.ll similarity index 87% rename from test/Analysis/CFLAliasAnalysis/phi-and-select.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/phi-and-select.ll index a0e71a7e7dc..2af7fdea02c 100644 --- a/test/Analysis/CFLAliasAnalysis/phi-and-select.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/phi-and-select.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s ; Derived from (a subset of) BasicAA/phi-and-select.ll ; CHECK: Function: qux diff --git a/test/Analysis/CFLAliasAnalysis/pr27213.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/pr27213.ll similarity index 79% rename from test/Analysis/CFLAliasAnalysis/pr27213.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/pr27213.ll index 2b40f4a10b9..d685cab6275 100644 --- a/test/Analysis/CFLAliasAnalysis/pr27213.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/pr27213.ll @@ -1,5 +1,5 @@ -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s -; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s ; CHECK-LABEL: Function: foo ; CHECK: MayAlias: i32* %A, i32* %B diff --git a/test/Analysis/CFLAliasAnalysis/simple.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/simple.ll similarity index 71% rename from test/Analysis/CFLAliasAnalysis/simple.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/simple.ll index adc71867bfc..17b48d48b0f 100644 --- a/test/Analysis/CFLAliasAnalysis/simple.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/simple.ll @@ -1,7 +1,7 @@ ; This testcase consists of alias relations which should be completely -; resolvable by cfl-aa (derived from BasicAA/2003-11-04-SimpleCases.ll). +; resolvable by cfl-steens-aa (derived from BasicAA/2003-11-04-SimpleCases.ll). -; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -cfl-steens-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s %T = type { i32, [10 x i8] } diff --git a/test/Analysis/CFLAliasAnalysis/stratified-attrs-indexing.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/stratified-attrs-indexing.ll similarity index 88% rename from test/Analysis/CFLAliasAnalysis/stratified-attrs-indexing.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/stratified-attrs-indexing.ll index 347528583a6..f43af93e994 100644 --- a/test/Analysis/CFLAliasAnalysis/stratified-attrs-indexing.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/stratified-attrs-indexing.ll @@ -1,11 +1,11 @@ -; This testcase ensures that CFLAA doesn't try to access out of bounds indices +; This testcase ensures that CFLSteensAA doesn't try to access out of bounds indices ; when given functions with large amounts of arguments (specifically, more ; arguments than the StratifiedAttrs bitset can handle) ; ; Because the result on failure is effectively crashing the compiler, output ; checking is minimal. -; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -cfl-steens-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s ; CHECK: Function: test define void @test(i1 %cond, diff --git a/test/Analysis/CFLAliasAnalysis/va.ll b/test/Analysis/CFLAliasAnalysis/Steensgaard/va.ll similarity index 86% rename from test/Analysis/CFLAliasAnalysis/va.ll rename to test/Analysis/CFLAliasAnalysis/Steensgaard/va.ll index 61ed5ea3816..43fca920741 100644 --- a/test/Analysis/CFLAliasAnalysis/va.ll +++ b/test/Analysis/CFLAliasAnalysis/Steensgaard/va.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s ; CHECK-LABEL: Function: test1 ; CHECK: MayAlias: i32* %X, i32* %tmp