129235 Commits

Author SHA1 Message Date
Mehdi Amini
f8b3df25f2 Revert "Fix windows build for sys::fs:file_status Access Time added in r264387"
This reverts commit r264388.
Bots are broken in various ways, I need to take one commit at a time...

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264389 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 06:43:22 +00:00
Mehdi Amini
b47cf88ea5 Fix windows build for sys::fs:file_status Access Time added in r264387
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264388 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 06:06:44 +00:00
Mehdi Amini
b474b03196 Add lastAccessedTime to file_status
Reviewers: silvas

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D18456

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264387 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 05:58:11 +00:00
Mehdi Amini
256567583d Query the StringMap only once when creating MDString (NFC)
Summary:
Loading IR with debug info improves MDString::get() from 19ms to 10ms.
This is a rework of D16597 with adding an "emplace" method on the StringMap
to avoid requiring the MDString move ctor to be public.

Reviewers: dexonsmith

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D17920

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264386 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 05:58:04 +00:00
Mehdi Amini
bf941ea066 Adjust initial size in StringMap constructor to guarantee no grow()
Summary:
StringMap ctor accepts an initialize size, but expect it to be
rounded to the next power of 2. The ctor can handle that directly
instead of expecting clients to round it. Also, since the map will
resize itself when 75% full, take this into account an initialize
a larger initial size to avoid any growth.

Reviewers: dblaikie

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D18344

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264385 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 05:57:57 +00:00
Mehdi Amini
9ed5a8271e Fix DenseMap::reserve(): the formula was wrong
Summary:
Just running the loop in the unittests for a few more iterations
(till 48) exhibit that the condition on the limit was not handled
properly in r263522.
Rewrite the test to use a class to count move/copies that happens
when inserting into the map.
Also take the opportunity to refactor the logic to compute the
number of buckets required for a given number of entries in the map.
Use this when constructing a DenseMap with a desired size given to
the constructor (and add a tests for this).

Reviewers: dblaikie

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D18345

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264384 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 05:57:52 +00:00
Mehdi Amini
c165b13f7b StringMap: reserve appropriate size when initializing from an initializer list
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264383 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 05:57:47 +00:00
Mehdi Amini
facd1245e4 Add GUID/getGlobalIdentifier() non-static API to global value
Summary:
These are just helpers calling their static counter part to
simplify client code.

Reviewers: tejohnson

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D18339

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264382 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 05:57:41 +00:00
Duncan P. N. Exon Smith
93e5944cd8 Bitcode: Use std::stable_partition for reproducible builds
Caught by inspection while working on partitioning metadata.  It's nice
to produce the same bitcode if you run the compiler twice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264381 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 02:20:28 +00:00
Duncan P. N. Exon Smith
f206a2c034 Bitcode: Stop using MODULE_CODE_METADATA_VALUES
The motivation for MODULE_CODE_METADATA_VALUES was to enable an
-flto=thin scheme where:

 1. First, one function is cherry-picked from a bitcode file.
 2. Later, another function is cherry-picked.
 3. Later, ...
 4. Finally, the metadata needed by all the previous functions is
    loaded.

This was abandoned in favour of:

 1. Calculate the superset of functions needed from a Module.
 2. Link all functions at once.

Delayed metadata reading no longer serves a purpose.  It also adds
a few complication, since we can't count on metadata being properly
parsed when exiting the BitcodeReader.  After discussing with Teresa, we
agreed to remove it.

The code that depended on this was removed/updated in r264326.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264378 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 01:29:50 +00:00
Matt Arsenault
bb366db643 AMDGPU: Cost model for basic integer operations
This resolves bug 21148 by preventing promotion to
i64 induction variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264376 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 01:16:40 +00:00
Hans Wennborg
6a62eecdb6 X86: Use push-pop for materializing 8-bit immediates for minsize (take 2)
This is the same as r255936, with added logic for avoiding clobbering of the
red zone (PR26023).

Differential Revision: http://reviews.llvm.org/D18246

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264375 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 01:10:56 +00:00
Matt Arsenault
359a7d918e AMDGPU: Partially implement getArithmeticInstrCost for FP ops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264374 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 01:00:32 +00:00
Duncan P. N. Exon Smith
7ad5ddeb72 IR: Stop upgrading !llvm.loop attachments via MDString
Remove logic to upgrade !llvm.loop by changing the MDString tag
directly.  This old logic would check (and change) arbitrary strings
that had nothing to do with loop metadata.  Instead, check !llvm.loop
attachments directly, and change which strings get attached.

Rather than updating the assembly-based upgrade, drop it entirely.  It
has been quite a while since we supported upgrading textual IR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264373 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 00:56:13 +00:00
Duncan P. N. Exon Smith
1adb3816e9 IR: Reserve an MDKind for !llvm.loop; NFC
This reserves an MDKind for !llvm.loop, which allows callers to avoid a
string-based lookup.  I'm not sure why it was missing.

There should be no functionality change here, just a small compile-time
speedup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264371 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 00:35:38 +00:00
Saleem Abdulrasool
c737b6fc30 ARM: fix optimised division on WoA
We did not have an explicit branch to the continuation BB.  When the check was
hoisted, this could permit control follow to fall through into the division
trap.  Add the explicit branch to the continuation basic block to ensure that
code execution is correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264370 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 00:34:11 +00:00
Matt Arsenault
e4e369ab90 TTI: Report 0 cost for free addrspacecasts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264369 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 00:26:29 +00:00
Matt Arsenault
93e0b28a0e TTI: Use 0 for cost of fabs if free
Ideally this would also happen for fneg, but that
isn't a distinct operation in the IR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264368 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 00:26:22 +00:00
Matt Arsenault
42792ff39d AMDGPU: TTI: Make insertelement free.
We don't want to have a cost to scalarizing operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264364 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 00:14:11 +00:00
Reid Kleckner
c68f3d4c8d Try to fix ODR violation of ErrorInfo::ID
This implements my suggestion to Lang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264360 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 23:49:34 +00:00
Manman Ren
7121713797 CXX TLS: collect return blocks after SelectAllBasicBlocks.
It is incorrect to get the corresponding MBB for a ReturnInst before
SelectAllBasicBlocks since SelectAllBasicBlocks can change the
correspondence between a ReturnInst and the MBB it is in.

PR27062


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264358 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 23:21:29 +00:00
Sanjay Patel
79b059889d Add utility script to generate checks for opt or llc regression tests
This is an enhancement of the existing update_llc_test_checks.py script.
It adds some of the functionality from the script used in D17999 to make
the IR checking more flexible.

The bad news: 
This actually is 'My First Python Program'. Thus, it's likely that I have
violated all best practices of Python programming if I've made a functional
change from the original program. If you see anything that's obviously 
wrong, please let me know or feel free to fix it. I didn't even read any
documentation...

The good news: 
I tested this on ~10 existing opt/llc regression tests, and it does what 
I hoped for. It produces exact checking for IR regression tests and doesn't
signficantly change the existing llc-with-x86-target asm checking. The opt
tests that were modified in r263667, r263668, r263674, and r263679 are
examples of the expected results, except that this version of the script 
puts the check lines ahead of the IR to follow the existing llc/asm 
behavior.

If there are no complaints/fallout, we should be able to remove the 
original script. Extending this script to be used for non-x86 and clang
regression tests would be the expected follow-up steps.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264357 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 23:19:26 +00:00
Sanjoy Das
dbdf1cfb70 Reduce code duplication by extracting out a helper function; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264355 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 22:51:49 +00:00
Sanjoy Das
abd2448893 Lower varargs correctly in deopt bundle lowering
Earlier we were ignoring varargs in LowerCallSiteWithDeoptBundle because
populateCallLoweringInfo does not set CallLoweringInfo::IsVarArg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264354 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 22:37:52 +00:00
Sean Silva
b7348b3b20 Fix typo: XDS -> XDG
Patch by Robert Ma <bob1211@gmail.com>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264352 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 22:27:27 +00:00
David Blaikie
dfb4013c58 llvm-dwp: Coalesce code for reading the CU's DW_AT_GNU_dwo_id and DW_AT_name
Going to be reading the DW_AT_GNU_dwo_name shortly as well, and there
was already enough duplication here that it was worth refactoring
rather than adding even more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264350 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 22:17:08 +00:00
Mike Aizatsky
b5f62ceff2 [sancov] renaming statistics fields.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264349 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 21:49:55 +00:00
Matthias Braun
afb111acf7 LiveInterval: Fix Distribute() failing on liveranges with unused VNInfos
This fixes http://llvm.org/PR26991

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264345 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 21:41:38 +00:00
David Majnemer
84ad430763 [LoopStrengthReduce] Don't hoist into a catchswitch
We try to hoist the insertion point as high as possible to encourage
sharing.  However, we must be careful not to hoist into a catchswitch as
it is both an EHPad and a terminator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264344 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 21:40:22 +00:00
Lang Hames
2eed3e6ea4 [Support] Add ErrorInfo::ID static member definition.
Somehow this got dropped in an earlier patch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264341 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 21:17:50 +00:00
Eric Christopher
ee2d71dfcd Finish the incomplete 'd' inline asm constraint support for PPC by
making sure we give it a register and mark it as a register constraint.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264340 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 21:04:52 +00:00
Eric Christopher
aa3cfdd253 Reorder check lines, comments in test and remove unnecessary IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264339 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 21:04:47 +00:00
Kostya Serebryany
d32f138d30 [libFuzzer] handle SIGTERM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264338 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 21:03:58 +00:00
Sanjoy Das
2f8286bd50 Match call and target calling conventions in test
Fixes an issue in rL264329.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264337 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 20:51:24 +00:00
Mike Aizatsky
452d923857 [sancov] adding leading zeros to coverage pct.
Summary:
Using leading zeroes allows you to search for "000%" to find non-covered
items.

Differential Revision: http://reviews.llvm.org/D18420

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264336 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 20:41:18 +00:00
Dimitry Andric
b7a21ad8ca Add <atomic> to ThreadPool.h, since std::atomic is used
Summary:
Apparently, when compiling with gcc 5.3.2 for powerpc64, the order of
headers is such that it gets an error about std::atomic<> use in
ThreadPool.h, since this header is not included explicitly.  See also:

https://llvm.org/bugs/show_bug.cgi?id=27058

Fix this by including <atomic>.  Patch by Bryan Drewery.

Reviewers: chandlerc, joker.eph

Subscribers: bdrewery, llvm-commits

Differential Revision: http://reviews.llvm.org/D18460


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264335 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 20:39:17 +00:00
Reid Kleckner
8418d19d0b Revert "Recommitted r263424 "Supporting all entities declared in lexical scope in LLVM debug info." After fixing PR26942 (the fix is included in this commit)."
This reverts commit r264280.

This broke building Chromium for iOS. We'll upload a reproducer to the
PR soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 20:38:49 +00:00
Krzysztof Parzyszek
d593c6f133 [Hexagon] Be sure to treat subregisters of a CSR as CSRs as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264331 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 20:31:41 +00:00
David Blaikie
1825f4d513 [ADT] C++11ify SmallVector::erase's arguments from iterator to const_iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264330 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 20:25:51 +00:00
Sanjoy Das
8ba5ebc098 Add lowering support for llvm.experimental.deoptimize
Summary:
Only adds support for "naked" calls to llvm.experimental.deoptimize.
Support for round-tripping through RewriteStatepointsForGC will come
as a separate patch (should be simpler than this one).

Reviewers: reames

Subscribers: sanjoy, mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D18429

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264329 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 20:23:29 +00:00
Krzysztof Parzyszek
d4af74e531 [Hexagon] Add support for run-time stack overflow checking
Patch by Sundeep Kushwaha.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264328 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 20:20:07 +00:00
Teresa Johnson
e3c0e7f6cf [ThinLTO] Use bulk importing in llvm-link
Summary:
Use bulk importing so we can avoid the use of post-pass metadata
linking. Cloned the ModuleLazyLoaderCache from the FunctionImport pass
to facilitate this.

Reviewers: joker.eph

Subscribers: dexonsmith, llvm-commits, joker.eph

Differential Revision: http://reviews.llvm.org/D18455

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264326 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 19:52:20 +00:00
Krzysztof Parzyszek
deffc78c77 [Hexagon] Generate PIC-specific versions of save/restore routines
In PIC mode, the registers R14, R15 and R28 are reserved for use by
the PLT handling code. This causes all functions to clobber these
registers. While this is not new for regular function calls, it does
also apply to save/restore functions, which do not follow the standard
ABI conventions with respect to the volatile/non-volatile registers.

Patch by Jyotsna Verma.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264324 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 19:18:48 +00:00
Richard Smith
e4010bf95b Stop relying on mapped_iterator's function having a result_type. That facility
is deprecated in modern C++ and unnecessary since decltype can be used to query
the relevant type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264321 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 19:10:58 +00:00
Sanjoy Das
2080172098 [Statepoints] Fix yet another issue around gc pointer uniqueing
Given that StatepointLowering now uniques derived pointers before
putting them in the per-statepoint spill map, we may end up with missing
entries for derived pointers when we visit a gc.relocate on a pointer
that was de-duplicated away.

Fix this by keeping two maps, one mapping gc pointers to their
de-duplicated values, and one mapping a de-duplicated value to the slot
it is spilled in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264320 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 18:57:39 +00:00
Sanjoy Das
7bf7b9ce00 Minor cosmestic changes (NFC)
- Reflow comments
 - Rename function

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264319 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 18:57:31 +00:00
Chris Bieneman
c28ee9ced7 [Docs] Updating CMake docs to include LLVM_OPTIMIZED_TABLEGEN
This is based on feedback on llvm-commits from Sean Silvas.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264318 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 18:46:43 +00:00
David Blaikie
97f383e4e1 [debuginfo] Include dwo_name in the split unit to improve dwp diagnostics
When multiple DWP files are merged together and duplicate DWO IDs are
found it's currently difficult to give an actionable error message - the
DW_AT_name of the CU could be provided, but might be identical (if the
same source file is built into two different configurations), which
doesn't help the user identify the problem.

When no intermediate DWP files are generated, the path to the two DWO
files could be provided - but is lost once the DWOs are merged into a
DWP.

So, include the name of the DWO (dwo_name) in the split file so that
collissions involving a source CU from a DWP can be better diagnosed.

(improvements to llvm-dwp using this to come shortly)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 18:37:08 +00:00
Lang Hames
2e2ed8c746 [docs] Clarify Error example in Programmer's Manual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264314 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 18:05:21 +00:00
Adam Nemet
1123cc74df [LLE] Check for mismatching types between the store and the load earlier
isDependenceDistanceOfOne asserts that the store and the load access
through the same type.  This function is also used by
removeDependencesFromMultipleStores so we need to make sure we filter
out mismatching types before reaching this point.

Now we do this when the initial candidates are gathered.

This is a refinement of the fix made in r262267.

Fixes PR27048.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264313 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 17:59:26 +00:00