[llvm] r294341 - This patch adds a ssa_copy intrinsic, as part of splitting up D29316.

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 10 10:03:44 PST 2017


Out of curiosity, how is @llvm.ssa_copy different from a single entry 
phi node?  We already use redundant PHI nodes in LCSSA, doing the same 
here would seem to make sense.

Philip

On 02/07/2017 11:29 AM, Daniel Berlin via llvm-commits wrote:
> Author: dannyb
> Date: Tue Feb  7 13:29:25 2017
> New Revision: 294341
>
> URL: http://llvm.org/viewvc/llvm-project?rev=294341&view=rev
> Log:
> This patch adds a ssa_copy intrinsic, as part of splitting up D29316.
>
> Summary:
> The intrinsic, marked as returning it's first argument, has no code
> generation effect (though currently not every optimization pass knows
> that intrinsics with the returned attribute can be looked through).
>
> It is about to be used to by the PredicateInfo pass to attach
> predicate information to existing operands, and be able to tell what
> the predicate information affects.
>
> We deliberately do not attach any info through a second operand so
> that the intrinsics do not need to dominate the comparisons/etc (since
> in the case of assume, we may want to push them up the post-dominator
> tree).
>
> Reviewers: davide, sanjoy
>
> Subscribers: llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D29517
>
> Modified:
>      llvm/trunk/docs/LangRef.rst
>      llvm/trunk/include/llvm/IR/Intrinsics.td
>
> Modified: llvm/trunk/docs/LangRef.rst
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.rst?rev=294341&r1=294340&r2=294341&view=diff
> ==============================================================================
> --- llvm/trunk/docs/LangRef.rst (original)
> +++ llvm/trunk/docs/LangRef.rst Tue Feb  7 13:29:25 2017
> @@ -12700,6 +12700,33 @@ sufficient overall improvement in code q
>   that the optimizer can otherwise deduce or facts that are of little use to the
>   optimizer.
>   
> +.. _int_ssa_copy:
> +
> +'``llvm.ssa_copy``' Intrinsic
> +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +
> +Syntax:
> +"""""""
> +
> +::
> +
> +      declare type @llvm.ssa_copy(type %operand) returned(1) readnone
> +
> +Arguments:
> +""""""""""
> +
> +The first argument is an operand which is used as the returned value.
> +
> +Overview:
> +""""""""""
> +
> +The ``llvm.ssa_copy`` intrinsic can be used to attach information to
> +operations by copying them and giving them new names.  For example,
> +the PredicateInfo utility uses it to build Extended SSA form, and
> +attach various forms of information to operands that dominate specific
> +uses.  It is not meant for general use, only for building temporary
> +renaming forms that require value splits at certain points.
> +
>   .. _type.test:
>   
>   '``llvm.type.test``' Intrinsic
>
> Modified: llvm/trunk/include/llvm/IR/Intrinsics.td
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Intrinsics.td?rev=294341&r1=294340&r2=294341&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/IR/Intrinsics.td (original)
> +++ llvm/trunk/include/llvm/IR/Intrinsics.td Tue Feb  7 13:29:25 2017
> @@ -781,6 +781,10 @@ def int_memcpy_element_atomic  : Intrins
>                                    [IntrArgMemOnly, NoCapture<0>, NoCapture<1>,
>                                     WriteOnly<0>, ReadOnly<1>]>;
>   
> +//===----- Intrinsics that are used to provide predicate information -----===//
> +
> +def int_ssa_copy : Intrinsic<[llvm_any_ty], [LLVMMatchType<0>],
> +			     [IntrNoMem, Returned<0>]>;
>   //===----------------------------------------------------------------------===//
>   // Target-specific intrinsics
>   //===----------------------------------------------------------------------===//
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list