Skip to content

Commit 65f8c24

Browse files
committed
[SYCL] Add SYCL-specific address spaces fixer pass.
Finds all addrspacecasts from named AS to private AS and changes these casts to cast from named AS to generic AS. Also replaces all calls and functions with new types according with new addrspacecasts. Signed-off-by: Vladimir Lazarev <[email protected]>
1 parent 79a49d6 commit 65f8c24

File tree

11 files changed

+1113
-0
lines changed

11 files changed

+1113
-0
lines changed

llvm/include/llvm/InitializePasses.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ void initializeWinEHPreparePass(PassRegistry&);
407407
void initializeWriteBitcodePassPass(PassRegistry&);
408408
void initializeWriteThinLTOBitcodePass(PassRegistry&);
409409
void initializeXRayInstrumentationPass(PassRegistry&);
410+
void initializeASFixerPass(PassRegistry&);
410411

411412
} // end namespace llvm
412413

llvm/include/llvm/SYCL/ASFixer.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//===- ASFixer.h - SYCL address spaces fixer pass -------------------------===//
2+
//
3+
// The LLVM Compiler Infrastructure
4+
//
5+
// This file is distributed under the University of Illinois Open Source
6+
// License. See LICENSE.TXT for details.
7+
//
8+
//===----------------------------------------------------------------------===//
9+
//
10+
// SYCL address spaces fixer pass
11+
//
12+
//===----------------------------------------------------------------------===//
13+
14+
#ifndef LLVM_SYCL_ASFIXER_H
15+
#define LLVM_SYCL_ASFIXER_H
16+
17+
#include "llvm/IR/Module.h"
18+
#include "llvm/Pass.h"
19+
20+
namespace llvm {
21+
22+
ModulePass *createASFixerPass();
23+
24+
}
25+
26+
#endif

llvm/lib/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ add_subdirectory(ToolDrivers)
2929
add_subdirectory(XRay)
3030
add_subdirectory(Testing)
3131
add_subdirectory(WindowsManifest)
32+
add_subdirectory(SYCL)

0 commit comments

Comments
 (0)