- Apr 17, 2019
-
-
Eric Christopher authored
The reversion apparently deleted the test/Transforms directory. Will be re-reverting again. llvm-svn: 358552
-
Eric Christopher authored
As it's causing some bot failures (and per request from kbarton). This reverts commit r358543/ab70da07. llvm-svn: 358546
-
- Apr 16, 2019
-
-
Nikita Popov authored
If a constant shift amount is used, then only some of the LHS/RHS operand bits are demanded and we may be able to simplify based on that. InstCombineSimplifyDemanded already had the necessary support for that, we just weren't calling it with fshl/fshr as root. In particular, this allows us to relax some masked funnel shifts into simple shifts, as shown in the tests. Patch by Shawn Landden. Differential Revision: https://reviews.llvm.org/D60660 llvm-svn: 358515
-
Nikita Popov authored
Baseline tests for D60660. Patch by Shawn Landden. Differential Revision: https://reviews.llvm.org/D60688 llvm-svn: 358514
-
- Apr 15, 2019
-
-
Wolfgang Pieb authored
Zexts can be treated like no-op casts when it comes to assessing whether their removal affects debug info. Reviewer: aprantl Differential Revision: https://reviews.llvm.org/D60641 llvm-svn: 358431
-
Hiroshi Yamauchi authored
Summary: Enable some of the existing size optimizations for cold code under PGO. A ~5% code size saving in big internal app under PGO. The way it gets BFI/PSI is discussed in the RFC thread http://lists.llvm.org/pipermail/llvm-dev/2019-March/130894.html Note it doesn't currently touch loop passes. Reviewers: davidxl, eraman Reviewed By: eraman Subscribers: mgorny, javed.absar, smeenai, mehdi_amini, eraman, zzheng, steven_wu, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59514 llvm-svn: 358422
-
Sanjay Patel authored
(X / Y) * Z --> (X * Z) / Y This can allow other optimizations/reassociations as shown in the test diffs. llvm-svn: 358404
-
- Apr 14, 2019
-
-
Philip Reames authored
Three related changes: 1) auto-gen several test files 2) Add the new tests at the bottom of said files 3) Adjust a couple of other test files not to use stores to constants when trying to test constexpr address handling llvm-svn: 358344
-
- Apr 13, 2019
-
-
Chen Zheng authored
Differential Revision: https://reviews.llvm.org/D60647 llvm-svn: 358328
-
Chen Zheng authored
llvm-svn: 358327
-
- Apr 12, 2019
-
-
Philip Reames authored
This fixes a miscompile which was introduced in r356510 (https://reviews.llvm.org/D57372). The problem is that the original patch removed pointer operands where the load results we're demanded, but without considering the legality of the load itself. If the masked.gather had active, but undemanded, lanes, then we could end up creating a load which loaded from an undef address. The result could be a segfault, or, in theory, an arbitrary read from a random memory location into an used register. llvm-svn: 358299
-
Philip Reames authored
llvm-svn: 358296
-
- Apr 11, 2019
-
-
Simon Pilgrim authored
Use APInt instead of getZExtValue from the ConstantInt until we can confirm that the shift amount is in range. Reduced from OSS-Fuzz #14169 - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14169 llvm-svn: 358192
-
Erik Pilkington authored
If the ObjectSizeOffsetEvaluator fails to fold the object size call, then it may litter some unused instructions in the function. When done repeatably in InstCombine, this results in an infinite loop. Fix this by tracking the set of instructions that were inserted, then removing them on failure. rdar://49172227 Differential revision: https://reviews.llvm.org/D60298 llvm-svn: 358146
-
- Apr 10, 2019
-
-
Nikita Popov authored
Following D60483 and D60497, this adds support for AlwaysOverflows handling for ssubo. This is the last case we can handle right now. Differential Revision: https://reviews.llvm.org/D60518 llvm-svn: 358100
-
Nikita Popov authored
ssubo X, C is equivalent to saddo X, -C. Make the transformation in InstCombine and allow the logic implemented for saddo to fold prior usages of add nsw or sub nsw with constants. Patch by Dan Robertson. Differential Revision: https://reviews.llvm.org/D60061 llvm-svn: 358099
-
Nikita Popov authored
Followup to D60483: Handle AlwaysOverflow conditions for saddo as well. Differential Revision: https://reviews.llvm.org/D60497 llvm-svn: 358095
-
Nikita Popov authored
Check AlwaysOverflow condition for usubo. The implementation is the same as the existing handling for uaddo and umulo. Handling for saddo and ssubo will follow (smulo doesn't have the necessary ValueTracking support). Differential Revision: https://reviews.llvm.org/D60483 llvm-svn: 358052
-
Chen Zheng authored
Differential Revision: https://reviews.llvm.org/D60395 llvm-svn: 358050
-
- Apr 09, 2019
-
-
Nikita Popov authored
The uadd and umul cases are currently handled, the usub, sadd, ssub and smul cases are not. usub, sadd and ssub already have the necessary ValueTracking support, smul doesn't. llvm-svn: 358031
-
Nikita Popov authored
This reverts commit 1383a916. sdiv-canonicalize.ll fails after this revision. The fold needs to be moved outside the branch handling constant operands. However when this is done there are further test changes, so I'm reverting this in the meantime. llvm-svn: 358026
-
Nikita Popov authored
This is the same change as D60420 but for signed sub rather than signed add: Range information is intersected into the known bits result, allows to detect more no/always overflow conditions. Differential Revision: https://reviews.llvm.org/D60469 llvm-svn: 358020
-
Chen Zheng authored
Differential Revision: https://reviews.llvm.org/D60395 llvm-svn: 358017
-
Nikita Popov authored
This is D59386 for the signed add case. The computeConstantRange() result is now intersected into the existing known bits information, allowing to detect additional no-overflow/always-overflow conditions (though the latter isn't used yet). This (finally...) covers the motivating case from D59071. Differential Revision: https://reviews.llvm.org/D60420 llvm-svn: 358014
-
Sanjay Patel authored
Similar to: rL358005 Forego folding arbitrary vector constants to fix a possible miscompile bug. We can enhance the transform if we do want to handle the more complicated vector case. llvm-svn: 358013
-
Sanjay Patel authored
llvm-svn: 358010
-
Sanjay Patel authored
llvm-svn: 358008
-
Sanjay Patel authored
llvm-svn: 358007
-
Sanjay Patel authored
// 0 - (X sdiv C) -> (X sdiv -C) provided the negation doesn't overflow. This fold has been around for many years and nobody noticed the potential vector miscompile from overflow until recently... So it seems unlikely that there's much demand for a vector sdiv optimization on arbitrary vector constants, so just limit the matching to splat constants to avoid the possible bug. Differential Revision: https://reviews.llvm.org/D60426 llvm-svn: 358005
-
Sanjay Patel authored
llvm-svn: 358003
-
Chen Zheng authored
llvm-svn: 358000
-
Sanjay Patel authored
PR41425: https://bugs.llvm.org/show_bug.cgi?id=41425 llvm-svn: 357953
-
- Apr 08, 2019
-
-
Sanjay Patel authored
A more general canonicalization between fdiv and fmul would not handle this case because that would have to be limited by uses to prevent 2 values from becoming 3 values: (x/y) * (x/y) --> (x*x) / (y*y) (But we probably should still have that limited -- but more general -- canonicalization independently of this change.) llvm-svn: 357943
-
Sanjay Patel authored
llvm-svn: 357939
-
Nikita Popov authored
Overflow conditions for sadd.sat and ssub.sat which can be determined based on constant ranges, but not necessarily known bits. llvm-svn: 357938
-
Sanjay Patel authored
As the TODO indicates, instsimplify could be improved. Should fix: https://bugs.llvm.org/show_bug.cgi?id=41419 llvm-svn: 357910
-
Simon Pilgrim authored
First step towards removing the MOVMSK intrinsics completely - this patch expands MOVMSK to the pattern: e.g. PMOVMSKB(v16i8 x): %cmp = icmp slt <16 x i8> %x, zeroinitializer %int = bitcast <16 x i8> %cmp to i16 %res = zext i16 %int to i32 Which is correctly handled by ISel and FastIsel (give or take an annoying movzx move....): https://godbolt.org/z/rkrSFW Differential Revision: https://reviews.llvm.org/D60256 llvm-svn: 357909
-
Chen Zheng authored
Differential Revision: https://reviews.llvm.org/D60396 llvm-svn: 357904
-
Chen Zheng authored
llvm-svn: 357894
-
Chen Zheng authored
llvm-svn: 357884
-