On Thu, May 4, 2017 at 5:21 PM, Bin.Cheng <amker.ch...@gmail.com> wrote:
> On Mon, Apr 24, 2017 at 11:43 AM, Richard Biener
> <richard.guent...@gmail.com> wrote:
>> On Tue, Apr 18, 2017 at 12:43 PM, Bin Cheng <bin.ch...@arm.com> wrote:
>>> Hi,
>>> This patch adds three simple interfaces for tree affine which will be used 
>>> in
>>> cost computation later.
>>>
>>> Is it OK?
>>
>>
>> +static inline tree
>> +aff_combination_type (aff_tree *aff)
>>
>> misses a function comment.  Please do not introduce new 'static inline'
>> function in headers but instead use plain 'inline'.
>>
>> +/* Return true if AFF is simple enough.  */
>> +static inline bool
>> +aff_combination_simple_p (aff_tree *aff)
>> +{
>>
>> what is "simple"?  Based on that find a better name.
>> "singleton"?  But aff_combination_const_p isn't
>> simple_p (for whatever reason).
> Patch updated.  The one (13th) depending on this one is updated too.

Ok with

+inline bool
+aff_combination_singleton_var_p (aff_tree *aff)
+{
+  gcc_assert (aff != NULL);

this assert removed (aff->n will ICE anyway if NULL)

+  return (aff->n == 1
+         && aff->offset == 0
+         && (aff->elts[0].coef == 1 || aff->elts[0].coef == -1));

please adjust the comment to say "one (negated) singleton variable".

Thanks,
Richard.

> Thanks,
> bin
>>
>> Richard.
>>
>>
>>
>>> Thanks,
>>> bin
>>> 2017-04-11  Bin Cheng  <bin.ch...@arm.com>
>>>
>>>         * tree-affine.h (aff_combination_type): New interface.
>>>         (aff_combination_const_p, aff_combination_simple_p): New interfaces.

Reply via email to