-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #205 from RossBrunton/tip_fix
[LLVM] Multi_llvm support for current tip changes
- Loading branch information
Showing
11 changed files
with
109 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (C) Codeplay Software Limited | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License") with LLVM | ||
// Exceptions; you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://github.com/codeplaysoftware/oneapi-construction-kit/blob/main/LICENSE.txt | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
// License for the specific language governing permissions and limitations | ||
// under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
#ifndef MULTI_LLVM_ENUMS_H_INCLUDED | ||
#define MULTI_LLVM_ENUMS_H_INCLUDED | ||
|
||
#include <llvm/Support/CodeGen.h> | ||
#include <multi_llvm/llvm_version.h> | ||
|
||
namespace multi_llvm { | ||
#if LLVM_VERSION_MAJOR >= 18 | ||
|
||
typedef llvm::CodeGenFileType CodeGenFileType; | ||
typedef llvm::CodeGenOptLevel CodeGenOptLevel; | ||
|
||
#else | ||
|
||
struct CodeGenFileType { | ||
static constexpr auto AssemblyFile = llvm::CGFT_AssemblyFile; | ||
static constexpr auto ObjectFile = llvm::CGFT_ObjectFile; | ||
static constexpr auto Null = llvm::CGFT_Null; | ||
}; | ||
|
||
struct CodeGenOptLevel { | ||
static constexpr auto None = llvm::CodeGenOpt::None; | ||
static constexpr auto Less = llvm::CodeGenOpt::Less; | ||
static constexpr auto Default = llvm::CodeGenOpt::Default; | ||
static constexpr auto Aggressive = llvm::CodeGenOpt::Aggressive; | ||
}; | ||
|
||
#endif | ||
} // namespace multi_llvm | ||
|
||
#endif // MULTI_LLVM_ENUMS_H_INCLUDED |
37 changes: 37 additions & 0 deletions
37
modules/compiler/multi_llvm/include/multi_llvm/loop_utils.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (C) Codeplay Software Limited | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License") with LLVM | ||
// Exceptions; you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://github.com/codeplaysoftware/oneapi-construction-kit/blob/main/LICENSE.txt | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
// License for the specific language governing permissions and limitations | ||
// under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
#ifndef MULTI_LLVM_LOOP_UTILS_H_INCLUDED | ||
#define MULTI_LLVM_LOOP_UTILS_H_INCLUDED | ||
|
||
#include <llvm/Transforms/Utils/LoopUtils.h> | ||
#include <multi_llvm/llvm_version.h> | ||
|
||
namespace multi_llvm { | ||
|
||
inline llvm::Value *createSimpleTargetReduction( | ||
llvm::IRBuilderBase &B, const llvm::TargetTransformInfo *TTI, | ||
llvm::Value *Src, llvm::RecurKind RdxKind) { | ||
#if LLVM_VERSION_MAJOR >= 18 | ||
(void)TTI; | ||
return llvm::createSimpleTargetReduction(B, Src, RdxKind); | ||
#else | ||
return llvm::createSimpleTargetReduction(B, TTI, Src, RdxKind); | ||
#endif | ||
} | ||
|
||
} // namespace multi_llvm | ||
|
||
#endif // MULTI_LLVM_LOOP_UTILS_H_INCLUDED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters