summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstSimplify/div.ll
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Temporarily Revert "Add basic loop fusion pass.""Eric Christopher2019-04-171-0/+196
| | | | | | | | The reversion apparently deleted the test/Transforms directory. Will be re-reverting again. llvm-svn: 358552
* Temporarily Revert "Add basic loop fusion pass."Eric Christopher2019-04-171-196/+0
| | | | | | | | As it's causing some bot failures (and per request from kbarton). This reverts commit r358543/ab70da07286e618016e78247e4a24fcb84077fda. llvm-svn: 358546
* [InstSimplify] fold div/rem of zexted boolSanjay Patel2018-06-251-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was looking at an unrelated fold and noticed that we don't have this simplification (because the other fold would break existing tests). Name: zext udiv %z = zext i1 %x to i32 %r = udiv i32 %y, %z => %r = %y Name: zext urem %z = zext i1 %x to i32 %r = urem i32 %y, %z => %r = 0 Name: zext sdiv %z = zext i1 %x to i32 %r = sdiv i32 %y, %z => %r = %y Name: zext srem %z = zext i1 %x to i32 %r = srem i32 %y, %z => %r = 0 https://rise4fun.com/Alive/LZ9 llvm-svn: 335512
* [InstSimplify] add tests for div/rem with bool divisor; NFCSanjay Patel2018-06-251-0/+22
| | | | llvm-svn: 335509
* [PatternMatch] allow undef elements when matching a vector zeroSanjay Patel2018-04-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This is the last step in getting constant pattern matchers to allow undef elements in constant vectors. I'm adding a dedicated m_ZeroInt() function and building m_Zero() from that. In most cases, calling code can be updated to use m_ZeroInt() directly when there's no need to match pointers, but I'm leaving that efficiency optimization as a follow-up step because it's not always clear when that's ok. There are just enough icmp folds in InstSimplify that can be used for integer or pointer types, that we probably still want a generic m_Zero() for those cases. Otherwise, we could eliminate it (and possibly add a m_NullPtr() as an alias for isa<ConstantPointerNull>()). We're conservatively returning a full zero vector (zeroinitializer) in InstSimplify/InstCombine on some of these folds (see diffs in InstSimplify), but I'm not sure if that's actually necessary in all cases. We may be able to propagate an undef lane instead. One test where this happens is marked with 'TODO'. llvm-svn: 330550
* [InstSimplify] move/add/regenerate checks for tests; NFCSanjay Patel2018-04-211-8/+34
| | | | llvm-svn: 330515
* InstSimplify: If divisor element is undef simplify to undefZvi Rackover2018-01-241-0/+16
| | | | | | | | | | | | | | | | Summary: If any vector divisor element is undef, we can arbitrarily choose it be zero which would make the div/rem an undef value by definition. Reviewers: spatel, reames Reviewed By: spatel Subscribers: magabari, llvm-commits Differential Revision: https://reviews.llvm.org/D42485 llvm-svn: 323343
* [InstSimplify] fix some test names; NFCSanjay Patel2017-09-111-12/+12
| | | | | | Too much division...the quotient is the answer. llvm-svn: 312943
* [InstSimplify] refactor udiv/urem code and add tests; NFCISanjay Patel2017-09-101-0/+68
| | | | | | | | | This removes some duplicated code and makes it easier to support signed div/rem in a similar way if we want to do that. Note that the existing comments were not accurate - we don't need a constant divisor to simplify; icmp simplification does more than that. But as the added tests show, it could go even further. llvm-svn: 312885
* [InstSimplify] allow folds for bool vector div/remSanjay Patel2017-03-091-5/+3
| | | | llvm-svn: 297411
* [ConstantFold] vector div/rem with any zero element in divisor is undefSanjay Patel2017-03-091-2/+2
| | | | | | | | Follow-up for: https://reviews.llvm.org/D30665 https://reviews.llvm.org/rL297390 llvm-svn: 297409
* [InstSimplify] add tests for vector constant folding div/rem-by-0; NFCSanjay Patel2017-03-091-0/+16
| | | | llvm-svn: 297407
* [InstSimplify] vector div/rem with any zero element in divisor is undefSanjay Patel2017-03-091-5/+3
| | | | | | | | | | | This was suggested as a DAG simplification in the review for rL297026 : http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170306/435253.html ...but let's start with IR since we have actual docs for IR (LangRef). Differential Revision: https://reviews.llvm.org/D30665 llvm-svn: 297390
* [InstSimplify] add tests for vector div/rem with UB potential; NFCSanjay Patel2017-03-061-0/+42
| | | | llvm-svn: 297048
* [InstSimplify] regenerate checks; NFCSanjay Patel2017-03-061-1/+1
| | | | llvm-svn: 297040
* [InstSimplify] Optimize away udivs in the presence of range metadataDavid Majnemer2017-01-061-0/+15
We know that udiv %V, C can be optimized away to 0 if %V is ult C. llvm-svn: 291296
OpenPOWER on IntegriCloud