Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL] [NATIVECPU] Integrate OneAPI Construction Kit vectorizer #12659

Merged
merged 59 commits into from
Feb 28, 2024
Merged
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
a623d24
Support barriers on Native CPU
PietroGhg Oct 20, 2023
aed012f
formatting
PietroGhg Oct 20, 2023
798e2d1
formatting
PietroGhg Oct 20, 2023
4233cf8
Remove def for fixUpKernelNameAfterBarrier
PietroGhg Oct 20, 2023
5d76bd6
Licence header
PietroGhg Oct 23, 2023
509447c
Update lit test
PietroGhg Oct 23, 2023
9586b39
formatting
PietroGhg Oct 23, 2023
c297e24
formatting
PietroGhg Oct 23, 2023
de9506d
Merge branch 'sycl' into pietro/barriers
PietroGhg Oct 25, 2023
5a62505
formatting
PietroGhg Oct 25, 2023
0b140ef
[wip] vecz integration
PietroGhg Oct 31, 2023
c5697e7
Better defaults
PietroGhg Oct 31, 2023
af3abd1
Merge branch 'sycl' into pietro/barriers
PietroGhg Nov 1, 2023
986e37a
Consistent naming for cmake var
PietroGhg Nov 1, 2023
5188f8c
Merge branch 'sycl' into pietro/barriers
PietroGhg Nov 2, 2023
85bcbc6
Merge branch 'pietro/barriers' into pietro/vecz
PietroGhg Nov 6, 2023
f07433f
Enable vectorization by default
PietroGhg Nov 7, 2023
9f4a6b9
formatting
PietroGhg Nov 7, 2023
277f6a9
Merge branch 'sycl' into pietro/vecz
PietroGhg Nov 8, 2023
f2b634e
Remove debug print
PietroGhg Nov 8, 2023
b744997
Merge branch 'sycl' into pietro/barriers
PietroGhg Nov 9, 2023
6529479
Test updated OCK branch
PietroGhg Nov 9, 2023
9023de6
Restore real ock tag
PietroGhg Nov 9, 2023
06634f3
Merge branch 'pietro/barriers' of github.com:PietroGhg/llvm into piet…
PietroGhg Nov 9, 2023
8e3b25d
Merge branch 'sycl' into pietro/barriers
PietroGhg Nov 15, 2023
989da9c
Merge branch 'pietro/barriers' into pietro/vecz
PietroGhg Nov 15, 2023
8fc2392
Move utily functions to UtilsSYCLNativeCPU.h
PietroGhg Nov 16, 2023
11de7b3
Consistent naming in docs
PietroGhg Nov 16, 2023
376556d
change fixCallingConv name
PietroGhg Nov 17, 2023
93690b6
Check after dyn_cast
PietroGhg Nov 17, 2023
ab3e154
remove libclc-relatd cmake from native cpu cmake
PietroGhg Nov 17, 2023
ef1e920
Put back O2 in lit test
PietroGhg Nov 17, 2023
e8d7e3b
Update docs
PietroGhg Nov 17, 2023
e638b88
check after dyn cast
PietroGhg Nov 17, 2023
49ed3e7
Use llvm::cast where appropriate
PietroGhg Nov 20, 2023
8f6eab3
Merge branch 'sycl' into pietro/barriers
PietroGhg Nov 20, 2023
27f5177
Merge branch 'sycl' into pietro/barriers
PietroGhg Nov 28, 2023
27936cd
typo
PietroGhg Nov 28, 2023
36189e2
Merge branch 'pietro/barriers' into pietro/vecz
PietroGhg Nov 28, 2023
91c9b77
use llvm option for disabling vecz
PietroGhg Dec 1, 2023
a67fa2b
Merge branch 'sycl' into pietro/vecz
PietroGhg Dec 6, 2023
26bff15
Merge branch 'sycl' into pietro/vecz
PietroGhg Jan 31, 2024
b1f3fcd
Update OCK tag
PietroGhg Jan 31, 2024
db4612e
Formatting
PietroGhg Jan 31, 2024
69c83b6
Change vecz width option name and location
PietroGhg Feb 2, 2024
4abfb0e
Update docs
PietroGhg Feb 2, 2024
9ae8a21
Update docs
PietroGhg Feb 2, 2024
05ae105
New line in docs
PietroGhg Feb 2, 2024
432681e
Link to section
PietroGhg Feb 2, 2024
fc6e1d3
Link to section
PietroGhg Feb 2, 2024
50ea60c
Merge branch 'sycl' into pietro/vecz
PietroGhg Feb 5, 2024
94d849c
Update lit tests
PietroGhg Feb 5, 2024
263d58f
Use llvm::OptimiaztionLevel
PietroGhg Feb 6, 2024
cf584d2
Updated vector add test
PietroGhg Feb 6, 2024
17b541f
Merge branch 'sycl' into pietro/vecz
PietroGhg Feb 7, 2024
9ad5e36
Update docs
PietroGhg Feb 7, 2024
7349939
Formatting
PietroGhg Feb 8, 2024
5957645
Mark vectorization test are require native_cpu_be
PietroGhg Feb 8, 2024
655afa6
Remove unnecessary include
PietroGhg Feb 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use llvm::cast where appropriate
  • Loading branch information
PietroGhg committed Nov 20, 2023
commit 49ed3e73a655c62de8d2524ac59f927543f56f62
23 changes: 5 additions & 18 deletions llvm/lib/SYCLLowerIR/PrepareSYCLNativeCPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,7 @@ static Function *addSetLocalIdFunc(Module &M, StringRef Name, Type *StateType) {
static FunctionType *FTy =
FunctionType::get(RetTy, {DimTy, ValTy, PtrTy}, false);
auto FCallee = M.getOrInsertFunction(Name, FTy);
auto *F = dyn_cast<Function>(FCallee.getCallee());
if(!F) {
report_fatal_error("Error while replacing mux builtins");
}
auto *F = cast<Function>(FCallee.getCallee());
IRBuilder<> Builder(Ctx);
BasicBlock *BB = BasicBlock::Create(Ctx, "entry", F);
Builder.SetInsertPoint(BB);
Expand Down Expand Up @@ -272,10 +269,7 @@ static Function *addGetFunc(Module &M, StringRef Name, Type *StateType) {
Type *PtrTy = PointerType::get(Ctx, NativeCPUGlobalAS);
static FunctionType *FTy = FunctionType::get(RetTy, {DimTy, PtrTy}, false);
auto FCallee = M.getOrInsertFunction(Name, FTy);
auto *F = dyn_cast<Function>(FCallee.getCallee());
if(!F) {
report_fatal_error("Error while replacing mux builtins");
}
auto *F = cast<Function>(FCallee.getCallee());
IRBuilder<> Builder(Ctx);
BasicBlock *BB = BasicBlock::Create(Ctx, "entry", F);
Builder.SetInsertPoint(BB);
Expand Down Expand Up @@ -306,10 +300,7 @@ static Function *addReplaceFunc(Module &M, StringRef Name, Type *StateType) {
Type *PtrTy = PointerType::get(Ctx, NativeCPUGlobalAS);
static FunctionType *FTy = FunctionType::get(RetTy, {ValTy, PtrTy}, false);
auto FCallee = M.getOrInsertFunction(Name, FTy);
auto *F = dyn_cast<Function>(FCallee.getCallee());
if(!F) {
report_fatal_error("Error while replacing mux builtins");
}
auto *F = cast<Function>(FCallee.getCallee());
IRBuilder<> Builder(Ctx);
BasicBlock *BB = BasicBlock::Create(Ctx, "entry", F);
Builder.SetInsertPoint(BB);
Expand Down Expand Up @@ -371,9 +362,7 @@ PreservedAnalyses PrepareSYCLNativeCPUPass::run(Module &M,
if (!Glob)
continue;
for (const auto &Use : Glob->uses()) {
auto I = dyn_cast<CallInst>(Use.getUser());
if (!I)
report_fatal_error("Unsupported Value in SYCL Native CPU\n");
auto I = cast<CallInst>(Use.getUser());
if (!IsNativeCPUKernel(I->getFunction())) {
// only use the threadlocal if we have kernels calling builtins
// indirectly
Expand Down Expand Up @@ -436,9 +425,7 @@ PreservedAnalyses PrepareSYCLNativeCPUPass::run(Module &M,
Function *const Glob = Entry.first;
for (const auto &Use : Glob->uses()) {
auto *ReplaceFunc = getReplaceFunc(M, Entry.second, StateType);
auto I = dyn_cast<CallInst>(Use.getUser());
if (!I)
report_fatal_error("Unsupported Value in SYCL Native CPU\n");
auto I = cast<CallInst>(Use.getUser());
SmallVector<Value *> Args(I->arg_begin(), I->arg_end());
Args.push_back(getStateArg(I->getFunction(), CurrentStatePointerTLS));
auto *NewI = CallInst::Create(ReplaceFunc->getFunctionType(), ReplaceFunc,
Expand Down