From 9aa648a624da895e7770051772702bbe2aaf21c2 Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 5 May 2015 13:36:14 -0400
Subject: [PATCH] P4 to Git Change 1147382 by emankov@em-hsa-amd on 2015/05/05
13:24:51
ECR #333753 - Compiler Lib: 0_9 API removal
0_9 API is totally removed from both legacy and non-legacy paths.
The only alive Compiler Lib's API is 0_8 from now.
Testing: pre-checkin
Reviewers: Brian Sumner, Stanislav Mekhanoshin
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/build/Makefile.api#111 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/api/Makefile#13 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/api/v0_9/Makefile#2 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/api/v0_9/acl.cpp#6 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/api/v0_9/aclLoaders.cpp#6 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/api/v0_9/aclLoaders.h#2 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/api/v0_9/aclValidation.cpp#3 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/api/v0_9/aclValidation.h#2 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/api/v0_9/build/Makefile#3 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/api/v0_9/build/Makefile.apiv09#7 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/api/v0_9/internalLoaders.h#2 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/codegen.cpp#62 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/frontend.cpp#33 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/frontend_clang.cpp#18 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/if_acl.h#6 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/v0_9/if_acl.cpp#11 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/v0_9/if_acl.h#2 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/cpu/arm_be.cpp#14 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/cpu/x86_be.cpp#30 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/amdil_be.cpp#42 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/metadata.cpp#7 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/include/acl.h#8 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/include/aclDefs.h#10 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/include/aclEnums.h#11 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/include/aclFunctors.h#8 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/include/aclStructs.h#11 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/include/aclTypes.h#9 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/include/v0_9/acl.h#4 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/include/v0_9/aclTypes.h#8 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/include/v0_9/build/Makefile#2 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/include/v0_9/build/Makefile.include#4 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/libUtils.h#8 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/target_mappings.h#38 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_9/libUtils.cpp#4 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_9/libUtils.h#5 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_9/target_mappings.h#27 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_9/target_mappings_amdil.h#26 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_9/target_mappings_amdil64.h#28 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_9/target_mappings_arm.h#3 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_9/target_mappings_arm64.h#3 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_9/target_mappings_hsail.h#5 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_9/target_mappings_hsail64.h#12 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_9/target_mappings_x64.h#2 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_9/target_mappings_x86.h#2 delete
[ROCm/clr commit: 75a273a2725a10f914f8e330260ed9753f2f6ad3]
---
.../compiler/lib/backends/common/codegen.cpp | 7 ----
.../compiler/lib/backends/common/frontend.cpp | 38 +++----------------
.../lib/backends/common/frontend_clang.cpp | 14 ++-----
.../compiler/lib/backends/common/if_acl.h | 7 ----
.../clr/rocclr/compiler/lib/include/acl.h | 7 ----
.../clr/rocclr/compiler/lib/include/aclDefs.h | 6 ---
.../rocclr/compiler/lib/include/aclEnums.h | 6 ---
.../rocclr/compiler/lib/include/aclFunctors.h | 6 ---
.../rocclr/compiler/lib/include/aclStructs.h | 6 ---
.../rocclr/compiler/lib/include/aclTypes.h | 7 ----
.../clr/rocclr/compiler/lib/utils/libUtils.h | 7 ----
.../compiler/lib/utils/target_mappings.h | 24 +-----------
12 files changed, 9 insertions(+), 126 deletions(-)
diff --git a/projects/clr/rocclr/compiler/lib/backends/common/codegen.cpp b/projects/clr/rocclr/compiler/lib/backends/common/codegen.cpp
index eebc61580d..f89f3191b1 100644
--- a/projects/clr/rocclr/compiler/lib/backends/common/codegen.cpp
+++ b/projects/clr/rocclr/compiler/lib/backends/common/codegen.cpp
@@ -568,13 +568,6 @@ llvmCodeGen(
// Override default to generate verbose assembly, if the device is not the GPU.
// The GPU sets this in AMDILTargetMachine.cpp.
if (familyMap.target == (const TargetMapping*)&X86TargetMapping ||
-#if WITH_VERSION_0_9
- familyMap.target == (const TargetMapping*)&A32TargetMapping ||
- familyMap.target == (const TargetMapping*)&A32TargetMapping ||
-#elif WITH_VERSION_0_8
-#else
-#error "The current version implementation was not implemented here."
-#endif
familyMap.target == (const TargetMapping*)&X64TargetMapping
) {
Target.setAsmVerbosityDefault(true);
diff --git a/projects/clr/rocclr/compiler/lib/backends/common/frontend.cpp b/projects/clr/rocclr/compiler/lib/backends/common/frontend.cpp
index 7ab17b1f55..ac7625d346 100644
--- a/projects/clr/rocclr/compiler/lib/backends/common/frontend.cpp
+++ b/projects/clr/rocclr/compiler/lib/backends/common/frontend.cpp
@@ -77,7 +77,6 @@ amdcl::OCLFrontend::getFrontendCommand(aclBinary *elf,
if (enableSpir)
systemPath << "--amd-options-begin " << Opts->origOptionStr << " --amd-options-end ";
-#if WITH_VERSION_0_8
if (checkFlag(aclutGetCaps(elf), capImageSupport)) {
systemPath << "-D__IMAGE_SUPPORT__=1 ";
}
@@ -86,10 +85,6 @@ amdcl::OCLFrontend::getFrontendCommand(aclBinary *elf,
systemPath << "-DFP_FAST_FMAF=1 ";
systemPath << "-DFP_FAST_FMA=1 ";
}
-#elif WITH_VERSION_0_9
-#else
-#error "The current version was not handled correctly here."
-#endif
// F_IMAGES
if (Options()->oVariables->ImageSupport) {
@@ -122,17 +117,6 @@ amdcl::OCLFrontend::getFrontendCommand(aclBinary *elf,
case aclAMDIL64:
systemPath << "--march=gpu-64 -D__AMDIL_64__ -D__" << AMDIL64TargetMapping[chipName].chip_name << "__=1 ";
break;
-#if WITH_VERSION_0_9
- case aclA64:
- systemPath << "--march=arm64 -D__ARM_64__=1 -D__" << A64TargetMapping[chipName].chip_name << "__=1 ";
- break;
- case aclARM:
- systemPath << "--march=arm -D__ARM__=1 -D__" << A32TargetMapping[chipName].chip_name << "__=1 ";
- break;
-#elif WITH_VERSION_0_8
-#else
-#error "The current version was not handled correctly here."
-#endif
case aclHSAIL:
systemPath << "--march=hsail -D__HSAIL__ -D__" << HSAILTargetMapping[chipName].chip_name << "__=1 ";
break;
@@ -158,7 +142,7 @@ amdcl::OCLFrontend::getFrontendCommand(aclBinary *elf,
}
#ifdef WITH_TARGET_HSAIL
- if ((Is64bitMachine() && isHSAILTarget(elf->target)) ||
+ if ((Is64bitMachine() && isHSAILTarget(elf->target)) ||
(Opts->oVariables->GPU64BitIsa && (elf->target.arch_id == aclHSAIL)))
systemPath << " --march=hsail-64 ";
#endif
@@ -207,7 +191,6 @@ loadFileToStr(std::string file)
if (log.is_open()) {
size_t size = (size_t)log.tellg();
log.seekg(0, std::ios::beg);
-
std::vector buffer(size+1);
log.read(&buffer[0],size);
log.close();
@@ -221,7 +204,6 @@ loadFileToStr(std::string file)
int
amdcl::OCLFrontend::compileCommand(const std::string& singleSrc)
{
-
std::string tempFileName = amd::Os::getTempFileName();
std::string logFile = tempFileName + ".log";
std::string clFile = tempFileName + ".cl";
@@ -234,20 +216,12 @@ amdcl::OCLFrontend::compileCommand(const std::string& singleSrc)
if (Options()->oVariables->EnableBuildTiming) {
start_time = amd::Os::timeNanos();
}
- if (
-#if WITH_VERSION_0_8
- !checkFlag(aclutGetCaps(Elf()), capSaveSOURCE)
-#elif WITH_VERSION_0_9
- !Options()->oVariables->BinSOURCE
-#else
-#error "The current version was not handled correctly here."
-#endif
- ) {
+ if (!checkFlag(aclutGetCaps(Elf()), capSaveSOURCE)) {
CL()->clAPI.remSec(CL(), Elf(), aclSOURCE);
}
int ret = openclFrontEnd(frontendCmd.c_str(), &Source(), NULL);
- // We dump the preprocessed code by invoking clc a second time after the
+ // We dump the preprocessed code by invoking clc a second time after the
// original call, just in case somthing really bad happens in the original
// call.
if (Opts && Opts->isDumpFlagSet(amd::option::DUMP_I)) {
@@ -260,8 +234,7 @@ amdcl::OCLFrontend::compileCommand(const std::string& singleSrc)
if (Options()->oVariables->EnableBuildTiming) {
stop_time = amd::Os::timeNanos();
std::stringstream tmp_ss;
- tmp_ss << " OpenCL FE time: "
- << (stop_time - start_time)/1000ULL
+ tmp_ss << " OpenCL FE time: " << (stop_time - start_time)/1000ULL
<< "us\n";
appendLogToCL(CL(), tmp_ss.str());
}
@@ -274,8 +247,7 @@ amdcl::OCLFrontend::compileCommand(const std::string& singleSrc)
}
log_ += loadFileToStr(logFile);
amd::Os::unlink(logFile.c_str());
- if (isCpuTarget(Elf()->target)
- && Options()->oVariables->EnableDebug) {
+ if (isCpuTarget(Elf()->target) && Options()->oVariables->EnableDebug) {
Options()->sourceFileName_.assign(clFile);
} else {
amd::Os::unlink(clFile.c_str());
diff --git a/projects/clr/rocclr/compiler/lib/backends/common/frontend_clang.cpp b/projects/clr/rocclr/compiler/lib/backends/common/frontend_clang.cpp
index 650cd079c2..ecbc29646a 100644
--- a/projects/clr/rocclr/compiler/lib/backends/common/frontend_clang.cpp
+++ b/projects/clr/rocclr/compiler/lib/backends/common/frontend_clang.cpp
@@ -133,19 +133,11 @@ int amdcl::ClangOCLFrontend::compileCommand(const std::string& src) {
//Start the compilation
uint64_t start_time = 0, stop_time = 0;
- if (Options()->oVariables->EnableBuildTiming) {
+ if (Options()->oVariables->EnableBuildTiming) {
start_time = amd::Os::timeNanos();
}
- if (
-#if WITH_VERSION_0_8
- !checkFlag(aclutGetCaps(Elf()), capSaveSOURCE)
-#elif WITH_VERSION_0_9
- !Options()->oVariables->BinSOURCE
-#else
-#error "The current version was not handled correctly here."
-#endif
- ) {
+ if (!checkFlag(aclutGetCaps(Elf()), capSaveSOURCE)) {
CL()->clAPI.remSec(CL(), Elf(), aclSOURCE);
}
@@ -154,7 +146,7 @@ int amdcl::ClangOCLFrontend::compileCommand(const std::string& src) {
if (OCLVer.equals("CL1.2")) {
ClangOptions.OCLVer = clc2::OCL_12;
} else if (OCLVer.equals("CL2.0")) {
- ClangOptions.OCLVer = clc2::OCL_20;
+ ClangOptions.OCLVer = clc2::OCL_20;
} else {
llvm_unreachable("Unknown OpenCL version");
}
diff --git a/projects/clr/rocclr/compiler/lib/backends/common/if_acl.h b/projects/clr/rocclr/compiler/lib/backends/common/if_acl.h
index e688dc880b..5850e0bb9e 100644
--- a/projects/clr/rocclr/compiler/lib/backends/common/if_acl.h
+++ b/projects/clr/rocclr/compiler/lib/backends/common/if_acl.h
@@ -4,12 +4,5 @@
#ifndef _IF_ACL_H_
#define _IF_ACL_H_
#include "aclTypes.h"
-#if WITH_VERSION_0_8
#include "v0_8/if_acl.h"
-#elif WITH_VERSION_0_9
-#include "v0_9/if_acl.h"
-#else
-#error "The compiler library version was not defined."
-#include "v0_8/if_acl.h"
-#endif
#endif // _IF_ACL_H_
diff --git a/projects/clr/rocclr/compiler/lib/include/acl.h b/projects/clr/rocclr/compiler/lib/include/acl.h
index 1bfd20192f..01a227fa62 100644
--- a/projects/clr/rocclr/compiler/lib/include/acl.h
+++ b/projects/clr/rocclr/compiler/lib/include/acl.h
@@ -6,12 +6,5 @@
// header file for that version directly.
#ifndef ACL_H_
#define ACL_H_
-#if WITH_VERSION_0_8
#include "v0_8/acl.h"
-#elif WITH_VERSION_0_9
-#include "v0_9/acl.h"
-#else
-#error "The compiler library version was not defined."
-#include "v0_8/acl.h"
-#endif
#endif // ACL_H_
diff --git a/projects/clr/rocclr/compiler/lib/include/aclDefs.h b/projects/clr/rocclr/compiler/lib/include/aclDefs.h
index 987a06f1a8..913aab8503 100644
--- a/projects/clr/rocclr/compiler/lib/include/aclDefs.h
+++ b/projects/clr/rocclr/compiler/lib/include/aclDefs.h
@@ -6,11 +6,5 @@
// header file for that version directly.
#ifndef ACL_DEFS_H_
#define ACL_DEFS_H_
-#if WITH_VERSION_0_8
#include "v0_8/aclDefs.h"
-#elif WITH_VERSION_0_9
-#else
-#error "The compiler library version was not defined."
-#include "v0_8/aclDefs.h"
-#endif
#endif // ACL_DEFS_H_
diff --git a/projects/clr/rocclr/compiler/lib/include/aclEnums.h b/projects/clr/rocclr/compiler/lib/include/aclEnums.h
index 9e1e2f94c3..3d9d05406f 100644
--- a/projects/clr/rocclr/compiler/lib/include/aclEnums.h
+++ b/projects/clr/rocclr/compiler/lib/include/aclEnums.h
@@ -6,11 +6,5 @@
// header file for that version directly.
#ifndef ACL_ENUMS_H_
#define ACL_ENUMS_H_
-#if WITH_VERSION_0_8
#include "v0_8/aclEnums.h"
-#elif WITH_VERSION_0_9
-#else
-#error "The compiler library version was not defined."
-#include "v0_8/aclEnums.h"
-#endif
#endif // ACL_ENUMS_H_
diff --git a/projects/clr/rocclr/compiler/lib/include/aclFunctors.h b/projects/clr/rocclr/compiler/lib/include/aclFunctors.h
index b1f2309984..68ae79a6c0 100644
--- a/projects/clr/rocclr/compiler/lib/include/aclFunctors.h
+++ b/projects/clr/rocclr/compiler/lib/include/aclFunctors.h
@@ -6,11 +6,5 @@
// header file for that version directly.
#ifndef ACL_FUNCTORS_H_
#define ACL_FUNCTORS_H_
-#if WITH_VERSION_0_8
#include "v0_8/aclFunctors.h"
-#elif WITH_VERSION_0_9
-#else
-#error "The compiler library version was not defined."
-#include "v0_8/aclFunctors.h"
-#endif
#endif // ACL_FUNCTORS_H_
diff --git a/projects/clr/rocclr/compiler/lib/include/aclStructs.h b/projects/clr/rocclr/compiler/lib/include/aclStructs.h
index 6d8f5b97a3..f099228ad1 100644
--- a/projects/clr/rocclr/compiler/lib/include/aclStructs.h
+++ b/projects/clr/rocclr/compiler/lib/include/aclStructs.h
@@ -6,11 +6,5 @@
// header file for that version directly.
#ifndef ACL_STRUCTS_H_
#define ACL_STRUCTS_H_
-#if WITH_VERSION_0_8
#include "v0_8/aclStructs.h"
-#elif WITH_VERSION_0_9
-#else
-#error "The compiler library version was not defined."
-#include "v0_8/aclStructs.h"
-#endif
#endif // ACL_STRUCTS_H_
diff --git a/projects/clr/rocclr/compiler/lib/include/aclTypes.h b/projects/clr/rocclr/compiler/lib/include/aclTypes.h
index 7ef826507d..a6013bb0ce 100644
--- a/projects/clr/rocclr/compiler/lib/include/aclTypes.h
+++ b/projects/clr/rocclr/compiler/lib/include/aclTypes.h
@@ -6,12 +6,5 @@
// header file for that version directly.
#ifndef ACL_TYPES_H_
#define ACL_TYPES_H_
-#if WITH_VERSION_0_8
#include "v0_8/aclTypes.h"
-#elif WITH_VERSION_0_9
-#include "v0_9/aclTypes.h"
-#else
-#error "The compiler library version was not defined."
-#include "v0_8/aclTypes.h"
-#endif
#endif // ACL_TYPES_H_
diff --git a/projects/clr/rocclr/compiler/lib/utils/libUtils.h b/projects/clr/rocclr/compiler/lib/utils/libUtils.h
index d3fb1ea89e..e5b7127f08 100644
--- a/projects/clr/rocclr/compiler/lib/utils/libUtils.h
+++ b/projects/clr/rocclr/compiler/lib/utils/libUtils.h
@@ -6,12 +6,5 @@
// header file directly.
#ifndef _CL_LIB_UTILS_H_
#define _CL_LIB_UTILS_H_
-#if WITH_VERSION_0_8
#include "v0_8/libUtils.h"
-#elif WITH_VERSION_0_9
-#include "v0_9/libUtils.h"
-#else
-#error "The compiler library version was not defined."
-#include "v0_8/libUtils.h"
-#endif
#endif // _CL_LIB_UTILS_H_
diff --git a/projects/clr/rocclr/compiler/lib/utils/target_mappings.h b/projects/clr/rocclr/compiler/lib/utils/target_mappings.h
index a7b1e76243..c57eea67a4 100644
--- a/projects/clr/rocclr/compiler/lib/utils/target_mappings.h
+++ b/projects/clr/rocclr/compiler/lib/utils/target_mappings.h
@@ -6,7 +6,7 @@
// header file directly.
#ifndef TARGET_MAPPINGS_H_
#define TARGET_MAPPINGS_H_
-#if WITH_VERSION_0_8
+
#include "v0_8/target_mappings.h"
#define X86TargetMapping X86TargetMapping_0_8
@@ -15,26 +15,4 @@
#define HSAILTargetMapping HSAILTargetMapping_0_8
#define AMDIL64TargetMapping AMDIL64TargetMapping_0_8
#define HSAIL64TargetMapping HSAIL64TargetMapping_0_8
-#elif WITH_VERSION_0_9
-#include "v0_9/target_mappings.h"
-
-#define X86TargetMapping X86TargetMapping_0_9
-#define X64TargetMapping X64TargetMapping_0_9
-#define AMDILTargetMapping AMDILTargetMapping_0_9
-#define HSAILTargetMapping HSAILTargetMapping_0_9
-#define AMDIL64TargetMapping AMDIL64TargetMapping_0_9
-#define HSAIL64TargetMapping HSAIL64TargetMapping_0_9
-#define A32TargetMapping A32TargetMapping_0_9
-#define A64TargetMapping A64TargetMapping_0_9
-#else
-#error "The compiler library version was not defined."
-#include "v0_8/target_mappings.h"
-
-#define X86TargetMapping X86TargetMapping_0_8
-#define X64TargetMapping X64TargetMapping_0_8
-#define AMDILTargetMapping AMDILTargetMapping_0_8
-#define HSAILTargetMapping HSAILTargetMapping_0_8
-#define AMDIL64TargetMapping AMDIL64TargetMapping_0_8
-#define HSAIL64TargetMapping HSAIL64TargetMapping_0_8
-#endif
#endif // TARGET_MAPPINGS_H_