MLIR  22.0.0git
CanonicalizeGLPass.cpp
Go to the documentation of this file.
1 //===- CanonicalizeGLPass.cpp - GLSL Related Canonicalization Pass ------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 
13 
14 namespace mlir {
15 namespace spirv {
16 #define GEN_PASS_DEF_SPIRVCANONICALIZEGLPASS
17 #include "mlir/Dialect/SPIRV/Transforms/Passes.h.inc"
18 } // namespace spirv
19 } // namespace mlir
20 
21 using namespace mlir;
22 
23 namespace {
24 class CanonicalizeGLPass final
25  : public spirv::impl::SPIRVCanonicalizeGLPassBase<CanonicalizeGLPass> {
26 public:
27  void runOnOperation() override {
30  if (failed(applyPatternsGreedily(getOperation(), std::move(patterns))))
31  return signalPassFailure();
32  }
33 };
34 } // namespace
static MLIRContext * getContext(OpFoldResult val)
void populateSPIRVGLCanonicalizationPatterns(RewritePatternSet &results)
Populates patterns to run canoncalization that involves GL ops.
Include the generated interface declarations.
LogicalResult applyPatternsGreedily(Region &region, const FrozenRewritePatternSet &patterns, GreedyRewriteConfig config=GreedyRewriteConfig(), bool *changed=nullptr)
Rewrite ops in the given region, which must be isolated from above, by repeatedly applying the highes...
const FrozenRewritePatternSet & patterns