[PATCH] Allow ScalarEvolution to catch more min/max cases

Johannes Doerfert doerfert at cs.uni-saarland.de
Wed Feb 4 02:38:47 PST 2015


Hey Nick,

thanks for the review.

On 02/04, Nick Lewycky wrote:
> The logic here looks pretty obviously correct. I am confused about the
> whitespace though. This looks right:
> 
> +        if (getTypeSizeInBits(LHS->getType()) <=
> +            getTypeSizeInBits(U->getType())) {
> 
> but these do not:
> 
> +        if (getTypeSizeInBits(LHS->getType()) <=
> +                getTypeSizeInBits(U->getType()) &&
> 
> ...
> 
> +        if (getTypeSizeInBits(LHS->getType()) <=
> +                getTypeSizeInBits(U->getType()) &&
> 
> Consider clang-format'ing and then commit.
I actually did (as I am used to format the whole file anyway). To be
completely sure I checked again and my clang format produces this kind
of indention. It is probably because of the continuation of the latter
expressions, however it might as well be a glitch in the formatter.

Should I change the indention or keep the one produced by clang format?

Best regards,
  Johannes

> Johannes Doerfert wrote:
> >Hi sunfish, atrick, bkramer,
> >
> >   For the test case attached different types are used in the ICmpInst
> >   and SelectInst that represent the min/max expressions. However, if the
> >   ICmpInst type is smaller a comparison with the sign/zero extended
> >   operands would have yielded the same result. This situation might arise after
> >   the instruction combination pass was applied.
> >
> >http://reviews.llvm.org/D7338
> >
> >Files:
> >   lib/Analysis/ScalarEvolution.cpp
> >   test/Analysis/ScalarEvolution/min-max-exprs.ll
> >
> >EMAIL PREFERENCES
> >   http://reviews.llvm.org/settings/panel/emailpreferences/
> >
> >
> >
> >_______________________________________________
> >llvm-commits mailing list
> >llvm-commits at cs.uiuc.edu
> >http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 

-- 

Johannes Doerfert
Researcher / PhD Student

Compiler Design Lab (Prof. Hack)
Saarland University, Computer Science
Building E1.3, Room 4.31

Tel. +49 (0)681 302-57521 : doerfert at cs.uni-saarland.de
Fax. +49 (0)681 302-3065  : http://www.cdl.uni-saarland.de/people/doerfert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150204/63b0a86c/attachment.sig>


More information about the llvm-commits mailing list