//===- TransactionAcceptOrRevert.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 // //===----------------------------------------------------------------------===// // // This is a region pass that checks the region cost before/after vectorization // and accepts the state of Sandbox IR if the cost is better, or otherwise // reverts it. // #ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_TRANSACTIONACCEPTORREVERT_H #define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_TRANSACTIONACCEPTORREVERT_H #include "llvm/SandboxIR/Pass.h" #include "llvm/SandboxIR/Region.h" namespace llvm::sandboxir { class TransactionAcceptOrRevert : public RegionPass { public: TransactionAcceptOrRevert() : RegionPass("tr-accept-or-revert") {} bool runOnRegion(Region &Rgn, const Analyses &A) final; }; } // namespace llvm::sandboxir #endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_TRANSACTIONACCEPTORREVERT_H