<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Two quick items:<br>
    - Why should llvm.invariant(undef) be equivalent to the true case
    not the false case?  We should be able to pick either and it seems
    like replacing with unreachable is strictly more powerful.  <br>
    - Adding a canonicalization of if(c) { unreachable } to
    llvm.invariant(c) would be worthwhile.  It would strengthen the
    optimizer against existing patterns.  <br>
    <br>
    Detailed code comments to follow once we've worked out the high
    level semantics on llvm-dev.  <br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 07/12/2014 10:12 AM, <a class="moz-txt-link-abbreviated" href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>
      wrote:<br>
    </div>
    <blockquote
      cite="mid:ae43eb85e05a35f72a773c000cb2d84d@localhost.localdomain"
      type="cite">
      <pre wrap="">This adds the basic invariant intrinsic, noop lowering, and some basic properties:

 - llvm.invariant(undef) and llvm.invariant(true) are dead
 - llvm.invariant(false) is unreachable (this directly corresponds to the documented behavior of MSVC's __assume(0))

The intrinsic is tagged as writing arbitrarily, in order to maintain control dependencies. BasicAA has been updated, however, to return NoModRef for any particular location-based query so that we don't unnecessarily block code motion.

<a class="moz-txt-link-freetext" href="http://reviews.llvm.org/D178">http://reviews.llvm.org/D178</a>

Files:
  docs/LangRef.rst
  include/llvm/IR/Intrinsics.td
  lib/Analysis/BasicAliasAnalysis.cpp
  lib/Analysis/TargetTransformInfo.cpp
  lib/CodeGen/BasicTargetTransformInfo.cpp
  lib/CodeGen/IntrinsicLowering.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  lib/Transforms/Utils/Local.cpp
  test/Analysis/BasicAA/invariant.ll
  test/CodeGen/Generic/invariant.ll
  test/Transforms/InstSimplify/invariant.ll
  test/Transforms/SimplifyCFG/invariant.ll
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
llvm-commits mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>