[PATCH] D46396: Optionally simplify basic blocks introduced by AtomicExpandPass

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 12 16:09:31 PDT 2018


jyknight added a comment.

While this sort of thing seems like it _should_ be okay (and possibly it even is, after all we're already running simplifycfg on ARM), the way LLVM expands operations into separate LL and SC calls in IR level is basically an invalid thing to do, and therefore fragile. And that makes changes like this which trigger more/different transformations seem somewhat scary.

I'd certainly be more comfortable making such a change once we stop emitting fragile LLSC loops at the IR level.

(The idea would be to have AtomicExpandPass emit an intrinsic for the inner ll/sc loop, which would get lowered very late in the MI pipeline, in order to guarantee that it's emitted without interference. The discussion of such has been restarted recently due to some of the RISCV atomic work, since RISCV is more precise in terms of its architectural requirements than most. I hope the result will be new functionality added to AtomicExpandPass which all targets can then be converted over to use.)


Repository:
  rL LLVM

https://reviews.llvm.org/D46396





More information about the llvm-commits mailing list