Come up with some way to instruct LLVM that all PORT/DDR registers are zeroed at startup
dylanmckay opened this issue · 3 comments
dylanmckay commented
At the top of main
, we should be able to assume that all PORT
/DDR
registers are zeroed.
This should let LLVM optimise RMW OR/AND/NOT instructions into a simple assignment.
dylanmckay commented
Maybe a macro that expands to something like
llvm::assume(PORTB::read() == 0);
...
We could tell all users to insert this into the top of main
.
shepmaster commented
all PORT/DDR registers are zeroed.
And that's true on soft restarts too?
Restioson commented
Perhaps there could be a compiler flag to insert that, too.