Basic structure for adding new unittests to the OpenMPOpt optimizations.
Diff Detail
Event Timeline
Should we merge the test header into the test cpp?
We need an actual unit test that runs :)
Wow, this required more machinery than I expected.. thanks!
Should we merge this with the MemoryTransfer logic so we can test it?
llvm/unittests/Transforms/IPO/OpenMPOpt/HideMemTransferLatencyTest.cpp | ||
---|---|---|
127 | Don't compare the names. Go through the module and locate the value you want and compare it against the llvm::Value. |
I already tested it. When we agree on D82719, we should commit that first and then this I guess. Or do you mean adding this patch to that one before commiting?
I'm not totally sure about this. There's a lot of test setup relative to the test case itself, and I can't work out by reading the test itself what it's checking. What are all the mock classes for?
I'm wondering if we would be better off refactoring the code it intends to test so that it needs less setup.
Regarding the mock classes. I forgot to remove MockFunctionPass and MockModulePass. But MockSCCPass is used for later using EXPECT_CALL inside the unit test itself.
Regarding refactoring the code, I think it can be done. We would have to traverse manually the function until reaching the runtime call needed. But, don't you think that all this setup might be useful for other OpenMP optimizations?, or perhaps we should wait until we have them, idk.
Don't compare the names. Go through the module and locate the value you want and compare it against the llvm::Value.