[PATCH] D65455: [FunctionAttrs] Annotate "willreturn" for AssumeLikeInst

Hideto Ueno via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 11:36:30 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL367342: [FunctionAttrs] Annotate "willreturn" for AssumeLikeInst (authored by uenoku, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D65455?vs=212361&id=212395#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65455/new/

https://reviews.llvm.org/D65455

Files:
  llvm/trunk/include/llvm/IR/Intrinsics.td
  llvm/trunk/lib/Analysis/ValueTracking.cpp


Index: llvm/trunk/lib/Analysis/ValueTracking.cpp
===================================================================
--- llvm/trunk/lib/Analysis/ValueTracking.cpp
+++ llvm/trunk/lib/Analysis/ValueTracking.cpp
@@ -4264,10 +4264,7 @@
 
     // FIXME: This isn't aggressive enough; a call which only writes to a global
     // is guaranteed to return.
-    return CS.onlyReadsMemory() || CS.onlyAccessesArgMemory() ||
-           match(I, m_Intrinsic<Intrinsic::assume>()) ||
-           match(I, m_Intrinsic<Intrinsic::sideeffect>()) ||
-           match(I, m_Intrinsic<Intrinsic::experimental_widenable_condition>());
+    return CS.onlyReadsMemory() || CS.onlyAccessesArgMemory();
   }
 
   // Other instructions return normally.
Index: llvm/trunk/include/llvm/IR/Intrinsics.td
===================================================================
--- llvm/trunk/include/llvm/IR/Intrinsics.td
+++ llvm/trunk/include/llvm/IR/Intrinsics.td
@@ -576,7 +576,7 @@
 def int_objectsize : Intrinsic<[llvm_anyint_ty],
                                [llvm_anyptr_ty, llvm_i1_ty,
                                 llvm_i1_ty, llvm_i1_ty],
-                               [IntrNoMem, IntrSpeculatable, ImmArg<1>, ImmArg<2>, ImmArg<3>]>,
+                               [IntrNoMem, IntrSpeculatable, IntrWillReturn, ImmArg<1>, ImmArg<2>, ImmArg<3>]>,
                                GCCBuiltin<"__builtin_object_size">;
 
 //===--------------- Constrained Floating Point Intrinsics ----------------===//
@@ -1013,7 +1013,7 @@
 
 // Supports widenable conditions for guards represented as explicit branches.
 def int_experimental_widenable_condition : Intrinsic<[llvm_i1_ty], [],
-                                           [IntrInaccessibleMemOnly]>;
+                                           [IntrInaccessibleMemOnly, IntrWillReturn]>;
 
 // NOP: calls/invokes to this intrinsic are removed by codegen
 def int_donothing : Intrinsic<[], [], [IntrNoMem, IntrWillReturn]>;
@@ -1022,7 +1022,7 @@
 // has having opaque side effects. This may be inserted into loops to ensure
 // that they are not removed even if they turn out to be empty, for languages
 // which specify that infinite loops must be preserved.
-def int_sideeffect : Intrinsic<[], [], [IntrInaccessibleMemOnly]>;
+def int_sideeffect : Intrinsic<[], [], [IntrInaccessibleMemOnly, IntrWillReturn]>;
 
 // Intrisics to support half precision floating point format
 let IntrProperties = [IntrNoMem, IntrWillReturn] in {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65455.212395.patch
Type: text/x-patch
Size: 2465 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190730/6680d2e8/attachment.bin>


More information about the llvm-commits mailing list