This teaches MachineSink to not sink instructions that might break the
implicit null check optimization that runs later. This should not
affect frontends that do not use implicit null checks.
Details
Diff Detail
Event Timeline
I added a comment to the ImplicitNullChecks pass stating why it is difficult to work with loads sunk below control flow: http://reviews.llvm.org/rL253020
lib/CodeGen/MachineSink.cpp | ||
---|---|---|
684 | Reading this on phabricator makes me feel that the naming here is not great -- I'll rename this function to SinkingPreventsImplicitNullCheck tomorrow. |
lib/CodeGen/MachineSink.cpp | ||
---|---|---|
694 | Can't getBasicBlock fail? IIRC, MachineBasicBlocks aren't obligated to map back to a BasicBlock. |
lib/CodeGen/MachineSink.cpp | ||
---|---|---|
694 | I think the failure mode is to return nullptr, which should be caught by the check below. |
lib/CodeGen/MachineSink.cpp | ||
---|---|---|
694 | Ah, my eyes didn't see it. Sorry for the noise. |
Reading this on phabricator makes me feel that the naming here is not great -- I'll rename this function to SinkingPreventsImplicitNullCheck tomorrow.