[PATCH] D29517: This patch adds a predicateinfo intrinsic, as part of splitting up D29316.

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 3 15:04:22 PST 2017


dberlin updated this revision to Diff 87039.
dberlin added a comment.

Fixing update


https://reviews.llvm.org/D29517

Files:
  docs/LangRef.rst
  include/llvm/IR/Intrinsics.td


Index: include/llvm/IR/Intrinsics.td
===================================================================
--- include/llvm/IR/Intrinsics.td
+++ include/llvm/IR/Intrinsics.td
@@ -781,6 +781,10 @@
                                  [IntrArgMemOnly, NoCapture<0>, NoCapture<1>,
                                   WriteOnly<0>, ReadOnly<1>]>;
 
+//===----- Intrinsics that are used to provide predicate information -----===//
+
+def int_predicateinfo : Intrinsic<[llvm_any_ty], [LLVMMatchType<0>],
+				  [IntrNoMem, Returned<0>]>;
 //===----------------------------------------------------------------------===//
 // Target-specific intrinsics
 //===----------------------------------------------------------------------===//
Index: docs/LangRef.rst
===================================================================
--- docs/LangRef.rst
+++ docs/LangRef.rst
@@ -12684,6 +12684,43 @@
 that the optimizer can otherwise deduce or facts that are of little use to the
 optimizer.
 
+.. _int_predicateinfo:
+
+'``llvm.predicateinfo``' Intrinsic
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Syntax:
+"""""""
+
+::
+
+      declare type @llvm.predicateinfo(type %operand) returned(1) readnone
+
+Arguments:
+""""""""""
+
+The first argument is an operand to which predicate info is attached.
+
+Overview:
+""""""""""
+
+The ``llvm.predicateinfo`` intrinsic is used to attach information to
+operations used in comparisons, as well as to the results of those
+comparisons.  It is a copy operation used to build Extended SSA form,
+and so is placed at the beginning of blocks dominated by the true or
+false edges of branches, as well as blocks that are post-dominated by
+assume operations.
+
+For operations used in branch comparisons, the information attached to
+the intrinsic includes which edge direction the current block is
+dominated by (true or false), as well as the original comparison. For
+assumes, the information attached includes a pointer to the assume
+instruction.
+
+The PredicateInfo analysis can be used to retrieve the attached
+information.  The intrinsic has no code-generation effect, and always
+returns the first argument from the perspective of the optimizer.
+
 .. _type.test:
 
 '``llvm.type.test``' Intrinsic


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29517.87039.patch
Type: text/x-patch
Size: 2224 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170203/eb904705/attachment.bin>


More information about the llvm-commits mailing list