Convert to a sequence of early returns to make the logic easier to follow.
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Unit Tests
Event Timeline
Comment Actions
The logic is basically the following:
- If we can use LSE, return "none" and let isel lower it.
- If we can use outlined atomic helpers, return "none" and let SelectionDAG generate the outlined call.
- If we can use LLSC, use LLSC expansion
- If we can use cmpxchg, use cmpxchg expansion
- If we can't use any of the above, we... crash? Really, we shouldn't get here; we should call setMaxAtomicSizeInBitsSupported() and let AtomicExpand handle it.
The proposed refactoring seems to make it harder to understand this.
If you want to separate out "can use LSE" and "can use outlined atomic helpers" into separate functions/lambas, that would be an improvement, I guess.
Comment Actions
Sorry I forgot to follow this up sooner. Looking at it again I think you are right so will drop this patch.