summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/MergeICmps.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [MergeICmps] Don't crash when memcmp is not availableBenjamin Kramer2018-05-191-0/+4
| | | | | | Fixes clang crashing with -fno-builtin, PR37527. llvm-svn: 332808
* Rename DEBUG macro to LLVM_DEBUG.Nicola Zaghen2018-05-141-49/+52
| | | | | | | | | | | | | | | | The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM - Manual change to APInt - Manually chage DOCS as regex doesn't match it. In the transition period the DEBUG() macro is still present and aliased to the LLVM_DEBUG() one. Differential Revision: https://reviews.llvm.org/D43624 llvm-svn: 332240
* [NFC] fix trivial typos in document and commentsHiroshi Inoue2018-04-141-1/+1
| | | | | | "not not" -> "not" etc llvm-svn: 330083
* [Transforms] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-04-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort. Refer the comments section in D44363 for a list of all the required patches. Reviewers: kcc, pcc, danielcdh, jmolloy, sanjoy, dberlin, ruiu Reviewed By: ruiu Subscribers: ruiu, llvm-commits Differential Revision: https://reviews.llvm.org/D45142 llvm-svn: 330059
* [MergeICmp] Update debug msg.NFCXin Tong2018-04-091-1/+1
| | | | llvm-svn: 329572
* [MergeICmp] Split blocks that do other work.Xin Tong2018-04-091-19/+118
| | | | | | | | | | | | | | | Summary: We do not try to move the instructions and split the block till we know the blocks can be split, i.e. BCE-cmp-insts can be separated from non-BCE-cmp-insts. Reviewers: davide, courbet Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44443 llvm-svn: 329564
* 80-line wrap. NFCXin Tong2018-03-271-1/+2
| | | | llvm-svn: 328660
* [MergeICmps] Break eargerly out of loopXin Tong2018-03-201-0/+1
| | | | llvm-svn: 327972
* [MergeICmp] Fix a bug in entry block shuffled to middle of the chainXin Tong2018-03-201-0/+11
| | | | | | | | | | | | Summary: Fix a bug in entry block shuffled to middle of the chain. Reviewers: davide, courbet Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44642 llvm-svn: 327971
* [MergeICmps] Make sure that the comparison only has one use.Clement Courbet2018-03-131-0/+9
| | | | | | | | | | | | Summary: Fixes PR36557. Reviewers: trentxintong, spatel Subscribers: mstorsjo, llvm-commits Differential Revision: https://reviews.llvm.org/D44083 llvm-svn: 327372
* [MergeICmp] Simplify how BCECmpBlock instructions are blacklistedXin Tong2018-03-061-10/+4
| | | | llvm-svn: 326761
* [MergeICmp] Fix printing. NFCXin Tong2018-03-061-1/+1
| | | | llvm-svn: 326760
* [MergeICmp] We can discard initial blocks that do other workXin Tong2018-03-051-3/+8
| | | | | | | | | | | | | | | | Summary: We can discard initial blocks that do other work We do not need to limit ourselves to just the first block in the chain. Reviewers: courbet, davide Reviewed By: courbet Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44029 llvm-svn: 326698
* [MergeICmps][NFC] Improve logging.Clement Courbet2018-03-051-7/+9
| | | | llvm-svn: 326683
* Fix typo. NFCXin Tong2018-02-281-1/+1
| | | | llvm-svn: 326319
* [MergeICmp] Fix a bug in MergeICmp that can lead to a block being processed ↵Xin Tong2018-02-281-0/+13
| | | | | | | | | | | | | | | | | | | | | more than once. Summary: Fix a bug in MergeICmp that can lead to a BCECmp block being processed more than once and eventually lead to a broken LLVM module. The problem is that if the non-constant value is not produced by the last block, the producer will be processed once when the its parent block is processed and second time when the last block is processed. We end up having 2 same BCECmpBlock in the merge queue. And eventually lead to a broken LLVM module. Reviewers: courbet, davide Reviewed By: courbet Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D43825 llvm-svn: 326318
* [MergeICmps] Handle chains with several complex BCE basic blocks.Clement Courbet2018-02-061-3/+4
| | | | | | | | | | - Fix condition for detecting that a complex basic block was the first in the chain. - Add tests. This was caught by buildbots when submitting rL324319. llvm-svn: 324341
* [MergeICmps][NFC] Add more assertions.Clement Courbet2018-02-061-0/+4
| | | | llvm-svn: 324323
* [NFC] fix trivial typos in commentsHiroshi Inoue2018-01-191-2/+2
| | | | | | "the the" -> "the" llvm-svn: 322934
* Remove redundant includes from lib/Transforms.Michael Zolotukhin2017-12-131-2/+0
| | | | llvm-svn: 320628
* [CodeGen][ExpandMemcmp] Allow memcmp to expand to vector loads (2).Clement Courbet2017-10-301-2/+1
| | | | | | | | | | | | - Targets that want to support memcmp expansions now return the list of supported load sizes. - Expansion codegen does not assume that all power-of-two load sizes smaller than the max load size are valid. For examples, this is not the case for x86(32bit)+sse2. Fixes PR34887. llvm-svn: 316905
* [Transforms] Revert r316630 changes in Scalar/MergeICmps.cpp to fix broken ↵Eugene Zelenko2017-10-261-62/+31
| | | | | | build bots (NFC). llvm-svn: 316634
* [Transforms] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko2017-10-261-31/+62
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 316630
* Re-land "[MergeICmps] Disable mergeicmps if the target does not want to ↵Clement Courbet2017-10-101-12/+36
| | | | | | | | | | handle memcmp expansion." (fixed stability issues) This reverts commit d6492333d3b478a1d88163315002022f8d5e58dc. llvm-svn: 315281
* Revert "[MergeICmps] Disable mergeicmps if the target does not want to ↵Clement Courbet2017-10-061-36/+12
| | | | | | | | | | handle memcmp expansion." Still a few stability issues on windows. This reverts commit 67e3db9bc121ba244e20337aabc7cf341a62b545. llvm-svn: 315058
* Re-land "[MergeICmps] Disable mergeicmps if the target does not want to ↵Clement Courbet2017-10-061-12/+36
| | | | | | | | | | handle memcmp expansion." (fixed unit tests by making comparisons stable) This reverts commit 1b2d359ce256fd6737da4e93833346a0bd6d7583. llvm-svn: 315056
* Revert "Re-land "[MergeICmps] Disable mergeicmps if the target does not want ↵Clement Courbet2017-10-051-25/+10
| | | | | | | | | | to handle memcmp expansion.""" broken test on windows This reverts commit c91479518344fd1fc071c5bd5848f6eb83e53dca. llvm-svn: 314985
* Re-land "[MergeICmps] Disable mergeicmps if the target does not want to ↵Clement Courbet2017-10-051-10/+25
| | | | | | handle memcmp expansion."" llvm-svn: 314980
* Revert "[MergeICmps] Disable mergeicmps if the target does not want to ↵Clement Courbet2017-10-051-15/+6
| | | | | | | | | | | handle memcmp expansion." Breaks clang-stage1-cmake-RA-incremental/llvm/test/Transforms/MergeICmps/X86/tuple-four-int8.ll This reverts commit 3038c459d67f8898ffa295d54a013b280690abfa. llvm-svn: 314972
* [MergeICmps] Disable mergeicmps if the target does not want to handle memcmp ↵Clement Courbet2017-10-051-6/+15
| | | | | | | | | | | | | | expansion. Summary: This is to avoid e.g. merging two cheap icmps if the target is not going to expand to something nice later. Reviewers: dberlin, spatel Subscribers: davide, nemanjai Differential Revision: https://reviews.llvm.org/D38232 llvm-svn: 314970
* [NFC] clang-format lib/Transforms/Scalar/MergeICmps.cppClement Courbet2017-10-041-39/+21
| | | | llvm-svn: 314906
* [MergeICmps] Fix build of rL312315 on clang-with-thin-lto-windows:Clement Courbet2017-09-011-2/+4
| | | | | | | | | | | | | | MergeICmps.cpp(68,15): error: chosen constructor is explicit in copy-initialization return {}; APInt.h(339,12): note: explicit constructor declared here explicit APInt() : BitWidth(1) { U.VAL = 0; } ^ MergeICmps.cpp(56,9): note: in implicit initialization of field 'Offset' with omitted initializer APInt Offset; ^ llvm-svn: 312326
* Reland rL312315: [MergeICmps] MergeICmps is a new optimization pass that ↵Clement Courbet2017-09-011-0/+645
| | | | | | | | | | turns chains of integer Add missing header. This reverts commit 86dd6335cf7607af22f383a9a8e072ba929848cf. llvm-svn: 312322
* Revert "[MergeICmps] MergeICmps is a new optimization pass that turns chains ↵Clement Courbet2017-09-011-641/+0
| | | | | | | | | | of integer" Break build This reverts commit d07ab866f7f88f81e49046d691a80dcd32d7198b. llvm-svn: 312317
* [MergeICmps] MergeICmps is a new optimization pass that turns chains of integerClement Courbet2017-09-011-0/+641
comparisons into memcmp. Thanks to recent improvements in the LLVM codegen, the memcmp is typically inlined as a chain of efficient hardware comparisons. This typically benefits C++ member or nonmember operator==(). For now this is disabled by default until: - https://bugs.llvm.org/show_bug.cgi?id=33329 is complete - Benchmarks show that this is always useful. Differential Revision: https://reviews.llvm.org/D33987 llvm-svn: 312315
OpenPOWER on IntegriCloud