6 #include <gtest/gtest.h>
15 TEST(IOBarrierRemovalTests, IOBarrierRemoval)
24 const auto functionType =
28 const auto & rvsdg = rvsdgModule.Rvsdg();
31 rvsdg.GetRootRegion(),
34 auto x = lambdaNode->GetFunctionArguments()[0];
35 auto y = lambdaNode->GetFunctionArguments()[1];
36 auto ioState = lambdaNode->GetFunctionArguments()[2];
38 auto & ioBarrierNode = jlm::rvsdg::CreateOpNode<IOBarrierOperation>({ x, ioState }, i32Type);
41 jlm::rvsdg::CreateOpNode<IntegerSDivOperation>({ ioBarrierNode.output(0), y }, 32);
43 const auto lambdaOutput = lambdaNode->finalize({ sdivNode.output(0), ioState });
53 EXPECT_FALSE(Region::ContainsOperation<IOBarrierOperation>(rvsdg.GetRootRegion(),
true));
static jlm::util::StatisticsCollector statisticsCollector
TEST(IOBarrierRemovalTests, IOBarrierRemoval)
Removes all IOBarrier nodes from the RVSDG.
void Run(rvsdg::RvsdgModule &module, util::StatisticsCollector &statisticsCollector) override
Perform RVSDG transformation.
static std::shared_ptr< const IOStateType > Create()
static std::unique_ptr< LlvmLambdaOperation > Create(std::shared_ptr< const jlm::rvsdg::FunctionType > type, std::string name, const jlm::llvm::Linkage &linkage, jlm::llvm::CallingConvention callingConvention, jlm::llvm::AttributeSet attributes)
static std::shared_ptr< const BitType > Create(std::size_t nbits)
Creates bit type of specified width.
static std::shared_ptr< const FunctionType > Create(std::vector< std::shared_ptr< const jlm::rvsdg::Type >> argumentTypes, std::vector< std::shared_ptr< const jlm::rvsdg::Type >> resultTypes)
static GraphExport & Create(Output &origin, std::string name)
static LambdaNode * Create(rvsdg::Region &parent, std::unique_ptr< LambdaOperation > operation)
Global memory state passed between functions.