P4 to Git Change 1132635 by smekhano@stas-rampitec-hsa on 2015/03/19 17:27:36
ECR #333753 - part of the changes to use llvm 3.6
Testing: smoke, precheckin
Reviewed by Brian Sumner
Affected files ...
... //depot/stg/opencl/drivers/opencl/compiler/lib/api/v0_8/acl.cpp#27 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/linker.cpp#122 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/sync.cpp#1 add
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/sync.hpp#1 add
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/v0_8/if_acl.cpp#63 edit
[ROCm/clr commit: 7168d24210]
Cette révision appartient à :
@@ -115,8 +115,7 @@ using namespace llvm;
|
||||
inline llvm::Module*
|
||||
LoadFile(const std::string &Filename, LLVMContext& Context)
|
||||
{
|
||||
bool Exists;
|
||||
if (sys::fs::exists(Filename, Exists) || !Exists) {
|
||||
if (!sys::fs::exists(Filename)) {
|
||||
// dbgs() << "Bitcode file: '" << Filename.c_str() << "' does not exist.\n";
|
||||
return 0;
|
||||
}
|
||||
@@ -137,8 +136,7 @@ inline llvm::Module*
|
||||
|
||||
inline llvm::Module*
|
||||
LoadLibrary(const std::string& libFile, LLVMContext& Context, MemoryBuffer** Buffer) {
|
||||
bool Exists;
|
||||
if (sys::fs::exists(libFile, Exists) || !Exists) {
|
||||
if (!sys::fs::exists(libFile)) {
|
||||
// dbgs() << "Bitcode file: '" << Filename.c_str() << "' does not exist.\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// Copyright (c) 2008 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
#include "sync.hpp"
|
||||
#include "llvm/Support/Mutex.h"
|
||||
#include "llvm/Support/Threading.h"
|
||||
|
||||
|
||||
static llvm::sys::MutexImpl mtx;
|
||||
|
||||
namespace amdcl
|
||||
{
|
||||
|
||||
void acquire_global_lock() {
|
||||
if (llvm::llvm_is_multithreaded())
|
||||
mtx.acquire();
|
||||
}
|
||||
|
||||
void release_global_lock() {
|
||||
if (llvm::llvm_is_multithreaded())
|
||||
mtx.release();
|
||||
}
|
||||
|
||||
} // namespace amdcl
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// Copyright (c) 2008 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
#ifndef _BE_SYNC_HPP_
|
||||
#define _BE_SYNC_HPP_
|
||||
|
||||
namespace amdcl
|
||||
{
|
||||
void acquire_global_lock();
|
||||
|
||||
void release_global_lock();
|
||||
} // namespace amdcl
|
||||
#endif // _BE_SYNC_HPP_
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "utils/options.hpp"
|
||||
#include "utils/target_mappings.h"
|
||||
#include "utils/versions.hpp"
|
||||
#include "sync.hpp"
|
||||
|
||||
#include "llvm/LLVMContext.h"
|
||||
#include "llvm/Analysis/Passes.h"
|
||||
@@ -55,7 +56,7 @@ aclLoaderData * ACL_API_ENTRY
|
||||
if_aclCompilerInit(aclCompiler *cl, aclBinary *bin,
|
||||
aclLogFunction log, acl_error *error)
|
||||
{
|
||||
llvm::llvm_acquire_global_lock();
|
||||
amdcl::acquire_global_lock();
|
||||
char* timing = ::getenv("AMD_DEBUG_HLC_ENABLE_TIMING");
|
||||
if (timing && (timing[0] == '1'))
|
||||
llvm::TimePassesIsEnabled = true;
|
||||
@@ -85,7 +86,7 @@ if_aclCompilerInit(aclCompiler *cl, aclBinary *bin,
|
||||
llvm::initializeVerifierPass(Registry);
|
||||
llvm::initializeDominatorTreePass(Registry);
|
||||
llvm::initializePreVerifierPass(Registry);
|
||||
llvm::llvm_release_global_lock();
|
||||
amdcl::release_global_lock();
|
||||
if (error) (*error) = ACL_SUCCESS;
|
||||
return reinterpret_cast<aclLoaderData*>(cl);
|
||||
}
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur