This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MLIR][OpenMP] Prevent CSE and constant materialization from crossing…
… some OpenMP region boundaries Operations this patch prevents constants and common subexpressions being extracted from: - omp.target - omp.teams - omp.parallel
- Loading branch information
Showing
3 changed files
with
55 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//===- CSEInterfaces.h ------------------------------------------*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
#ifndef MLIR_INTERFACES_CSEINTERFACES_H_ | ||
#define MLIR_INTERFACES_CSEINTERFACES_H_ | ||
|
||
#include "mlir/IR/DialectInterface.h" | ||
#include "mlir/Support/LogicalResult.h" | ||
#include "llvm/ADT/ArrayRef.h" | ||
#include "llvm/ADT/SmallVector.h" | ||
|
||
namespace mlir { | ||
|
||
/// Define an interface to allow for dialects to control specific aspects of | ||
/// common subexpression elimination behavior for operations they define. | ||
class DialectCSEInterface : public DialectInterface::Base<DialectCSEInterface> { | ||
public: | ||
DialectCSEInterface(Dialect *dialect) : Base(dialect) {} | ||
|
||
/// Registered hook to check if an operation that is *not* isolated from | ||
/// above, should allow common subexpressions to be extracted out of its | ||
/// regions. | ||
virtual bool subexpressionExtractionAllowed(Operation *op) const { | ||
return true; | ||
} | ||
}; | ||
|
||
} // namespace mlir | ||
|
||
#endif // MLIR_INTERFACES_CSEINTERFACES_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
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