If MemorySSA is avaiable, we can skip checking all instructions if block has any Defs.
(volatile loads are also Defs).
We still need to check all instructions for "canThrow", even if no Defs are found.
Details
Diff Detail
- Repository
- rL LLVM
- Build Status
Buildable 27230 Build 27229: arc lint + arc unit
Event Timeline
lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | ||
---|---|---|
852 | Do atomic ops fall in the same "we care and should exit now" bucket as volatile loads for this? MSSA uses MemoryDefs to represent fences and atomic loads with ordering > unordered. |
LGTM (provided I've not missed anything below w.r.t. atomics).
lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | ||
---|---|---|
852 | I think so yes, and so I think this code is correct? Such loads "appear" to write to memory and thus I think should bail. At least, this code seems to be remain a good early exit. We still directly test every instruction below. |
Thank you for the review!
lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | ||
---|---|---|
852 | The check below is mayHaveSideEffects, which internally calls mayWriteToMemory, which returns true for fences and unordered loads. |
Do atomic ops fall in the same "we care and should exit now" bucket as volatile loads for this?
MSSA uses MemoryDefs to represent fences and atomic loads with ordering > unordered.