- User Since
- Aug 23 2016, 12:26 AM (235 w, 6 d)
Fri, Feb 12
Rebase for retesting.
Thu, Feb 11
May 30 2019
May 15 2018
May 14 2018
Fixed according to comment.
Simon, thanks! I agree that operands have same type. Do you think that it is better to create new node? Or the latest uploaded version where I update the operand of smax is acceptable?
May 11 2018
- Sorry, but initially I did not understand your concern. Fixed the code, so that existing node with changed operands is returned.
May 10 2018
Simon, could you please write if my comment is not enough and you need more details or clarification.
Apr 30 2018
(truncate (smin (smax (x, C1), C2)) to dest_type)
is equivalent to
(truncate (umin (smax(x, C1), unsigned_max_of_dest_type)) to dest_type)
that is why I don't need to create any node and just return smax.
Apr 24 2018
Apr 14 2018
Committed the test. Rebased.
Sorry, forgot to commit one of the tests. WIll fix.
Apr 12 2018
Apr 11 2018
- Added detection of the smax(smin) pattern.
Apr 10 2018
- Fixed according to comments.
Apr 9 2018
- Addressed review comments.
Apr 5 2018
Oct 27 2017
Oct 26 2017
Sanjay, thank you very much! I agree that solution with helper function looks better.
Oct 24 2017
Oct 23 2017
Oct 17 2017
Oct 16 2017
Oh, yes, it is clear for me now. Thanks! I have fixed according to your recommendation.
Fixed according to comments.
For using constant from cmp instruction (instead of recreation) we will need to check that truncated constant is equal to lower bits of cmp constant.
That is why I decided just to recreate constant which looks like more general solution.
Minimized test cases and added new ones.
We need to check that predicate is signed before matching patterns after clamp.
This condition was removed by mistake. Fixed.
Rebase after committing foldICmpWithZero as a separate change.
Also made changes according to comments.
Sanjay, no, I don't have. I have asked my colleague to commit. Thanks!
I have read more carefully your comment. As far as I understood in D26556 you want to change the process of decision making for function that folds cast operation into select.
According to suggestion from Eli you should try to match the size of a select to a cmp of its condition operand as a final result.
Necessary to mention that this function doesn't make cast folding when select is min/max and it is called only when select is an operand of cast operation.
Oct 15 2017
s = select Cond, C1, C2 sext s
sext operation is eliminated and C1, C2 constants are widened.
Created separate patch to move folding of cmp instruction: D38934. I will be able to update this differential revision when it will be committed.
I have renamed function so that we will be able to add an smax sibling for this fold with separate commit.
Oct 11 2017