[PATCH] D47553: Add TargetLowering::shouldExpandAtomicToLibCall and query it from AtomicExpandPass

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 1 16:37:16 PDT 2018


paquette added a comment.

In https://reviews.llvm.org/D47553#1119498, @asb wrote:

> I think I can disable outlining for an entire function using isFunctionSafeToOutlineFrom


Yeah, that'll work. It's conservative, but it will ensure that the outliner will never touch the function, and thus, won't touch the instructions (or anything between them).

> but otherwise getOutliningCandidateInfo lets you opt-out on a per-instruction basis. I'd be concerned about some of the integer instructions between lr/sc being outlined, unless isFunctionSafeToOutlineFrom is used to disable outlining for any function that contains atomics.

After https://reviews.llvm.org/D47654 has landed, it should be possible to use a technique similar to https://reviews.llvm.org/D47655? That patch (https://reviews.llvm.org/D47654) makes it possible to discard candidates based off of target-specific information (e.g, register liveness, etc.)

If some sort of register liveness information is sufficient, I could probably just drop it into https://reviews.llvm.org/D47655...


https://reviews.llvm.org/D47553





More information about the llvm-commits mailing list