OSDN Git Service

android-x86/external-llvm.git
5 years ago[WebAssembly] Remove friend18.C from list of known gcc torture test failures. NFC.
Sam Clegg [Fri, 10 May 2019 01:45:34 +0000 (01:45 +0000)]
[WebAssembly] Remove friend18.C from list of known gcc torture test failures. NFC.

Differential Revision: https://reviews.llvm.org/D61775

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360401 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm] X86DiscriminateMemOps: insert debug info when missing
Mircea Trofin [Fri, 10 May 2019 00:12:51 +0000 (00:12 +0000)]
[llvm] X86DiscriminateMemOps: insert debug info when missing

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: aprantl, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61735

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360396 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Pattern for v_xor3_b32
Stanislav Mekhanoshin [Fri, 10 May 2019 00:09:01 +0000 (00:09 +0000)]
[AMDGPU] Pattern for v_xor3_b32

This also allows three op patterns to use increased constant bus
limit of GFX10.

Differential Revision: https://reviews.llvm.org/D61763

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360395 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Improve lowering of idemptotent RMW operations
Philip Reames [Thu, 9 May 2019 23:23:42 +0000 (23:23 +0000)]
[X86] Improve lowering of idemptotent RMW operations

The current lowering uses an mfence. mfences are substaintially higher latency than the locked operations originally requested, but we do want to avoid contention on the original cache line. As such, use a locked instruction on a cache line assumed to be thread local.

Differential Revision: https://reviews.llvm.org/D58632

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360393 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[JITLink] Fixed a signedness bug when processing X86_64_RELOC_SUBTRACTOR.
Lang Hames [Thu, 9 May 2019 23:17:41 +0000 (23:17 +0000)]
[JITLink] Fixed a signedness bug when processing X86_64_RELOC_SUBTRACTOR.

Subtractor relocation addends are signed, so we need to read them via signed
int pointers. Accidentally treating 32-bit addends as unsigned leads to
out-of-range errors when we try to add very large (>INT32_MAX) bogus addends.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360392 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoCompile time tweak for libcall lookup
Philip Reames [Thu, 9 May 2019 23:13:09 +0000 (23:13 +0000)]
Compile time tweak for libcall lookup

If we have a large module which is mostly intrinsics, we hammer the lib call lookup path from CodeGenPrepare.  Adding a fastpath reduces compile by 15% for one such example.

The problem is really more general than intrinsics - a module with lots of non-intrinsics non-libcall calls has the same problem - but we might as well avoid an easy case quickly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360391 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ORC] Simplify logic for updating edges when should-discard atoms are pruned.
Lang Hames [Thu, 9 May 2019 22:03:58 +0000 (22:03 +0000)]
[ORC] Simplify logic for updating edges when should-discard atoms are pruned.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360384 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[JITLink] Improve/fix some JITLink debugging output.
Lang Hames [Thu, 9 May 2019 22:03:57 +0000 (22:03 +0000)]
[JITLink] Improve/fix some JITLink debugging output.

Adds full edge details (rather than just edge targets) when out-of-range errors
are generated. Also fixes a bug where debugging output accessed an invalidated
DenseMap iterator by moving the debugging output above the invalidation point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360383 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ORC] Fix a formatting bug.
Lang Hames [Thu, 9 May 2019 22:03:53 +0000 (22:03 +0000)]
[ORC] Fix a formatting bug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360382 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd ".dword" directive
Bill Wendling [Thu, 9 May 2019 21:57:44 +0000 (21:57 +0000)]
Add ".dword" directive

Summary:
The ".dword" directive is a synonym for ".xword" and is used used
by klibc, a minimalistic libc subset for initramfs.

Reviewers: t.p.northover, nickdesaulniers

Reviewed By: nickdesaulniers

Subscribers: nickdesaulniers, javed.absar, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61719

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360381 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agollvm-dwarfdump: Add dwo parsing to --statistics.
Caroline Tice [Thu, 9 May 2019 21:53:33 +0000 (21:53 +0000)]
llvm-dwarfdump: Add dwo parsing to --statistics.

Add check for, and parsing of, .dwo files to Statistics.cpp; create a new getNon
SkeletonUnitDie function for DWARFUnit.h

Reviewers: dblaikie

Differential Revision: https://review.llvm.org/D61755

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360380 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDebugInfo/DWARF: Minor expression simplification
David Blaikie [Thu, 9 May 2019 21:23:40 +0000 (21:23 +0000)]
DebugInfo/DWARF: Minor expression simplification

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360377 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUse UNSUPPORTED: windows in shtest-timeout.py. Apparently system-windows does not...
Stella Stamenova [Thu, 9 May 2019 20:22:02 +0000 (20:22 +0000)]
Use UNSUPPORTED: windows in shtest-timeout.py. Apparently system-windows does not cover all cases either and the case it doesn't cover affects one of the buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360373 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUse UNSUPPORTED: system-windows instead of REQUIRES: nowindows or UNSUPPORTED: window...
Stella Stamenova [Thu, 9 May 2019 19:40:21 +0000 (19:40 +0000)]
Use UNSUPPORTED: system-windows instead of REQUIRES: nowindows or UNSUPPORTED: windows. nowindows is not currently defined and windows does not cover all cases. system-windows is also consistent with how other platforms are used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360368 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeGen] Add comment about FSUB <-> FNEG xforms
Cameron McInally [Thu, 9 May 2019 19:28:52 +0000 (19:28 +0000)]
[CodeGen] Add comment about FSUB <-> FNEG xforms

Differential Revision: https://reviews.llvm.org/D61741

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360366 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] gfx1010 v_interp_* instructions
Stanislav Mekhanoshin [Thu, 9 May 2019 18:38:55 +0000 (18:38 +0000)]
[AMDGPU] gfx1010 v_interp_* instructions

Differential Revision: https://reviews.llvm.org/D61703

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360364 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][SSE] Fold add(shuffle(),shuffle()) to hadd on 'slow' targets (PR39920)
Simon Pilgrim [Thu, 9 May 2019 17:45:01 +0000 (17:45 +0000)]
[X86][SSE] Fold add(shuffle(),shuffle()) to hadd on 'slow' targets (PR39920)

As reported on PR39920, "slow horizontal ops" targets tend to internally expand to 2*shuffle+add/sub - so if we can reduce 2*shuffle+add/sub to a hadd/sub then we should do it - similar port usage but reduced instruction count.

This works out in most cases, although the "PR22377" regression in vector-shuffle-combining.ll is annoying - going from 2*shuffle+add+shuffle to hadd+2*shuffle - I've opened PR41813 to cover this.

Differential Revision: https://reviews.llvm.org/D61308

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360360 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAGCombiner] Limit number of nodes explored as store candidates.
Florian Hahn [Thu, 9 May 2019 17:05:52 +0000 (17:05 +0000)]
[DAGCombiner] Limit number of nodes explored as store candidates.

To find the candidates to merge stores we iterate over all nodes in a chain
for each store, which leads to quadratic compile times for large basic blocks
with a large number of stores.

Reviewers: niravd, spatel, craig.topper

Reviewed By: niravd

Differential Revision: https://reviews.llvm.org/D61511

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360357 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRe-enable lit test shtest-timeout.py on non-Windows.
Paul Robinson [Thu, 9 May 2019 17:01:03 +0000 (17:01 +0000)]
Re-enable lit test shtest-timeout.py on non-Windows.

It was disabled incorrectly, which meant it wasn't running anywhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360356 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] gfx1010 changes for PAL metadata
Stanislav Mekhanoshin [Thu, 9 May 2019 16:34:13 +0000 (16:34 +0000)]
[AMDGPU] gfx1010 changes for PAL metadata

Differential Revision: https://reviews.llvm.org/D61704

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360353 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-cxxfilt] Fix -Wshadow warning. NFCI.
Simon Pilgrim [Thu, 9 May 2019 15:58:16 +0000 (15:58 +0000)]
[llvm-cxxfilt] Fix -Wshadow warning. NFCI.

Local variable Decorated was shadowing the global variable Decorated

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360352 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MCA] Add support for nested and overlapping region markers
Andrea Di Biagio [Thu, 9 May 2019 15:18:09 +0000 (15:18 +0000)]
[MCA] Add support for nested and overlapping region markers

This patch fixes PR41523
https://bugs.llvm.org/show_bug.cgi?id=41523

Regions can now nest/overlap provided that they have different names.
Anonymous regions cannot overlap.

Region end markers must specify the region name. The only exception is for when
there is only one user-defined region; in that particular case, the region end
marker doesn't need to specify a name.

Incorrect region end markers are no longer ignored. Instead, the tool reports an
error and we exit with an error code.

Added test cases to verify the new diagnostic error messages.

Updated the llvm-mca docs to reflect this feature change.

Differential Revision: https://reviews.llvm.org/D61676

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360351 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMinidumpYAML: add support for the ThreadList stream
Pavel Labath [Thu, 9 May 2019 15:13:53 +0000 (15:13 +0000)]
MinidumpYAML: add support for the ThreadList stream

Summary:
The implementation is a pretty straightforward extension of the pattern
used for (de)serializing the ModuleList stream. Since there are other
streams which use the same format (MemoryList and MemoryList64, at
least). I tried to generalize the code a bit so that adding future
streams of this type can be done with less code.

Reviewers: amccarth, jhenderson, clayborg

Subscribers: markmentovai, lldb-commits, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61423

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360350 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeGenPrepare] Limit recursion depth for collectBitParts
David Stuttard [Thu, 9 May 2019 15:02:10 +0000 (15:02 +0000)]
[CodeGenPrepare] Limit recursion depth for collectBitParts

Summary:
Seeing some issues for windows debug pathological cases with collectBitParts
recursion (1525 levels of recursion!)
Setting the limit to 64 as this should be sufficient - passes all lit cases

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61728

Change-Id: I7f44cdc6c1badf1c2ccbf1b0c4b6afe27ecb39a1

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360347 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r960255
Nico Weber [Thu, 9 May 2019 14:14:21 +0000 (14:14 +0000)]
gn build: Merge r960255

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360343 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] AMD Piledriver (BdVer2): major cleanup (mainly inverse throughput)
Roman Lebedev [Thu, 9 May 2019 13:54:51 +0000 (13:54 +0000)]
[X86] AMD Piledriver (BdVer2): major cleanup (mainly inverse throughput)

I've started this cleanup more several times now, but got sidetracked
elsewhere, e.g. by llvm-exegesis problems. Not this time, finally!

This is mainly cleaning up the inverse throughput values,
and a few latencies/uops, based on the llvm-exegesis measured values.

Though this is not complete by any means,
there's certainly more cleanup to be done.

The performance numbers (i've only checked by RawSpeed benchmark) aren't
really surprising - overall this *slightly* (< -1%) improves perf.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360341 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LoopVectorizer] fix test file to not run the entire -O3 pipeline
Sanjay Patel [Thu, 9 May 2019 13:43:22 +0000 (13:43 +0000)]
[LoopVectorizer] fix test file to not run the entire -O3 pipeline

This test file has a long history of edits from changes outside
of vectorization, and it would happen again with the proposal in
D61726.

End-to-end testing shouldn't be happening in a test file that is
specifically checking for vector masked load/store ops.
Larger-scale testing goes in PhaseOrdering or the test-suite.

I've hopefully preserved the intent by taking what was completely
unoptimized IR in some tests and passing that through the -O1
pipeline. That becomes the input IR, and now we just run the loop
vectorizer and verify that the vector masked ops are produced as
expected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360340 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-nm] Fix handling of symbol types 't' 'd' 'r'
Fangrui Song [Thu, 9 May 2019 12:43:37 +0000 (12:43 +0000)]
[llvm-nm] Fix handling of symbol types 't' 'd' 'r'

This restores part of r359311 that was reverted by r359830.

Rewrite the symbol types to fix several issues.

Notable difference is that the type of __init_array_start changes from
't' to 'd'.

GNU nm used to mark ELF symbols relative to .init_array as 't'
https://sourceware.org/bugzilla/show_bug.cgi?id=24505 (before 2.33)
because ".init" is the prefix. The bug was copied by r287803.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D61551

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360339 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC][NFC] Add test for D60506 to show differences in code-gen
Nemanja Ivanovic [Thu, 9 May 2019 12:26:39 +0000 (12:26 +0000)]
[PowerPC][NFC] Add test for D60506 to show differences in code-gen

Differential revision: https://reviews.llvm.org/D61723

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360338 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix local variable shadow warning in SmallVectorBase constructor. NFCI.
Simon Pilgrim [Thu, 9 May 2019 12:21:53 +0000 (12:21 +0000)]
Fix local variable shadow warning in SmallVectorBase constructor. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360337 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix uninitialized value warnings in StatepointBase constructors. NFCI.
Simon Pilgrim [Thu, 9 May 2019 12:21:00 +0000 (12:21 +0000)]
Fix uninitialized value warnings in StatepointBase constructors. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360335 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM][CGP] Guard against signext args and sitofp
Sam Parker [Thu, 9 May 2019 11:56:16 +0000 (11:56 +0000)]
[ARM][CGP] Guard against signext args and sitofp

Add an Argument that has the SExtAttr attached, as well as SIToFP
instructions, as values that generate sign bits. SIToFP doesn't
strictly do this and could be treated as a sink to be sign-extended.

Differential Revision: https://reviews.llvm.org/D61381

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360331 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeGenPrepare] Ensure we get a non-null result from getTrueOrFalseValue. NFCI.
Simon Pilgrim [Thu, 9 May 2019 10:51:26 +0000 (10:51 +0000)]
[CodeGenPrepare] Ensure we get a non-null result from getTrueOrFalseValue. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360328 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SPIR] Simplified target checking.
Anastasia Stulova [Thu, 9 May 2019 10:16:33 +0000 (10:16 +0000)]
[SPIR] Simplified target checking.

Added Triple::isSPIR() helper to simplify code.

Patch by kpet (Kevin Petit)!

Differential revision: https://reviews.llvm.org/D61639

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360323 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix LLVM_USE_PERF build after getPageSize change
Sven van Haastregt [Thu, 9 May 2019 10:10:44 +0000 (10:10 +0000)]
Fix LLVM_USE_PERF build after getPageSize change

Commit r360221 ("[Support] Add error handling to
sys::Process::getPageSize().", 2019-05-08) seems to have missed these
uses of getPageSize().  Update them to getPageSizeEstimate().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360322 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM GlobalISel] Map DBG_VALUE for types != s32
Diana Picus [Thu, 9 May 2019 09:49:36 +0000 (09:49 +0000)]
[ARM GlobalISel] Map DBG_VALUE for types != s32

...and make sure we fail elegantly for unsupported values.

s64 goes into DPR, anything <= 32 into GPR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360321 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoX86WinAllocaExpander: Drop code looking through register copies (PR41786)
Hans Wennborg [Thu, 9 May 2019 09:22:56 +0000 (09:22 +0000)]
X86WinAllocaExpander: Drop code looking through register copies (PR41786)

This code was never covered by tests, in PR41786 it was pointed out that
the deletion part doesn't work, and in a full Chrome build I was never
able to hit the code path that looks through copies. It seems the
situation it's supposed to handle doesn't actually come up in practice.

Delete it to simplify the code.

Differential revision: https://reviews.llvm.org/D61671

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360320 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MergeICmps][NFC] Re-generate tests with update_test_checks.
Clement Courbet [Thu, 9 May 2019 08:37:58 +0000 (08:37 +0000)]
[MergeICmps][NFC] Re-generate tests with update_test_checks.

And use a more compact name for the tested struct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360319 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMake sub-registers index names case sensitive in the MIRParser
Markus Lavin [Thu, 9 May 2019 08:29:04 +0000 (08:29 +0000)]
Make sub-registers index names case sensitive in the MIRParser

Prior to this change sub-register index names are assumed to be lower
case (but they are printed with original casing). This means that if a
target has some upper case characters in its sub-register names then
mir-export directly followed by mir-import is not possible. This also
means that sub-register indices currently are (and will continue to be)
slightly inconsistent with register names which are printed and assumed
to be lower case.

As the current textual representation of mir has a few inconsistencies
in this area it is a bit arbitrary how to address the matter. This
change is towards the direction that we feel is most correct (i.e. case
sensitivity).

Differential Revision: https://reviews.llvm.org/D61499

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360318 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoBugfix for nullptr check by klocwork
Pengfei Wang [Thu, 9 May 2019 08:09:21 +0000 (08:09 +0000)]
Bugfix for nullptr check by klocwork

Klocwork static check:
Pointer from call to function `DebugLoc::operator DILocation *() const `
may be NULL and will be dereference in function `printExtendedName```
Patch by Shengchen Kan (skan)
Differential Revision: https://reviews.llvm.org/D61715

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360317 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeGen] Use "DL.getPointerSizeInBits" instead of "8 * DL.getPointerSize". NFC
Bjorn Pettersson [Thu, 9 May 2019 08:07:36 +0000 (08:07 +0000)]
[CodeGen] Use "DL.getPointerSizeInBits" instead of "8 * DL.getPointerSize". NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360315 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Fix typo.
Clement Courbet [Thu, 9 May 2019 07:12:25 +0000 (07:12 +0000)]
[NFC] Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360314 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NewPM] Setup Passes for KASan and KMSan
Petr Hosek [Thu, 9 May 2019 06:09:35 +0000 (06:09 +0000)]
[NewPM] Setup Passes for KASan and KMSan

While ASan and MSan passes were already ported to new PM, the kernel
variants weren't setup in the pipeline which makes the KASan and KMSan
tests in Clang fail.

Differential Revision: https://reviews.llvm.org/D61664

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360313 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agolit config: disable LSan for Apple clang compiler in addition to Apple LLVM
Alex Lorenz [Thu, 9 May 2019 02:46:20 +0000 (02:46 +0000)]
lit config: disable LSan for Apple clang compiler in addition to Apple LLVM

Apple clang is the canonical way to refer to the compiler shipped with Xcode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360307 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SelectionDAG] Expand ADD/SUBCARRY
Leonard Chan [Thu, 9 May 2019 01:17:48 +0000 (01:17 +0000)]
[SelectionDAG] Expand ADD/SUBCARRY

This patch allows for expansion of ADDCARRY and SUBCARRY when the target does not support it.

Differential Revision: https://reviews.llvm.org/D61411

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360303 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTemporarily Revert "[DebugInfo] Terminate more location-list ranges at the end of...
Eric Christopher [Wed, 8 May 2019 23:54:03 +0000 (23:54 +0000)]
Temporarily Revert "[DebugInfo] Terminate more location-list ranges at the end of blocks"
as it was causing significant compile time regressions.

This reverts commit r359426 while we come up with testcases and additional ideas.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360301 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] gfx1010 tests. NFC.
Stanislav Mekhanoshin [Wed, 8 May 2019 23:31:32 +0000 (23:31 +0000)]
[AMDGPU] gfx1010 tests. NFC.

Added tests which now pass after code commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360300 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SelectionDAG] fold 'fneg undef' to undef
Sanjay Patel [Wed, 8 May 2019 22:19:52 +0000 (22:19 +0000)]
[SelectionDAG] fold 'fneg undef' to undef

This is extracted from the original draft of D61419 with some additional tests.
We don't currently get this in IR (it's conservatively turned into a NaN),
but presumably that'll get updated as we add real IR support for 'fneg'
rather than 'fsub -0.0, x'.

The x86-32 run shows the following, and I haven't looked further to see why,
but that seems to be independent:
  Legalizing: t1: f32 = undef
  Trying to expand node
  Creating fp constant: t4: f32 = ConstantFP<0.000000e+00>

Differential Revision: https://reviews.llvm.org/D61516

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360296 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Mark scheduler classes as final
Matt Arsenault [Wed, 8 May 2019 22:10:04 +0000 (22:10 +0000)]
AMDGPU: Mark scheduler classes as final

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360294 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Select VOP3 form of add
Matt Arsenault [Wed, 8 May 2019 22:09:57 +0000 (22:09 +0000)]
AMDGPU: Select VOP3 form of add

The VOP3 form should always be the preferred selection, to be shrunk
later. This should only be an optimization issue, but this partially
works around a problem from clobbering VCC when SIFixSGPRCopies
rewrites an SCC defining operation directly to VCC.

3 of the testcases are regressions from failing to fold the immediate
in cases it should. These can be avoided by improving the VCC liveness
handling in SIFoldOperands. Simply increasing the threshold to
computeRegisterLiveness works, although this is common enough that VCC
liveness should probably be tracked throughout the pass. The hack of
leaving behind an implicit_def instruction to avoid breaking iterator
wastes instruction count, which inhibits finding the VCC def in long
chains of adds. Doing this however exposes different, worse looking
regressions from poor scheduling behavior. This could probably be
avoided around by forcing the shrink of the addc here, but the
scheduler should probably be fixed.

The r600 add test needs to be split out because it asserts on the
arguments in the new test during the calling convention lowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360293 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[FileCheck, NFC] Split defines.txt in two
Thomas Preud'homme [Wed, 8 May 2019 21:47:36 +0000 (21:47 +0000)]
[FileCheck, NFC] Split defines.txt in two

Summary:
Split defines.txt into diagnostics test and functionality test. Also add
comments, remove the semicolon prefix and group RUN lines with their
CHECK directives.

Reviewers: jhenderson, probinson, arichardson

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61679

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360289 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[FileCheck] Fix code style of method comments
Thomas Preud'homme [Wed, 8 May 2019 21:47:31 +0000 (21:47 +0000)]
[FileCheck] Fix code style of method comments

Summary:
Fix various issues in code style of method comments:
1) Move all heading comments to all non-static methods near their
declaration in the FileCheck.h header file.
2) Harmonize the action verb in doxygen comments for methods to always
be in third person
3) Use \returns instead of free text "return" and "returns".
4) Document a couple more parameters while at it.

Reviewers: jhenderson, probinson, arichardson

Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61445

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360288 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] gfx1010 exp modifications
Stanislav Mekhanoshin [Wed, 8 May 2019 21:23:37 +0000 (21:23 +0000)]
[AMDGPU] gfx1010 exp modifications

Differential Revision: https://reviews.llvm.org/D61701

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360287 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] When turning sext into zext due to known bits, return the new ZExt...
Craig Topper [Wed, 8 May 2019 20:59:21 +0000 (20:59 +0000)]
[InstCombine] When turning sext into zext due to known bits, return the new ZExt instead of calling replaceinstuseswith

The worklist loop that we're returning back to should be able to do the repacement itself. This is how we normally do replacements.

My main motivation was that I observed that we weren't preserving the name of the result when we do this transform. The replacement code in the worklist loop will call takeName as part of the replacement.

Differential Revision: https://reviews.llvm.org/D61695

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360284 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Fix a mis-placed bracket
Changpeng Fang [Wed, 8 May 2019 19:46:04 +0000 (19:46 +0000)]
AMDGPU: Fix a mis-placed bracket

Differential Revision:
  https://reviews.llvm.org/D61430

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360283 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add a non-ambiguous check prefix to lwp-intrinsics.ll for the case when only...
Craig Topper [Wed, 8 May 2019 19:20:53 +0000 (19:20 +0000)]
[X86] Add a non-ambiguous check prefix to lwp-intrinsics.ll for the case when only the feature is specified and not the CPUs.

Not sure why the script doesn't notice this. We just weren't checking the +lwp command in 32-bit mode in 2 of the test cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360282 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoPrecommit FNeg InstCombine tests
Cameron McInally [Wed, 8 May 2019 19:06:03 +0000 (19:06 +0000)]
Precommit FNeg InstCombine tests

Differential Revision: https://reviews.llvm.org/D61685

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360281 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SCEV] Suppress hoisting insertion point of binops when unsafe
Warren Ristow [Wed, 8 May 2019 18:50:07 +0000 (18:50 +0000)]
[SCEV] Suppress hoisting insertion point of binops when unsafe

InsertBinop tries to move insertion-points out of loops for expressions
that are loop-invariant. This patch adds a new parameter, IsSafeToHost,
to guard that hoisting. This allows callers to suppress that hoisting
for unsafe situations, such as divisions that may have a zero
denominator.

This fixes PR38697.

Differential Revision: https://reviews.llvm.org/D55232

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360280 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix new reassociate-catchswitch.ll test
Reid Kleckner [Wed, 8 May 2019 18:39:03 +0000 (18:39 +0000)]
Fix new reassociate-catchswitch.ll test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360279 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RegAllocFast] Scan physcial reg definitions before assigning virtual reg definitions
Quentin Colombet [Wed, 8 May 2019 18:30:26 +0000 (18:30 +0000)]
[RegAllocFast] Scan physcial reg definitions before assigning virtual reg definitions

When assigning the definitions of an instruction we were updating
the available registers while walking the definitions. Some of
those definitions may be from physical registers and thus, they are
not available for other definitions to take, but by the time we see
that we may have already assign these registers to another
virtual register.

Fix that by walking through all the definitions and mark as unavailable
the physical register definitions, then do the virtual register assignments.

PR41790

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360278 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NewPassManager] Add tuning option: SLPVectorization [NFC].
Alina Sbirlea [Wed, 8 May 2019 17:58:35 +0000 (17:58 +0000)]
[NewPassManager] Add tuning option: SLPVectorization [NFC].

Summary: Mirror tuning option from old pass manager in new pass manager.

Reviewers: chandlerc

Subscribers: mehdi_amini, jlebar, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61616

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360276 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstSimplify] add tests for fcmp+minnum; NFC
Sanjay Patel [Wed, 8 May 2019 17:53:18 +0000 (17:53 +0000)]
[InstSimplify] add tests for fcmp+minnum; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360275 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tests] Landing tests for D58632 to show diffs in review
Philip Reames [Wed, 8 May 2019 17:28:38 +0000 (17:28 +0000)]
[Tests] Landing tests for D58632 to show diffs in review

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360274 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[FastISel][X86] Support FNeg instruction in target independent fast isel handling
Craig Topper [Wed, 8 May 2019 17:27:08 +0000 (17:27 +0000)]
[FastISel][X86] Support FNeg instruction in target independent fast isel handling

This patch adds support for calling selectFNeg for FNeg instructions in addition to the fsub idiom

Differential Revision: https://reviews.llvm.org/D61624

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360273 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MemorySSA] Teach LoopSimplify to preserve MemorySSA.
Alina Sbirlea [Wed, 8 May 2019 17:05:36 +0000 (17:05 +0000)]
[MemorySSA] Teach LoopSimplify to preserve MemorySSA.

Summary:
Preserve MemorySSA in LoopSimplify, in the old pass manager, if the analysis is available.
Do not preserve it in the new pass manager.
Update tests.

Subscribers: nemanjai, jlebar, javed.absar, Prazek, kbarton, zzheng, jsji, llvm-commits, george.burgess.iv, chandlerc

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60833

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360270 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64] Remove scan-build "Value stored during its initialization is never read...
Simon Pilgrim [Wed, 8 May 2019 16:29:39 +0000 (16:29 +0000)]
[AArch64] Remove scan-build "Value stored during its initialization is never read" warnings. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360268 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64] Fix scan-build null/uninitialized pointer warnings. NFCI.
Simon Pilgrim [Wed, 8 May 2019 16:27:24 +0000 (16:27 +0000)]
[AArch64] Fix scan-build null/uninitialized pointer warnings. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360267 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Reapplied BFE canonicalization from D60462
Simon Pilgrim [Wed, 8 May 2019 15:49:10 +0000 (15:49 +0000)]
[AMDGPU] Reapplied BFE canonicalization from D60462

This was committed in rL358887 but reverted in rL360066 due to a x86 regression, really it should be have been pre-committed instead of being part of the SimplifyDemandedBits bitcast patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360263 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Reassociation] Place moved instructions after landing pads
David Greene [Wed, 8 May 2019 15:44:24 +0000 (15:44 +0000)]
[Reassociation] Place moved instructions after landing pads

Reassociation's NegateValue moved instructions to the beginning of
blocks (after PHIs) without checking for exception handling pads.
It's possible for reassociation to move something into an exception
handling block so we need to make sure we don't move things too early
in the block.  This change advances the insertion point past any
exception handling pads.

If the block we want to move into contains a catchswitch, we cannot
move into it.  In that case just create a new neg as if we had not
found an existing neg to move.

Differential Revision: https://reviews.llvm.org/D61089

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360262 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[ValueTracking] Improve isKnowNonZero for Ints"
Nikita Popov [Wed, 8 May 2019 14:50:01 +0000 (14:50 +0000)]
Revert "[ValueTracking] Improve isKnowNonZero for Ints"

This reverts commit 3b137a495686bd6018d115ea82fb8bb7718349fd.

As reported in https://reviews.llvm.org/D60846, this is causing
miscompiles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360260 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Support] Fix unit test for fs::is_local
Petar Jovanovic [Wed, 8 May 2019 14:42:13 +0000 (14:42 +0000)]
[Support] Fix unit test for fs::is_local

Close the temporary file after the test is done using it.
If it is not closed and the file was created on NFS, it will cause the test
to fail. The problem happens in the cleanup process afterwards. It first
tries to delete the file but it is not really deleted. Afterwards, the
program fails to delete the directory containing the file, causing the whole
test to fail.

Patch by Milos Stojanovic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360259 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ADT] SmallVector::set_size - fix Wdocumentation. NFCI.
Simon Pilgrim [Wed, 8 May 2019 13:47:17 +0000 (13:47 +0000)]
[ADT] SmallVector::set_size - fix Wdocumentation. NFCI.

Also fixes a Wshadow warning on MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360255 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r360151
Nico Weber [Wed, 8 May 2019 13:41:01 +0000 (13:41 +0000)]
gn build: Merge r360151

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360253 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC]Fix British English -> American English issues
James Henderson [Wed, 8 May 2019 13:30:48 +0000 (13:30 +0000)]
[NFC]Fix British English -> American English issues

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360252 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objcopy] Improve error message for unrecognised archive member
James Henderson [Wed, 8 May 2019 13:28:58 +0000 (13:28 +0000)]
[llvm-objcopy] Improve error message for unrecognised archive member

Prior to this patch, llvm-objcopy's error messages for archives with
unsupported members only mentioned the archive name, not the member
name, making them unhelpful. This change improves it by approximately
following GNU objcopy's error message syntax of
"<archive name>(<member name>): <problem>".

Reviewed by: grimar

Differential Revision: https://reviews.llvm.org/D61674

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360251 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix whitespace mismatches. NFCI.
Simon Pilgrim [Wed, 8 May 2019 13:02:32 +0000 (13:02 +0000)]
Fix whitespace mismatches. NFCI.

Tabs are not our friends.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360248 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LegalizeDAG] Assert non-power-of-2 load/store op splits are in range. NFCI.
Simon Pilgrim [Wed, 8 May 2019 11:22:10 +0000 (11:22 +0000)]
[LegalizeDAG] Assert non-power-of-2 load/store op splits are in range. NFCI.

Fixes static analyzer undefined/out-of-range shift warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360245 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Hexagon] Fix cppcheck reduce variable scope warnings. NFCI.
Simon Pilgrim [Wed, 8 May 2019 11:02:46 +0000 (11:02 +0000)]
[Hexagon] Fix cppcheck reduce variable scope warnings. NFCI.

Also fixes a static analyzer "Value stored to 'S2' during its initialization is never read" warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360244 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MCA] Don't add a name to the default code region.
Andrea Di Biagio [Wed, 8 May 2019 11:00:43 +0000 (11:00 +0000)]
[MCA] Don't add a name to the default code region.

This is done in preparation for a patch that fixes PR41523.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360243 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoARM: disallow SP as Rn for Thumb2 TST & TEQ instructions
Tim Northover [Wed, 8 May 2019 10:59:08 +0000 (10:59 +0000)]
ARM: disallow SP as Rn for Thumb2 TST & TEQ instructions

Using SP in this position is unpredictable in ARMv7. CMP and CMN are not
affected, and of course v8 relaxes this requirement, but that's handled
elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360242 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[VPlan] Fix "value never used" static analyzer warning. NFCI.
Simon Pilgrim [Wed, 8 May 2019 10:52:26 +0000 (10:52 +0000)]
[VPlan] Fix "value never used" static analyzer warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360241 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MCA] Slightly refactor CodeRegion.h. NFCI
Andrea Di Biagio [Wed, 8 May 2019 10:44:05 +0000 (10:44 +0000)]
[MCA] Slightly refactor CodeRegion.h. NFCI

Also, use a SmallVector instead of a std::vector for the code region.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360240 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoR600InstrInfo.cpp - Add getTransSwizzle assert for the swizzle op index. NFCI.
Simon Pilgrim [Wed, 8 May 2019 10:39:56 +0000 (10:39 +0000)]
R600InstrInfo.cpp - Add getTransSwizzle assert for the swizzle op index. NFCI.

Fixes static analyzer undefined value warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360239 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MCA] Remove dead assignment. NFC
Andrea Di Biagio [Wed, 8 May 2019 10:28:56 +0000 (10:28 +0000)]
[MCA] Remove dead assignment. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360237 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SIMode] Fix typo in Status constructor
Simon Pilgrim [Wed, 8 May 2019 10:24:22 +0000 (10:24 +0000)]
[SIMode] Fix typo in Status constructor

As noted in https://www.viva64.com/en/b/0629/ (Snippet No. 36) and the scan-build CI reports (https://llvm.org/reports/scan-build/report-SIModeRegister.cpp-Status-1-1.html#EndPath), rL348754 introduced a typo in the Status constructor due to argument variable names shadowing the member variable names.

Differential Revision: https://reviews.llvm.org/D61595

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360236 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo] Fix use-after-move warning. NFCI.
Simon Pilgrim [Wed, 8 May 2019 10:09:57 +0000 (10:09 +0000)]
[DebugInfo] Fix use-after-move warning. NFCI.

Don't rely on DWARFAbbreviationDeclarationSet::extract cleaning the struct up for reuse - the analyzers don't like it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360235 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix cppcheck operator precedence warning. NFCI.
Simon Pilgrim [Wed, 8 May 2019 10:07:34 +0000 (10:07 +0000)]
Fix cppcheck operator precedence warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360234 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objcopy] Add --prefix-alloc-sections
James Henderson [Wed, 8 May 2019 09:49:35 +0000 (09:49 +0000)]
[llvm-objcopy] Add --prefix-alloc-sections

This patch adds support for --prefix-alloc-sections, which adds a prefix
to every allocated section names.

It adds a prefix after renaming section names by --rename-section as GNU
objcopy does.

Fixes PR41266: https://bugs.llvm.org/show_bug.cgi?id=41266

Differential Revision: https://reviews.llvm.org/D60042

Patch by Seiya Nuta.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360233 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SCCP] Fix crash when trying to constant-fold terminators multiple times.
Florian Hahn [Wed, 8 May 2019 09:09:54 +0000 (09:09 +0000)]
[SCCP] Fix crash when trying to constant-fold terminators multiple times.

If we fold a branch/switch to an unconditional branch to another dead block we
replace the branch with unreachable, to avoid attempting to fold the
unconditional branch.

Reviewers: davide, efriedma, mssimpso, jdoerfert

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D61300

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360232 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CMake] Install import libraries
Martin Storsjo [Wed, 8 May 2019 08:37:34 +0000 (08:37 +0000)]
[CMake] Install import libraries

Simplify the cmake logic to install both runtime and import
libraries (treated as ARCHIVE), as the later are needed to link
against llvm.

Patch by Julien Schueller!

Differential Revision: https://reviews.llvm.org/D61425

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360230 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][PowerPC] Add test for store combine optimization.
QingShan Zhang [Wed, 8 May 2019 07:56:59 +0000 (07:56 +0000)]
[NFC][PowerPC] Add test for store combine optimization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360229 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeGenPrepare] Don't split the store if it is volatile
QingShan Zhang [Wed, 8 May 2019 07:32:12 +0000 (07:32 +0000)]
[CodeGenPrepare] Don't split the store if it is volatile
We shouldn't split the store when it is volatile.

Differential Revision: https://reviews.llvm.org/D61169

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360228 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objcopy] - Fix for "Bug 41775 - SymbolTableSection::addSymbol - shadow variable...
George Rimar [Wed, 8 May 2019 07:31:05 +0000 (07:31 +0000)]
[llvm-objcopy] - Fix for "Bug 41775 - SymbolTableSection::addSymbol - shadow variable names"

This is a fix for https://bugs.llvm.org/show_bug.cgi?id=41775,

Problem is in the final line:
Size += this->EntrySize;

I checked that we do not actually need it in this place,
since we always call removeSectionReferences which
calls removeSymbols which updates the Size.

But it worth to keep it, that allows to relax the dependencies.

Differential revision: https://reviews.llvm.org/D61636

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360227 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Add a static function to do the endian check
QingShan Zhang [Wed, 8 May 2019 07:21:37 +0000 (07:21 +0000)]
[NFC] Add a static function to do the endian check
Add a new function to do the endian check, as I will commit another patch later, which will also need the endian check.

Differential Revision: https://reviews.llvm.org/D61236

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360226 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm] Avoid div by 0 when updating profile weights.
Mircea Trofin [Wed, 8 May 2019 03:57:25 +0000 (03:57 +0000)]
[llvm] Avoid div by 0 when updating profile weights.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61661

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360223 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ValueTracking] Improve isKnowNonZero for Ints
Dan Robertson [Wed, 8 May 2019 02:25:08 +0000 (02:25 +0000)]
[ValueTracking] Improve isKnowNonZero for Ints

Improve isKnownNonZero for integers in order to improve cttz
optimizations.

Differential Revision: https://reviews.llvm.org/D60846

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360222 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Support] Add error handling to sys::Process::getPageSize().
Lang Hames [Wed, 8 May 2019 02:11:07 +0000 (02:11 +0000)]
[Support] Add error handling to sys::Process::getPageSize().

This patch changes the return type of sys::Process::getPageSize to
Expected<unsigned> to account for the fact that the underlying syscalls used to
obtain the page size may fail (see below).

For clients who use the page size as an optimization only this patch adds a new
method, getPageSizeEstimate, which calls through to getPageSize but discards
any error returned and substitues a "reasonable" page size estimate estimate
instead. All existing LLVM clients are updated to call getPageSizeEstimate
rather than getPageSize.

On Unix, sys::Process::getPageSize is implemented in terms of getpagesize or
sysconf, depending on which macros are set. The sysconf call is documented to
return -1 on failure. On Darwin getpagesize is implemented in terms of sysconf
and may also fail (though the manpage documentation does not mention this).
These failures have been observed in practice when highly restrictive sandbox
permissions have been applied. Without this patch, the result is that
getPageSize returns -1, which wreaks havoc on any subsequent code that was
assuming a sane page size value.

<rdar://problem/41654857>

Reviewers: dblaikie, echristo

Subscribers: kristina, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59107

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360221 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tests] Expand coverage of small memset zero idioms
Philip Reames [Tue, 7 May 2019 23:48:42 +0000 (23:48 +0000)]
[Tests] Expand coverage of small memset zero idioms

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360210 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[COFF] Use COFF stubs for extern_weak functions
Reid Kleckner [Tue, 7 May 2019 23:06:21 +0000 (23:06 +0000)]
[COFF] Use COFF stubs for extern_weak functions

Summary:
A COFF stub indirects the reference to a symbol through memory. A
.refptr.$sym global variable pointer is created to refer to $sym.
Typically mingw uses these for external global variable declarations,
but we can use them for weak function declarations as well.

Updates the dso_local classification to add a special case for
extern_weak symbols on COFF in both clang and LLVM.

Fixes PR37598

Reviewers: smeenai, mstorsjo

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D61615

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360207 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ValueTracking] add logic for known-never-nan with minnum/maxnum
Sanjay Patel [Tue, 7 May 2019 22:58:31 +0000 (22:58 +0000)]
[ValueTracking] add logic for known-never-nan with minnum/maxnum

From the LangRef: "Returns NaN only if both operands are NaN."

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360206 91177308-0d34-0410-b5e6-96231b3b80d8