[PATCH] D28241: [LICM] Untangle some of the logic in LICM canSinkOrHoistInst

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 4 09:19:33 PST 2017


On Tue, Jan 3, 2017 at 2:29 PM, Xin Tong via Phabricator <
reviews at reviews.llvm.org> wrote:

> trentxintong added a comment.
>
> In https://reviews.llvm.org/D28241#634319, @mkuper wrote:
>
> > I'm a bit confused about the distinction between "legal" and "safe". I'd
> assume them to mean the same thing.
>
>
> By "legal" I mean the instructions in question is loop invariant, i.e.
> every iteration of the loop, same value is produced.
>
> By "safe" I mean its safe to speculate the instruction, i.e. the compiler
> will not create a program that faults given a program that does not fault.
> In case of hoisting, we can guarantee so by either of the
> isSafeToSpeculativelyExecute or isGuaranteedToExecute.
>
> I feel word choices can be improved.  "Legal" ==> "Loop Invariant"  and
> "Safe" ==> "Safe To Execute Unconditionally"
>

Transformation analyses usually include 'legality' and 'profitability'
analysis.  Legality check include both speculation safety and no violations
of data dependencies  etc.

David



>
>
> https://reviews.llvm.org/D28241
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170104/33d27da2/attachment.html>


More information about the llvm-commits mailing list