[PATCH] D38336: Add an @llvm.sideeffect intrinsic
Dan Gohman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 27 19:20:56 PDT 2017
sunfish added a comment.
In https://reviews.llvm.org/D38336#882813, @dberlin wrote:
> Is literally the only purpose to handle infinite loops?
> If so, please tighten up the description a bit.
> (Right now "indicate that the loop shouldn't be optimized away even if it's an infinite
> loop with no other side effects." would cover unreachable loops, etc).
Another potential use was mentioned here <http://lists.llvm.org/pipermail/llvm-dev/2015-July/088114.html>.
> Do you expect it to keep provably finite loops that have it alive.
> IE a loop where we can prove the backedge is not taken?
No; a backedge can still be folded away in the normal ways. The `llvm.sideeffect` call would remain, no longer needed, but not invalid. If it were important, we could add code to remove it in that case, but the patch here doesn't have that.
Repository:
rL LLVM
https://reviews.llvm.org/D38336
More information about the llvm-commits
mailing list