[PATCH] D81829: [LangRef] Element-wise Integral Reduction Intrinsics

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 15 13:15:00 PDT 2020


nikic added inline comments.


================
Comment at: llvm/docs/LangRef.rst:15208
+'``llvm.reduce.abs.*``' Intrinsic
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
----------------
xbolva00 wrote:
> What abouts nabs? 
> 
> We pattern match it currently too.
We do, but it's probably much less common than `abs()` and doesn't have any backend support. I think we can get away with representing it as `0 - abs(x)` (or just the same way we do now).


================
Comment at: llvm/docs/LangRef.rst:15218-15219
+
+      declare i32 @llvm.abs.i32(i32 <src>, i1 <is_int_min_poison>)
+      declare <4 x i32> @llvm.abs.v4i32(<4 x i32> <src>, i1 <is_int_min_poison>)
+
----------------
spatel wrote:
> Do we need to include the poison option? 
> 
> The SDAG node only has:
>   /// Note: A value of INT_MIN will return INT_MIN, no saturation or overflow
>   /// is performed.
The poison option is the equivalent of the sub nsw flag that was used previously. It doesn't matter for lowering, but it is used for analysis sometimes, in particular we can only assume that the `llvm.abs()` result is actually positive if the poison flag is set.


================
Comment at: llvm/docs/LangRef.rst:15236
+result value of the '``llvm.abs``' intrinsic is a a
+:ref:`poison value <poisonvalues>`if the argument is statically or dynamically
+an ``INT_MIN`` value.
----------------
Missing space before "if".


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81829





More information about the llvm-commits mailing list