Closed ambarket closed 9 years ago
We can pass it by reference then we will not need to dereference a pointer.
Yea. It's still copying that address onto the program stack though On Mar 2, 2015 11:53 AM, "Akiira" notifications@github.com wrote:
We can pass it by reference then we will not need to dereference a pointer.
— Reply to this email directly or view it on GitHub https://github.com/Akiira/Comp-524-program/issues/1#issuecomment-76749723 .
If we are going to really try to optimize it we could just remove the function calls by placing it all in block1. So everywhere you see a function call in block just replace that with the code in that function. Keep doing that until all the blocks are in just one block.
Yeah I thought about that... Would make it so hard to read though. Maybe we'll do that once the CFG code is completely fleshed out and tested when were about to actually run the GA.
So I cant believe I forgot about this but we should just be able to use C++'s inline keyword to get all the block functions to be compiled into one function. Theres a good chance the optimizer will do this itself but I think we can increase the chance by adding the inline keyword (I say "chance", because the optimizer will ignore the inline keyword if it thinks it knows better).
If you want to pass the testCase through all the blocks in the CFG that's fine. It certainly will read better. I was trying to save some resources since its an additional ptr copied every time you make a function call and if we really support loops in the future it might blow up. It was more a concern about the coverage array though which is no longer relavant since we set it directly in the test case. Its up to you. I doubt it will be a problem for the small programs we're running.