OSDN Git Service
Artur Pilipenko [Mon, 22 May 2017 12:01:32 +0000 (12:01 +0000)]
[LoopPredication] NFC. Move a nested struct declaration before the fields, clang-format a bit
This will simplify the diff for an upcoming review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303543
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 22 May 2017 10:14:33 +0000 (10:14 +0000)]
Revert r303259 - [globalisel][tablegen] Import rules containing intrinsic_wo_chain.
It's causing some buildbots to timeout whenever tablegen needs re-compilation,
particularly those with -fsanitize=memory but not only them. A compile time
regression was expected since it triples the amount of SelectionDAG rules we
are able to import but it's currently too high.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303542
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Mon, 22 May 2017 09:42:07 +0000 (09:42 +0000)]
Re-apply r302416: [ARM] Clear the constant pool cache on explicit .ltorg directives
Re-applying now that PR32825 which was raised on the commit this fixed up is now known to have also been fixed by this commit.
Original commit message:
Multiple ldr pseudoinstructions with the same constant value will
reuse the same constant pool entry. However, if the constant pool
is explicitly flushed with a .ltorg directive, we should not try
to reference constants in the previous pool any longer, since they
may be out of range.
This fixes assembling hand-written assembler source which repeatedly
loads the same constant value, across a binary size larger than the
pc-relative fixup range for ldr instructions (4096 bytes). Such
assembler source already uses explicit .ltorg instructions to emit
constant pools with regular intervals. However if we try to reuse
constants emitted in earlier pools, they end up out of range.
This makes the output of the testcase match what binutils gas does
(prior to this patch, it would fail to assemble).
Differential Revision: https://reviews.llvm.org/D32847
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303540
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Mon, 22 May 2017 09:42:01 +0000 (09:42 +0000)]
Re-apply r286006: Fix 24560: assembler does not share constant pool for same constants
Re-applying now that the open bug on this commit, PR32825, is known to be fixed.
Original commit message:
Summary: This patch returns the same label if the CP entry with the same value has been created.
Reviewers: eli.friedman, rengolin, jmolloy
Subscribers: majnemer, jmolloy, llvm-commits
Differential Revision: https://reviews.llvm.org/D25804
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303539
91177308-0d34-0410-b5e6-
96231b3b80d8
Strahinja Petrovic [Mon, 22 May 2017 09:06:44 +0000 (09:06 +0000)]
[MIPS] Add support to match more patterns for DINS instruction
This patch adds support for recognizing patterns to match
DINS instruction.
Differential Revision: https://reviews.llvm.org/D31465
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303537
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Mon, 22 May 2017 08:49:28 +0000 (08:49 +0000)]
Revert "[ARM] Clear the constant pool cache on explicit .ltorg directives"
This reverts commit r302416. This was a fixup for r286006, which has now been reverted so this doesn't apply (either in concept or in code).
This commit itself has no problems, but the underlying issue it was fixing has now disappeared from the codebase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303536
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Mon, 22 May 2017 08:42:47 +0000 (08:42 +0000)]
Revert "Fix 24560: assembler does not share constant pool for same constants"
This reverts commit r286006. It caused PR32825 and wasn't fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303535
91177308-0d34-0410-b5e6-
96231b3b80d8
Amaury Sechet [Mon, 22 May 2017 07:49:16 +0000 (07:49 +0000)]
Regenerate expected result for test constant-combines.ll . NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303533
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 22 May 2017 07:02:47 +0000 (07:02 +0000)]
libDebugInfo/DWARF: Apply relocations for debug_addr addresses in object files
llvm-symbolizer would fail to symbolize addresses in unlinked object
files when handling .dwo file data because the addresses would not be
relocated in the same way as the ranges in the skeleton CU in the object
file.
Fix that so object files can be symbolized the same as executables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303532
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 22 May 2017 06:46:04 +0000 (06:46 +0000)]
[SCEV] Clarify behavior around max backedge taken count
This is a re-application of a r303497 that was reverted in r303498.
I thought it had broken a bot when it had not (the breakage did not
go away with the revert).
This change makes the split between the "exact" backedge taken count
and the "maximum" backedge taken count a bit more obvious. Both of
these are upper bounds on the number of times the loop header
executes (since SCEV does not account for most kinds of abnormal
control flow), but the latter is guaranteed to be a constant.
There were a few places where the max backedge taken count *was* a
non-constant; I've changed those to compute constants instead.
At this point, I'm not sure if the constant max backedge count can be
computed by calling `getUnsignedRange(Exact).getUnsignedMax()` without
losing precision. If it can, we can simplify even further by making
`getMaxBackedgeTakenCount` a thin wrapper around
`getBackedgeTakenCount` and `getUnsignedRange`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303531
91177308-0d34-0410-b5e6-
96231b3b80d8
Zvi Rackover [Mon, 22 May 2017 06:39:12 +0000 (06:39 +0000)]
[X86] Add (ix bitcast(vsetcc)) test cases with illegal types. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303530
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 22 May 2017 06:25:31 +0000 (06:25 +0000)]
[InstCombine] Cleanup the interface for overflow checks
Summary:
Fix naming conventions and const correctness.
This completes the changes made in rL303029.
Patch by Yoav Ben-Shalom.
Reviewers: craig.topper
Reviewed By: craig.topper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33377
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303529
91177308-0d34-0410-b5e6-
96231b3b80d8
Amaury Sechet [Mon, 22 May 2017 06:06:45 +0000 (06:06 +0000)]
Add a test case for large integer subtraction via subcarry. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303528
91177308-0d34-0410-b5e6-
96231b3b80d8
Amaury Sechet [Mon, 22 May 2017 02:31:42 +0000 (02:31 +0000)]
Add test case for subcarry optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303525
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 22 May 2017 00:49:35 +0000 (00:49 +0000)]
[SimplifyCFG] Prevent a few APInt copies on method calls that return const reference. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303523
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 22 May 2017 00:49:33 +0000 (00:49 +0000)]
[KnownBits] Use isNegative/isNonNegative to shorten some code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303522
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Sun, 21 May 2017 23:41:58 +0000 (23:41 +0000)]
NewGVN: Fix PR 33116, the memoryphi version of bug 32838.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303521
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Sun, 21 May 2017 23:41:56 +0000 (23:41 +0000)]
NewGVN: Cleanup some repeated code using some templated helpers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303520
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Sun, 21 May 2017 23:41:53 +0000 (23:41 +0000)]
NewGVN: Fix printing of simplified expression
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303519
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Sun, 21 May 2017 23:41:51 +0000 (23:41 +0000)]
SmallPtrSetImpl/SmallPtrSet: Add a public value_type and key_type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303518
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sun, 21 May 2017 20:55:53 +0000 (20:55 +0000)]
[NewGVN] Actually check the NewGVN output.
Apparently I messed up squashing two consecutive commits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303516
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sun, 21 May 2017 20:50:16 +0000 (20:50 +0000)]
[NewGVN] Add a test for non most dominating leader.
Taken from PR32845. Dan removed the most dominating leader check
in r303443, but we check this test anyway to make sure things
don't regress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303515
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sun, 21 May 2017 20:30:27 +0000 (20:30 +0000)]
[InstCombine] Take in account the size in sext->lshr->trunc patterns.
Otherwise we end up miscompiling, transforming:
define i8 @tinky() {
%sext = sext i1 1 to i16
%hibit = lshr i16 %sext, 15
%tr = trunc i16 %hibit to i8
ret i8 %tr
}
into:
%sext = sext i1 1 to i8
ret i8 %sext
and the first get folded to ret i8 1, while the second gets folded
to ret i8 -1.
Eventually we should get rid of this transform entirely, but for now,
this at least fixes a know correctness bug.
Differential Revision: https://reviews.llvm.org/D33338
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303513
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 21 May 2017 15:18:52 +0000 (15:18 +0000)]
[InstCombine] add tests for potential (lshr(sext X), C) folds; NFC
As discussed in:
https://reviews.llvm.org/D33338
...we may be able to remove a wider pattern match by doing these more
basic canonicalizations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303504
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Sun, 21 May 2017 11:13:56 +0000 (11:13 +0000)]
[GlobalISel][X86] Fix G_TRUNC instruction selection.
Updated tests with -verify-machineinstrs flag.
It fixes 3 tests failed with machine verifier enabled and listed
in PR27481
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303502
91177308-0d34-0410-b5e6-
96231b3b80d8
Hiroshi Inoue [Sun, 21 May 2017 06:00:05 +0000 (06:00 +0000)]
Summary
PPC backend eliminates compare instructions by using record-form instructions in PPCInstrInfo::optimizeCompareInstr, which is called from peephole optimization pass.
This patch improves this optimization to eliminate more compare instructions in two types of common case.
- comparison against a constant 1 or -1
The record-form instructions set CR bit based on signed comparison against 0. So, the current implementation does not exploit the record-form instruction for comparison against a non-zero constant.
This patch enables record-form optimization for constant of 1 or -1 if possible; it changes the condition "greater than -1" into "greater than or equal to 0" and "less than 1" into "less than or equal to 0".
With this patch, compare can be eliminated in the following code sequence, as an example.
uint64_t a, b;
if ((a | b) & 0x8000000000000000ull) { ... }
else { ... }
- andi for 32-bit comparison on PPC64
Since record-form instructions execute 64-bit signed comparison and so we have limitation in eliminating 32-bit comparison, i.e. with cmplwi, using the record-form. The original implementation already has such checks but andi. is not recognized as an instruction which executes implicit zero extension and hence safe to convert into record-form if used for equality check.
%1 = and i32 %a, 10
%2 = icmp ne i32 %1, 0
br i1 %2, label %foo, label %bar
In this simple example, LLVM generates andi. + cmplwi + beq on PPC64.
This patch make it possible to eliminate the cmplwi for this case.
I added andi. for optimization targets if it is safe to do so.
Differential Revision: https://reviews.llvm.org/D30081
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303500
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Sun, 21 May 2017 05:31:29 +0000 (05:31 +0000)]
[Docs] Fix LangRef links referred in GetElementPtr.rst
Patch by chenwj!
Differential Revision: https://reviews.llvm.org/D32929
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303499
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 21 May 2017 05:02:12 +0000 (05:02 +0000)]
Revert "[SCEV] Clarify behavior around max backedge taken count"
This reverts commit r303497 since it breaks the msan bootstrap bot:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/1379/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303498
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 21 May 2017 01:47:50 +0000 (01:47 +0000)]
[SCEV] Clarify behavior around max backedge taken count
This change makes the split between the "exact" backedge taken count
and the "maximum" backedge taken count a bit more obvious. Both of
these are upper bounds on the number of times the loop header
executes (since SCEV does not account for most kinds of abnormal
control flow), but the latter is guaranteed to be a constant.
There were a few places where the max backedge taken count *was* a
non-constant; I've changed those to compute constants instead.
At this point, I'm not sure if the constant max backedge count can be
computed by calling `getUnsignedRange(Exact).getUnsignedMax()` without
losing precision. If it can, we can simplify even further by making
`getMaxBackedgeTakenCount` a thin wrapper around
`getBackedgeTakenCount` and `getUnsignedRange`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303497
91177308-0d34-0410-b5e6-
96231b3b80d8
Xin Tong [Sun, 21 May 2017 00:37:55 +0000 (00:37 +0000)]
Revert "Add pthread_self function prototype and make it speculatable."
This reverts commit
143d7445b5dfa2f6d6c45bdbe0433d9fc531be21.
Build breaking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303496
91177308-0d34-0410-b5e6-
96231b3b80d8
Xin Tong [Sat, 20 May 2017 22:40:25 +0000 (22:40 +0000)]
Add pthread_self function prototype and make it speculatable.
Summary: This allows pthread_self to be pulled out of a loop by LICM.
Reviewers: hfinkel, arsenm, davide
Reviewed By: davide
Subscribers: davide, wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D32782
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303495
91177308-0d34-0410-b5e6-
96231b3b80d8
Martell Malone [Sat, 20 May 2017 21:54:15 +0000 (21:54 +0000)]
COFF: Fix another StringRef return error
This should appease the lld build bot regression
Following up on rL303493
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303494
91177308-0d34-0410-b5e6-
96231b3b80d8
Martell Malone [Sat, 20 May 2017 21:00:36 +0000 (21:00 +0000)]
COFF: Fix single StringRef return error
This should appease the lld build bot regression
Intrroduced by rL303490
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303493
91177308-0d34-0410-b5e6-
96231b3b80d8
Martell Malone [Sat, 20 May 2017 19:56:29 +0000 (19:56 +0000)]
COFF: migrate def parser from LLD to LLVM [1/2]
This is split up into two commits.
The will create the DEF parser in LLVM.
Check the following commit to see the removal from LLD
Reviewers: ruiu
Differential Revision: https://reviews.llvm.org/D32689
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303490
91177308-0d34-0410-b5e6-
96231b3b80d8
Xin Tong [Sat, 20 May 2017 19:40:24 +0000 (19:40 +0000)]
Fix test typo. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303489
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 20 May 2017 05:25:19 +0000 (05:25 +0000)]
Docs: Fix pluralization in CMake docs
Fixed "most platform" to read "most platforms", and changed "are not
using the same" to "use different" as a drive-by.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303487
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Sat, 20 May 2017 04:52:29 +0000 (04:52 +0000)]
[docs] Small style nits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303486
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sat, 20 May 2017 03:32:51 +0000 (03:32 +0000)]
Fix -Wunneeded-internal-declaration by removing constant arrays only used in sizeof expressions, in favor of constants containing the size directly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303483
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sat, 20 May 2017 03:32:49 +0000 (03:32 +0000)]
llvm-symbolizer: Support multiple CUs in a single DWO file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303482
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Beckmann [Sat, 20 May 2017 01:49:19 +0000 (01:49 +0000)]
Add functionality to cvtres to parse all entries in res file.
Summary: Added the new modules in the Object/ folder. Updated the
llvm-cvtres interface as well, and added additional tests.
Subscribers: llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D33180
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303480
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Sat, 20 May 2017 01:28:52 +0000 (01:28 +0000)]
Fix breakage after r303461
- Improve wchar_t size predicitions based on target triple.
- Be less strict in wchar_t size verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303477
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 20 May 2017 00:46:54 +0000 (00:46 +0000)]
[NewGVN] Create a StoreExpression instead of a VariableExpression.
In the case where we have an operand defined by a lod of the
same memory location. Historically this was a VariableExpression
because we wanted to make sure they ended up in the same class,
but if we create the right expression, they end up in the same
class anyway.
Fixes PR32897. Thanks to Dan for the detailed discussion and the
fix suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303475
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 20 May 2017 00:24:04 +0000 (00:24 +0000)]
[NewGVN] Get rid of an assertion.
This was here because we don't want to switch leaders too much,
in order to avoid fixpoint(ing) issue, but it's not sure if it
matters in practice.
A first step towards fixing PR32897.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303473
91177308-0d34-0410-b5e6-
96231b3b80d8
Galina Kistanova [Sat, 20 May 2017 00:02:08 +0000 (00:02 +0000)]
Cosmetic. Added braces to address gcc warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303471
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Sat, 20 May 2017 00:00:08 +0000 (00:00 +0000)]
Revert "Revert "ThinLTO: Verify bitcode before lauching the ThinLTOCodeGenerator.""
This reapplies commit r303438 modified to not verify cross-imported
bitcode in FunctionImporter.
rdar://problem/
31233625
Differential Revision: https://reviews.llvm.org/D33370
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303470
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 19 May 2017 23:32:21 +0000 (23:32 +0000)]
Revert "ThinLTO: Verify bitcode before lauching the ThinLTOCodeGenerator."
This reverts commit r303438 while deliberating buildbot breakage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303467
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 19 May 2017 22:37:09 +0000 (22:37 +0000)]
SimplifyLibCalls: Optimize wcslen
Refactor the strlen optimization code to work for both strlen and wcslen.
This especially helps with programs in the wild where people pass
L"string"s to const std::wstring& function parameters and the wstring
constructor gets inlined.
This also fixes a lingerind API problem/bug in getConstantStringInfo()
where zeroinitializers would always give you an empty string (without a
length) back regardless of the actual length of the initializer which
did not work well in the TrimAtNul==false causing the PR mentioned
below.
Note that the fixed getConstantStringInfo() needed fixes to SelectionDAG
memcpy lowering and may lead to some cases for out-of-bounds
zeroinitializer accesses not getting optimized anymore. So some code
with UB may produce out of bound memory reads now instead of just
producing zeros.
The refactoring "accidentally" fixes http://llvm.org/PR32124
Differential Revision: https://reviews.llvm.org/D32839
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303461
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 19 May 2017 22:37:01 +0000 (22:37 +0000)]
Verifier: Check wchar_size module flag.
Differential Revision: https://reviews.llvm.org/D32974
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303460
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 19 May 2017 22:23:47 +0000 (22:23 +0000)]
Fix off-by-one bug in AttributeList::addAttributes index handling
getParamAlignment expects an argument number, not an AttributeList
index.
Johan Englan, who works on LDC, found this bug and told me about it off
list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303458
91177308-0d34-0410-b5e6-
96231b3b80d8
Galina Kistanova [Fri, 19 May 2017 21:08:28 +0000 (21:08 +0000)]
Added LLVM_FALLTHROUGH to address gcc warning: this statement may fall through.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303457
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Fri, 19 May 2017 20:58:48 +0000 (20:58 +0000)]
[safestack] Disable stack coloring by default.
Workaround for apparent miscompilation of PR32143.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303456
91177308-0d34-0410-b5e6-
96231b3b80d8
Galina Kistanova [Fri, 19 May 2017 20:31:51 +0000 (20:31 +0000)]
Added missing break.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303454
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Fri, 19 May 2017 20:22:20 +0000 (20:22 +0000)]
NewGVN: Fix PR32838.
This is a complicated bug involving two issues:
1. What do we do with phi nodes when we prove all arguments are not
live?
2. When is it safe to use value leaders to determine if we can ignore
an argumnet?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303453
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Fri, 19 May 2017 20:22:14 +0000 (20:22 +0000)]
NewGVN: Print out the StoredValue of a StoreExpression
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303452
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 19 May 2017 19:47:29 +0000 (19:47 +0000)]
Fix line-endings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303448
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 19 May 2017 19:41:11 +0000 (19:41 +0000)]
[InstCombine] *Actually* commit the test showing the miscompile.
Clarify a comment while I'm here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303447
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 19 May 2017 19:26:58 +0000 (19:26 +0000)]
Resubmit "[CodeView] Provide a common interface for type collections."
This was originally reverted because it was a breaking a bunch
of bots and the breakage was not surfacing on Windows. After much
head-scratching this was ultimately traced back to a bug in the
lit test runner related to its pipe handling. Now that the bug
in lit is fixed, Windows correctly reports these test failures,
and as such I have finally (hopefully) fixed all of them in this
patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303446
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 19 May 2017 19:23:24 +0000 (19:23 +0000)]
[InstCombine] Add tests to demonstrate the miscompile in PR33078.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303445
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Fri, 19 May 2017 19:01:27 +0000 (19:01 +0000)]
Last of the major pieces to NewGVN - yay!
Summary:
NewGVN: Handle equivalence between phi of ops and op of phis.
This makes our GVN mostly-complete. It would be complete, modulo some
deliberate choices we make. This means it detects roughly all herband
equivalences in polynomial time, including cases notoriously hard for
other GVN's to detect. It also detects a very large swath of the
cases we currently rely on instcombine to detect that involve folding
upwards through phis.
Fixes PR 31125, 31463, PR 31868
Reviewers: davide
Subscribers: Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D32151
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303444
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Fri, 19 May 2017 19:01:24 +0000 (19:01 +0000)]
NewGVN: Get rid of most dominating leader check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303443
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Fri, 19 May 2017 19:01:21 +0000 (19:01 +0000)]
BasicAA: Uninserted instructions have no parent, and notDifferentParent explicitly allows for this case, but getParent crashes when handed one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303442
91177308-0d34-0410-b5e6-
96231b3b80d8
Amaury Sechet [Fri, 19 May 2017 18:20:44 +0000 (18:20 +0000)]
[DAGCombine] (addcarry 0, 0, X) -> (ext/trunc X)
Summary:
While this makes some case better and some case worse - so it's unclear if it is a worthy combine just by itself - this is a useful canonicalisation.
As per discussion in D32756 .
Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32916
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303441
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 19 May 2017 18:12:07 +0000 (18:12 +0000)]
[lit] Take the last error when executing pipelines.
This seems to have been present since the beginning of time,
which is quite surprising. The symptom was this: Suppose you
have a test with a run line that looks like this:
RUN: foo | FileCheck %s
foo prints some output and then due to a bug in the program it
asserts. On Windows this results in the program returning a
negative exit code. But if enough output had been printed
already by the tool so that the FileCheck match would succeed
then FileCheck would return 0, and because of bad logic in
lit this 0 return value would overwrite the failed return
value from previous items in the pipeline. This only happened
with negative exit codes.
The most sensible behavior is to just take whatever the first
exit code is. There is no logical ordering defined on exit
codes, so comparing with < and > does not make a lot of sense.
Instead, as soon as we find the first non-successful return
value, that should be the result of the entire expression.
This fixes the issue, as now tests which fail on non-Windows
platforms also fail for me on Windows as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303440
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Thomas [Fri, 19 May 2017 18:00:30 +0000 (18:00 +0000)]
[NFC][loopIdiom] Clang format change rL303434
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303439
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 19 May 2017 17:55:02 +0000 (17:55 +0000)]
ThinLTO: Verify bitcode before lauching the ThinLTOCodeGenerator.
rdar://problem/
31233625
Differential Revision: https://reviews.llvm.org/D33151
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303438
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 19 May 2017 17:54:58 +0000 (17:54 +0000)]
Rewrite llvm-lto's codegen() using ThinCodeGenerator::run(). NFC-ish.
Differential Revision: https://reviews.llvm.org/D33360
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303437
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 19 May 2017 17:25:20 +0000 (17:25 +0000)]
Fix typo in test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303436
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 19 May 2017 17:19:26 +0000 (17:19 +0000)]
[X86][FMA] Tests showing missed fmsubadd opportunities (PR30633)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303435
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Thomas [Fri, 19 May 2017 17:05:36 +0000 (17:05 +0000)]
[LoopIdiom] Refactor return value of isLegalStore [NFC]
Summary:
This NFC simply refactors the return value of LoopIdiomRecognize::isLegalStore() from bool to an enumeration, and
removes the return-through-parameter mechanism that the function was using. This function is constructed such that it will
only ever recognize a single store idiom (memset, memset_pattern, or memcpy), and never a combination of these. As such it
makes much more sense for the return value to be the single idiom that the store matches, rather than
having a separate argument-return for each idiom -- it's cleaner, and makes it clearer that
only a single idiom can be matched.
Patch by Daniel Neilson!
Reviewers: anna, sanjoy, davide, haicheng
Reviewed By: anna, haicheng
Subscribers: haicheng, mzolotukhin, llvm-commits
Differential Revision: https://reviews.llvm.org/D33359
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303434
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 19 May 2017 16:56:53 +0000 (16:56 +0000)]
[InstSimplify] Fix 80 column violation. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303433
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 19 May 2017 16:43:54 +0000 (16:43 +0000)]
[APInt] Add support for dividing or remainder by a uint64_t or int64_t.
Summary:
This patch adds udiv/sdiv/urem/srem/udivrem/sdivrem methods that can divide by a uint64_t. This makes division consistent with all the other arithmetic operations.
This modifies the interface of the divide helper method to work on raw arrays instead of APInts. This way we can pass the uint64_t in for the RHS without wrapping it in an APInt. This required moving all the Quotient and Remainder allocation handling up to the callers. For udiv/urem this was as simple as just creating the Quotient/Remainder with the right size when they were declared. For udivrem we have to rely on reallocate not changing the contents of the variable LHS or RHS is aliased with the Quotient or Remainder APInts. We also have to zero the upper bits of Remainder and Quotient that divide doesn't write to if lhsWords/rhsWords is smaller than the width.
I've update the toString method to use the new udivrem.
Reviewers: hans, dblaikie, RKSimon
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33310
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303431
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitry Preobrazhensky [Fri, 19 May 2017 14:27:52 +0000 (14:27 +0000)]
[AMDGPU][MC] Corrected disassembler to decode instructions with 2 literals
See bug 32922: https://bugs.llvm.org//show_bug.cgi?id=32922
Reviewers: artem.tamazov, vpykhtin
Differential Revision: https://reviews.llvm.org/D32912
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303428
91177308-0d34-0410-b5e6-
96231b3b80d8
Artur Pilipenko [Fri, 19 May 2017 14:02:46 +0000 (14:02 +0000)]
[LoopPredication] NFC. Extract LoopICmp struct and parseLoopICmp helper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303427
91177308-0d34-0410-b5e6-
96231b3b80d8
Artur Pilipenko [Fri, 19 May 2017 14:00:58 +0000 (14:00 +0000)]
[LoopPredication] NFC. Extract LoopPredication::expandCheck helper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303426
91177308-0d34-0410-b5e6-
96231b3b80d8
Artur Pilipenko [Fri, 19 May 2017 14:00:04 +0000 (14:00 +0000)]
[LoopPredication] NFC. Extract CanExpand helper lambda
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303425
91177308-0d34-0410-b5e6-
96231b3b80d8
Artur Pilipenko [Fri, 19 May 2017 13:59:34 +0000 (13:59 +0000)]
[LoopPredication] NFC. Add an early exit if there is no guards in the loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303424
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitry Preobrazhensky [Fri, 19 May 2017 13:36:09 +0000 (13:36 +0000)]
[AMDGPU][MC] Fixed bugs in export instruction
See Bugs 33019, 33056:
https://bugs.llvm.org//show_bug.cgi?id=33019
https://bugs.llvm.org//show_bug.cgi?id=33056
Reviewers: artem.tamazov, vpykhtin
Differential Revision: https://reviews.llvm.org/D33288
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303423
91177308-0d34-0410-b5e6-
96231b3b80d8
Guy Blank [Fri, 19 May 2017 12:35:15 +0000 (12:35 +0000)]
[X86][AVX512] Make i1 illegal in the CodeGen
This patch defines the i1 type as illegal in the X86 backend for AVX512.
For DAG operations on <N x i1> types (build vector, extract vector element, ...) i8 is used, and should be truncated/extended.
This should produce better scalar code for i1 types since GPRs will be used instead of mask registers.
Differential Revision: https://reviews.llvm.org/D32273
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303421
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 19 May 2017 11:08:33 +0000 (11:08 +0000)]
[globalisel][tablegen] Demote OptForSize/OptForMinSize/ForCodeSize to per-function predicates.
Summary:
This causes them to be re-computed more often than necessary but resolves
objections that were raised post-commit on r301750.
Reviewers: qcolombet, ab, t.p.northover, rovka, kristof.beyls
Reviewed By: qcolombet
Subscribers: igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D32861
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303418
91177308-0d34-0410-b5e6-
96231b3b80d8
Amara Emerson [Fri, 19 May 2017 10:40:18 +0000 (10:40 +0000)]
Fix vector pass-through value being unused in IRBuilder::CreateMaskedGather
Also s/0/nullptr in the call site in LV.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303416
91177308-0d34-0410-b5e6-
96231b3b80d8
Volkan Keles [Fri, 19 May 2017 09:47:02 +0000 (09:47 +0000)]
[GlobalISel] IRTranslator: Translate ConstantStruct
Reviewers: qcolombet, ab, t.p.northover, aditya_nandakumar, dsanders
Reviewed By: qcolombet
Subscribers: rovka, kristof.beyls, javed.absar, igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D33317
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303412
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 19 May 2017 07:37:25 +0000 (07:37 +0000)]
[APInt] Use b.negate() in place of b = -std::move(b). NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303411
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 19 May 2017 06:25:09 +0000 (06:25 +0000)]
Fix compilation failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303410
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 19 May 2017 05:57:45 +0000 (05:57 +0000)]
Revert "[CodeView] Provide a common interface for type collections."
This is a squash of ~5 reverts of, well, pretty much everything
I did today. Something is seriously broken with lit on Windows
right now, and as a result assertions that fire in tests are
triggering failures. I've been breaking non-Windows bots all
day which has seriously confused me because all my tests have
been passing, and after running lit with -a to view the output
even on successful runs, I find out that the tool is crashing
and yet lit is still reporting it as a success!
At this point I don't even know where to start, so rather than
leave the tree broken for who knows how long, I will get this
back to green, and then once lit is fixed on Windows, hopefully
hopefully fix the remaining set of problems for real.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303409
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 19 May 2017 05:18:09 +0000 (05:18 +0000)]
Don't crash if someone tries to visit an empty type stream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303408
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 19 May 2017 04:56:48 +0000 (04:56 +0000)]
[CodeView] Reduce memory usage in TypeSerializer.
We were using a BumpPtrAllocator to allocate stable storage for
a record, then trying to insert that into a hash table. If a
collision occurred, the bytes were never inserted and the
allocation was unnecessary. At the cost of an extra hash
computation, check first if it exists, and only if it does do
we allocate and insert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303407
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 19 May 2017 04:06:10 +0000 (04:06 +0000)]
[NewGVN] Delete the old store when we find congruent to a load.
(or non-store, more in general). Fixes PR33086. Caught by the
store verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303406
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 19 May 2017 03:04:08 +0000 (03:04 +0000)]
Fix a broken test.
Similar to my previous fix, it turns out llvm-pdbdump has been
printing an incorrect value since the beginning of time, but
we didn't know it was incorrect. Specifically, we were interpreting
a TypeIndex as referencing a type from the TPI stream when it
actually should come from the IPI stream. So we were printing a
string that looked like a valid string, but was just from the
wrong place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303403
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Fri, 19 May 2017 02:56:37 +0000 (02:56 +0000)]
Revert "[ADT] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC)."
This reverts commit r303383.
This breaks the modules-enabled macOS build with:
lib/Support/LockFileManager.cpp:86:7: error: declaration of 'gethostuuid' must be imported from module 'Darwin.POSIX.unistd' before it is required
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303402
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 19 May 2017 00:56:39 +0000 (00:56 +0000)]
Fix crasher in CodeView test.
Apparently this was always broken, but previously we were more
graceful about it and we would print "unknown udt" if we couldn't
find the type index, whereas now we just segfault because we
assume it's valid. But this exposed a real bug, which is that
we weren't looking in the right place. So fix that, and also
fix this crash at the same time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303397
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 19 May 2017 00:18:03 +0000 (00:18 +0000)]
LiveIntervalAnalysis: Fix missing case in pruneSubRegValues()
pruneSubRegValues() needs to remove subregister ranges starting at
instructions that later get removed by eraseInstrs(). It missed to check
one case in which eraseInstrs() would remove an instruction.
Fixes http://llvm.org/PR32688
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303396
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 19 May 2017 00:17:59 +0000 (00:17 +0000)]
Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303395
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 18 May 2017 23:30:51 +0000 (23:30 +0000)]
Fix another warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303394
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Thu, 18 May 2017 23:22:44 +0000 (23:22 +0000)]
[NewGVN] Break infinite recursion in singleReachablePHIPath().
We can have cycles between PHIs and this causes singleReachablePhi()
to call itself indefintely (until we run out of stack). The proper
solution would be that of computing SCCs, but it's not worth for
now, so just keep a visited set and give up when we find a cycle.
Thanks to Dan for the discussion/help with this.
Fixes PR33014.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303393
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 18 May 2017 23:12:42 +0000 (23:12 +0000)]
Fix some build errors and warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303391
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 18 May 2017 23:04:08 +0000 (23:04 +0000)]
[CodeView] Raise the source to ID map out of the TypeStreamMerger.
This map will be needed to rewrite symbol streams after re-writing
the corresponding type streams.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303390
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 18 May 2017 23:03:41 +0000 (23:03 +0000)]
[llvm-pdbdump] Add the ability to merge PDBs.
Merging PDBs is a feature that will be used heavily by
the linker. The functionality already exists but does not
have deep test coverage because it's not easily exposed through
any tools. This patch aims to address that by adding the
ability to merge PDBs via llvm-pdbdump. It takes arbitrarily
many PDBs and outputs a single PDB.
Using this new functionality, a test is added for merging
type records. Future patches will add the ability to merge
symbol records, module information, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303389
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 18 May 2017 23:03:06 +0000 (23:03 +0000)]
[CodeView] Provide a common interface for type collections.
Right now we have multiple notions of things that represent collections of
types. Most commonly used are TypeDatabase, which is supposed to keep
mappings from TypeIndex to type name when reading a type stream, which
happens when reading PDBs. And also TypeTableBuilder, which is used to
build up a collection of types dynamically which we will later serialize
(i.e. when writing PDBs).
But often you just want to do some operation on a collection of types, and
you may want to do the same operation on any kind of collection. For
example, you might want to merge two TypeTableBuilders or you might want
to merge two type streams that you loaded from various files.
This dichotomy between reading and writing is responsible for a lot of the
existing code duplication and overlapping responsibilities in the existing
CodeView library classes. For example, after building up a
TypeTableBuilder with a bunch of type records, if we want to dump it we
have to re-invent a bunch of extra glue because our dumper takes a
TypeDatabase or a CVTypeArray, which are both incompatible with
TypeTableBuilder.
This patch introduces an abstract base class called TypeCollection which
is shared between the various type collection like things. Wherever we
previously stored a TypeDatabase& in some common class, we now store a
TypeCollection&.
The advantage of this is that all the details of how the collection are
implemented, such as lazy deserialization of partial type streams, is
completely transparent and you can just treat any collection of types the
same regardless of where it came from.
Differential Revision: https://reviews.llvm.org/D33293
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303388
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 18 May 2017 22:47:57 +0000 (22:47 +0000)]
[InstCombine] add more tests for xor-of-icmps; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303387
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Thu, 18 May 2017 21:43:23 +0000 (21:43 +0000)]
[NewGVN] Replace predicate info leftovers.
This time with an additional fix, i.e. we remove the dead
@llvm.ssa.copy instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303385
91177308-0d34-0410-b5e6-
96231b3b80d8