diff options
| author | Tobias Grosser <tobias@grosser.es> | 2017-01-14 20:25:44 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2017-01-14 20:25:44 +0000 |
| commit | 4d5a9172875c0718ee9472c72765f2b5ef7c92dd (patch) | |
| tree | 409e89d64720128bfe947532c717264bc4c5b659 /polly/lib/CodeGen/PPCGCodeGeneration.cpp | |
| parent | 12ed728c2393bc2c117e4d90dbfa3e820df923a7 (diff) | |
| download | bcm5719-llvm-4d5a9172875c0718ee9472c72765f2b5ef7c92dd.tar.gz bcm5719-llvm-4d5a9172875c0718ee9472c72765f2b5ef7c92dd.zip | |
Use typed enums to model MemoryKind and move MemoryKind out of ScopArrayInfo
To benefit of the type safety guarantees of C++11 typed enums, which would have
caught the type mismatch fixed in r291960, we make MemoryKind a typed enum.
This change also allows us to drop the 'MK_' prefix and to instead use the more
descriptive full name of the enum as prefix. To reduce the amount of typing
needed, we use this opportunity to move MemoryKind from ScopArrayInfo to a
global scope, which means the ScopArrayInfo:: prefix is not needed. This move
also makes historically sense. In the beginning of Polly we had different
MemoryKind enums in both MemoryAccess and ScopArrayInfo, which were later
canonicalized to one. During this canonicalization we just choose the enum in
ScopArrayInfo, but did not consider to move this shared enum to global scope.
Reviewed-by: Michael Kruse <llvm@meinersbur.de>
Differential Revision: https://reviews.llvm.org/D28090
llvm-svn: 292030
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
| -rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index 6f3ede81f1f..456382c2be6 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -1245,7 +1245,7 @@ void GPUNodeBuilder::createKernel(__isl_take isl_ast_node *KernelStmt) { IDToSAI.clear(); Annotator.resetAlternativeAliasBases(); for (auto &BasePtr : LocalArrays) - S.invalidateScopArrayInfo(BasePtr, ScopArrayInfo::MK_Array); + S.invalidateScopArrayInfo(BasePtr, MemoryKind::Array); LocalArrays.clear(); std::string ASMString = finalizeKernelFunction(); @@ -1347,7 +1347,7 @@ GPUNodeBuilder::createKernelFunctionDecl(ppcg_kernel *Kernel, Sizes.push_back(SE.getSCEV(V)); } const ScopArrayInfo *SAIRep = - S.getOrCreateScopArrayInfo(Val, EleTy, Sizes, ScopArrayInfo::MK_Array); + S.getOrCreateScopArrayInfo(Val, EleTy, Sizes, MemoryKind::Array); LocalArrays.push_back(Val); isl_ast_build_free(Build); @@ -1526,8 +1526,8 @@ void GPUNodeBuilder::createKernelVariables(ppcg_kernel *Kernel, Function *FN) { } else { llvm_unreachable("unknown variable type"); } - SAI = S.getOrCreateScopArrayInfo(Allocation, EleTy, Sizes, - ScopArrayInfo::MK_Array); + SAI = + S.getOrCreateScopArrayInfo(Allocation, EleTy, Sizes, MemoryKind::Array); Id = isl_id_alloc(S.getIslCtx(), Var.name, nullptr); IDToValue[Id] = Allocation; LocalArrays.push_back(Allocation); |

