OSDN Git Service
Valery Pykhtin [Mon, 14 Mar 2016 05:25:44 +0000 (05:25 +0000)]
[AMDGPU] AsmParser: refactor post push_back vector access. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263409
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 14 Mar 2016 05:15:09 +0000 (05:15 +0000)]
[CodeView] Consistently handle overly large symbol names
Overly large symbol names weren't correctly handled for leaf function
records.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263408
91177308-0d34-0410-b5e6-
96231b3b80d8
Valery Pykhtin [Mon, 14 Mar 2016 05:01:45 +0000 (05:01 +0000)]
[AMDGPU] AsmParser: remove redundant isReg checks. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263407
91177308-0d34-0410-b5e6-
96231b3b80d8
Haicheng Wu [Mon, 14 Mar 2016 03:24:28 +0000 (03:24 +0000)]
[CVP] Convert an SDiv to a UDiv if both operands are known to be nonnegative
The motivating example is this
for (j = n; j > 1; j = i) {
i = j / 2;
}
The signed division is safely to be changed to an unsigned division (j is known
to be larger than 1 from the loop guard) and later turned into a single shift
without considering the sign bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263406
91177308-0d34-0410-b5e6-
96231b3b80d8
Amaury Sechet [Mon, 14 Mar 2016 01:37:29 +0000 (01:37 +0000)]
Add facility to add/remove/check attribute on function and arguments.
Summary: This comes from work to make attribute manipulable via the C API.
Reviewers: gottesmm, hfinkel, baldrick, echristo, tejohnson
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D18128
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263404
91177308-0d34-0410-b5e6-
96231b3b80d8
Junmo Park [Mon, 14 Mar 2016 00:36:19 +0000 (00:36 +0000)]
[MCSchedule] Remove comments about MinLatency. NFC
Summary:
There is no definition about MinLatency any more.
Reviewers: mcrosier, spatel, hfinkel
Differential Revision: http://reviews.llvm.org/D18079
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263403
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 14 Mar 2016 00:18:26 +0000 (00:18 +0000)]
[X86][XOP] Added target shuffle combine tests for XOP's VPPERM 2-op shuffle
Actual combing support will be added in a future patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263402
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 13 Mar 2016 22:00:18 +0000 (22:00 +0000)]
Remove some unused variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263396
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Sun, 13 Mar 2016 21:05:13 +0000 (21:05 +0000)]
Remove PreserveNames template parameter from IRBuilder
This reapplies r263258, which was reverted in r263321 because
of issues on Clang side.
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263393
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 13 Mar 2016 19:08:01 +0000 (19:08 +0000)]
[X86][SSE] Added truncated vector arithmetic tests.
For cases where we are truncating an integer vector arithmetic result, it may be better to pre-truncate the input operands - no code to support this yet (scalar is done with SimplifyDemandedBits but adding vector support could be a lot of work) but these tests represent the current codegen status.
Example bugs: PR14666, PR22703
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263384
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 13 Mar 2016 18:35:59 +0000 (18:35 +0000)]
[X86][SSE41] Avoid variable blend for constant v8i16 shifts
The SSE41 v8i16 shift lowering using (v)pblendvb is great for non-constant shift amounts, but if it is constant then we can efficiently reduce the VSELECT to shuffles with the pre-SSE41 lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263383
91177308-0d34-0410-b5e6-
96231b3b80d8
Amjad Aboud [Sun, 13 Mar 2016 11:11:39 +0000 (11:11 +0000)]
Fixed DIBuilder to verify that same imported entity will not be added twice to the "imports" list of the DICompileUnit.
Differential Revision: http://reviews.llvm.org/D17884
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263379
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sun, 13 Mar 2016 10:53:30 +0000 (10:53 +0000)]
[CodeView] Truncate display names
Fundamentally, the length of a variable or function name is bound by the
maximum size of a record: 0xffff. However, the name doesn't live in a
vacuum; other data is associated with the name, lowering the bound
further.
We would naively attempt to emit the name, causing us to assert because
the record would no-longer fit in 16-bits. Instead, truncate the name
but preserve as much as we can.
While I have tested this locally, I've decided to not commit it due to
the test's size.
N.B. While this behavior is undesirable, it is better than MSVC's
behavior. They seem to truncate to ~4000 characters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263378
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sun, 13 Mar 2016 08:01:03 +0000 (08:01 +0000)]
[Bitcode] Make writeComdats less strange
It had a weird artificial limitation on the write side: the comdat name
couldn't be bigger than 2**16. However, the reader had no such
limitation. Make the reader and the writer agree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263377
91177308-0d34-0410-b5e6-
96231b3b80d8
Fiona Glaser [Sun, 13 Mar 2016 05:36:15 +0000 (05:36 +0000)]
ConstantFoldInstruction: avoid wasted calls to ConstantFoldConstantExpression
Check to see if all operands are constant before calling simplify on them
so that we don't perform wasted simplifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263374
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 13 Mar 2016 05:22:08 +0000 (05:22 +0000)]
Fix build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263372
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 13 Mar 2016 05:12:32 +0000 (05:12 +0000)]
APFloat: Fix ilogb for denormals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263370
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 13 Mar 2016 05:11:51 +0000 (05:11 +0000)]
APFloat: Fix scalbn handling of denormals
This was incorrect for denormals, and also failed
on longer exponent ranges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263369
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Sun, 13 Mar 2016 04:55:44 +0000 (04:55 +0000)]
Define IsRela static const member to Elf_Rel type.
So that we can write RelTy::IsRela to query its type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263367
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 13 Mar 2016 02:56:31 +0000 (02:56 +0000)]
[X86] Remove many operands that represent memory stores from outs to ins. These operands are the registers and immediates that specify the memory address not the memory itself thus they are inputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263354
91177308-0d34-0410-b5e6-
96231b3b80d8
Amaury Sechet [Sun, 13 Mar 2016 00:58:25 +0000 (00:58 +0000)]
Add echo test for constant data arrays in the LLVM C API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263350
91177308-0d34-0410-b5e6-
96231b3b80d8
Amaury Sechet [Sun, 13 Mar 2016 00:54:40 +0000 (00:54 +0000)]
Use templated version of unwrap instead of cats in the Core.cpp. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263349
91177308-0d34-0410-b5e6-
96231b3b80d8
Amaury Sechet [Sun, 13 Mar 2016 00:40:12 +0000 (00:40 +0000)]
Move LLVMConstStructInContext so that declarationa nd definition order match. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263348
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 12 Mar 2016 21:09:26 +0000 (21:09 +0000)]
update test to use FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263347
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 12 Mar 2016 20:44:58 +0000 (20:44 +0000)]
fix documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263346
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 12 Mar 2016 20:44:30 +0000 (20:44 +0000)]
fix documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263345
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 12 Mar 2016 18:17:41 +0000 (18:17 +0000)]
remove unnecessary cast; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263343
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 12 Mar 2016 18:05:53 +0000 (18:05 +0000)]
fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263342
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 12 Mar 2016 16:52:17 +0000 (16:52 +0000)]
use range loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263341
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 12 Mar 2016 15:16:59 +0000 (15:16 +0000)]
[x86, InstCombine] delete x86 SSE2 masked store with zero mask
This follows up on the related AVX instruction transforms, but this
one is too strange to do anything more with. Intel's behavioral
description of this instruction in its Software Developer's Manual
is tragi-comic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263340
91177308-0d34-0410-b5e6-
96231b3b80d8
Nemanja Ivanovic [Sat, 12 Mar 2016 10:23:07 +0000 (10:23 +0000)]
Fix for PR 26378
This patch corresponds to review:
http://reviews.llvm.org/D17712
We were not clearing the TOC vector in PPCAsmPrinter when initializing it. This
caused duplicate definition asserts when the pass is reused on the module
(i.e. with -compile-twice or in JIT contexts).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263338
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Sat, 12 Mar 2016 05:38:22 +0000 (05:38 +0000)]
Use default destructor and remove unnecessary virtual destructor
Only the virtual destructor in the base class is needed, and can use the
default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263335
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Sat, 12 Mar 2016 03:23:02 +0000 (03:23 +0000)]
[libFuzzer] refresh docs more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263332
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Sat, 12 Mar 2016 03:11:27 +0000 (03:11 +0000)]
[libFuzzer] refresh docs more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263331
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Sat, 12 Mar 2016 03:05:37 +0000 (03:05 +0000)]
[libFuzzer] refresh docs more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263330
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 12 Mar 2016 03:03:31 +0000 (03:03 +0000)]
[lit] Hack lit to allow a test suite to request that it is run "early".
This lets us for example start running the unit test suite early. For
'check-llvm' on my machine, this drops the tim e from 44s to 32s!!!!!
It's pretty ugly. I barely know how to write Python, so feel free to
just tell me how I should write it instead. =D Thanks to Filipe and
others for help.
Differential Revision: http://reviews.llvm.org/D18089
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263329
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Sat, 12 Mar 2016 02:56:25 +0000 (02:56 +0000)]
[libFuzzer] refresh docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263328
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sat, 12 Mar 2016 02:54:27 +0000 (02:54 +0000)]
Make gc relocates more strongly typed; NFC
Don't use a `Value *` where we can use a stronger `GCRelocateInst *`
type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263327
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Sat, 12 Mar 2016 02:25:27 +0000 (02:25 +0000)]
[X86] Make sure we do not clobber RBX with cmpxchg when used as a base pointer.
cmpxchg[8|16]b uses RBX as one of its argument.
In other words, using this instruction clobbers RBX as it is defined to hold one
the input. When the backend uses dynamically allocated stack, RBX is used as a
reserved register for the base pointer.
Reserved registers have special semantic that only the target understands and
enforces, because of that, the register allocator don’t use them, but also,
don’t try to make sure they are used properly (remember it does not know how
they are supposed to be used).
Therefore, when RBX is used as a reserved register but defined by something that
is not compatible with that use, the register allocator will not fix the
surrounding code to make sure it gets saved and restored properly around the
broken code. This is the responsibility of the target to do the right thing with
its reserved register.
To fix that, when the base pointer needs to be preserved, we use a different
pseudo instruction for cmpxchg that save rbx.
That pseudo takes two more arguments than the regular instruction:
- One is the value to be copied into RBX to set the proper value for the
comparison.
- The other is the virtual register holding the save of the value of RBX as the
base pointer. This saving is done as part of isel (i.e., we emit a copy from
rbx).
cmpxchg_save_rbx <regular cmpxchg args>, input_for_rbx_reg, save_of_rbx_as_bp
This gets expanded into:
rbx = copy input_for_rbx_reg
cmpxchg <regular cmpxchg args>
rbx = save_of_rbx_as_bp
Note: The actual modeling of the pseudo is a bit more complicated to make sure
the interferes that appears after the pseudo gets expanded are properly modeled
before that expansion.
This fixes PR26883.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263325
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Sat, 12 Mar 2016 01:57:04 +0000 (01:57 +0000)]
[libFuzzer] try to use max_len based on the items of the corpus instead of blindly defaulting to 64 bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263323
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sat, 12 Mar 2016 01:47:22 +0000 (01:47 +0000)]
Temporarily revert:
commit
ae14bf6488e8441f0f6d74f00455555f6f3943ac
Author: Mehdi Amini <mehdi.amini@apple.com>
Date: Fri Mar 11 17:15:50 2016 +0000
Remove PreserveNames template parameter from IRBuilder
Summary:
Following r263086, we are now relying on a flag on the Context to
discard Value names in release builds.
Reviewers: chandlerc
Subscribers: mzolotukhin, llvm-commits
Differential Revision: http://reviews.llvm.org/D18023
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263258
91177308-0d34-0410-b5e6-
96231b3b80d8
until we can figure out what to do about clang and Release build testing.
This reverts commit 263258.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263321
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sat, 12 Mar 2016 01:31:53 +0000 (01:31 +0000)]
Add Lanai.def to the module map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263319
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Sat, 12 Mar 2016 01:28:56 +0000 (01:28 +0000)]
[LoopUnroll] Convert some existing tests to unit-tests.
Summary: As we now have unit-tests for UnrollAnalyzer, we can convert some existing tests to this format. It should make the tests more robust.
Reviewers: chandlerc, sanjoy
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17904
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263318
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Sat, 12 Mar 2016 01:23:57 +0000 (01:23 +0000)]
Fix a memory leak due to missing virtual destructors
Caused a couple of sanitizer bot failures in ThinLTO tests due to
r263275.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263317
91177308-0d34-0410-b5e6-
96231b3b80d8
Wilfred Hughes [Sat, 12 Mar 2016 00:43:26 +0000 (00:43 +0000)]
Updating source languages entry in FAQ.
Dragonegg is no longer actively maintained[1], and the Pypy team is not
actively pursuing LLVM[2].
1: http://reviews.llvm.org/D9331
2: http://rpython.readthedocs.org/en/latest/faq.html#could-we-use-llvm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263314
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Matthews [Fri, 11 Mar 2016 23:31:02 +0000 (23:31 +0000)]
Fix the docs I broke
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263309
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Aizatsky [Fri, 11 Mar 2016 23:28:28 +0000 (23:28 +0000)]
[sancov] using md5 for anchors in attempt to reduce file size.
Differential Revision: http://reviews.llvm.org/D18102
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263308
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Aizatsky [Fri, 11 Mar 2016 23:26:41 +0000 (23:26 +0000)]
Don't crash sancov if file is unreadable.
Summary:
Caller can provides the list of .so files where some files are
unreadable (e.g linux-vdso.so.1). It's more convenient to handler this in
sancov with warning then making all callers to check files.
Reviewers: aizatsky
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D18103
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263307
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Matthews [Fri, 11 Mar 2016 22:33:36 +0000 (22:33 +0000)]
Extend test-suite docs to describe how to run test-suite with cmake+lit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263305
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Fri, 11 Mar 2016 22:19:06 +0000 (22:19 +0000)]
Minor cleanup and documentation to IRMover (NFC)
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263304
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 11 Mar 2016 22:18:05 +0000 (22:18 +0000)]
[X86][SSE] Simplify vector LOAD + EXTEND on pre-SSE41 hardware
Improve vector extension of vectors on hardware without dedicated VSEXT/VZEXT instructions.
We already convert these to SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG but can further improve this by using the legalizer instead of prematurely splitting into legal vectors in the combine as this only properly helps for lowering to VSEXT/VZEXT.
Removes a lot of unnecessary any_extend + mask pattern - (Fix for PR25718).
Differential Revision: http://reviews.llvm.org/D17932
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263303
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Fri, 11 Mar 2016 22:02:58 +0000 (22:02 +0000)]
[AArch64] Don't blindly lower f16/f128 FCCMPs.
Instead, extend f16 (like we do when lowering a standalone SETCC),
and let f128 be legalized to the RT calls.
Fixes PR26803.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263301
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Fri, 11 Mar 2016 21:34:45 +0000 (21:34 +0000)]
Initialize CalleeInfo to fix bot after r263275
Hopefully will fix garbage output in
http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/6901
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263297
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Fri, 11 Mar 2016 20:20:25 +0000 (20:20 +0000)]
Define NT_GNU_BUILD_ID constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263288
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Fri, 11 Mar 2016 19:45:37 +0000 (19:45 +0000)]
[WebAssembly] Add `final` keywords to a few more subclasses, for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263287
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Fri, 11 Mar 2016 19:34:03 +0000 (19:34 +0000)]
[MemorySSA] Make a return type reflect reality. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263286
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 11 Mar 2016 19:08:34 +0000 (19:08 +0000)]
Introduce @llvm.experimental.deoptimize
Summary:
This intrinsic, together with deoptimization operand bundles, allow
frontends to express transfer of control and frame-local state from
one (typically more specialized, hence faster) version of a function
into another (typically more generic, hence slower) version.
In languages with a fully integrated managed runtime this intrinsic can
be used to implement "uncommon trap" like functionality. In unmanaged
languages like C and C++, this intrinsic can be used to represent the
slow paths of specialized functions.
Note: this change does not address how `@llvm.experimental_deoptimize`
is lowered. That will be done in a later change.
Reviewers: chandlerc, rnk, atrick, reames
Subscribers: llvm-commits, kmod, mjacob, maksfb, mcrosier, JosephTremoulet
Differential Revision: http://reviews.llvm.org/D17732
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263281
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Fri, 11 Mar 2016 18:57:48 +0000 (18:57 +0000)]
[PGO] Skip value profile instrumentation of inline asm
Value profile instrumentation treats inline asm calls like they are
indirect calls. This causes problems when the 'Callee' is passed to a
ptrtoint cast -- the verifier rightly claims that this is bogus and
crashes opt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263278
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Fri, 11 Mar 2016 18:52:24 +0000 (18:52 +0000)]
[ThinLTO] Support for reference graph in per-module and combined summary.
Summary:
This patch adds support for including a full reference graph including
call graph edges and other GV references in the summary.
The reference graph edges can be used to make importing decisions
without materializing any source modules, can be used in the plugin
to make file staging decisions for distributed build systems, and is
expected to have other uses.
The call graph edges are recorded in each function summary in the
bitcode via a list of <CalleeValueIds, StaticCount> tuples when no PGO
data exists, or <CalleeValueId, StaticCount, ProfileCount> pairs when
there is PGO, where the ValueId can be mapped to the function GUID via
the ValueSymbolTable. In the function index in memory, the call graph
edges reference the target via the CalleeGUID instead of the
CalleeValueId.
The reference graph edges are recorded in each summary record with a
list of referenced value IDs, which can be mapped to value GUID via the
ValueSymbolTable.
Addtionally, a new summary record type is added to record references
from global variable initializers. A number of bitcode records and data
structures have been renamed to reflect the newly expanded scope of the
summary beyond functions. More cleanup will follow.
Reviewers: joker.eph, davidxl
Subscribers: joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D17212
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263275
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Spertus [Fri, 11 Mar 2016 18:26:47 +0000 (18:26 +0000)]
Type correct Visual Studio native visualization for PointerUnions
Visualize pointer unions by their actual type rather than as void *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263270
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 11 Mar 2016 17:33:36 +0000 (17:33 +0000)]
Update test case to appease bots after 263255.
I'll follow up with Matt to confirm this is the correct fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263268
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 11 Mar 2016 17:31:43 +0000 (17:31 +0000)]
Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263266
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 11 Mar 2016 17:28:03 +0000 (17:28 +0000)]
[IRTranslator] Translate unconditional branches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263265
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 11 Mar 2016 17:27:58 +0000 (17:27 +0000)]
[MachineIRBuilder] Rework buildInstr API to maximize code reuse.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263264
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 11 Mar 2016 17:27:54 +0000 (17:27 +0000)]
[IRTranslator] Update getOrCreateVReg API to use references.
A value that we want to keep in a virtual register cannot be null.
Reflect that in the API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263263
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 11 Mar 2016 17:27:51 +0000 (17:27 +0000)]
[MachineIRBuilder] Rename the setter of MF for consistency with the getter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263262
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 11 Mar 2016 17:27:47 +0000 (17:27 +0000)]
[MachineIRBuilder] Rename the setter for MBB for consistency with the getter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263261
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 11 Mar 2016 17:27:43 +0000 (17:27 +0000)]
[IRTranslator] Update getOrCreateBB API to use references.
A null basic block is invalid, so just pass a reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263260
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 11 Mar 2016 17:27:38 +0000 (17:27 +0000)]
[GlobalISel][Target] Add an opcode for unconditional branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263259
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Fri, 11 Mar 2016 17:15:50 +0000 (17:15 +0000)]
Remove PreserveNames template parameter from IRBuilder
Summary:
Following r263086, we are now relying on a flag on the Context to
discard Value names in release builds.
Reviewers: chandlerc
Subscribers: mzolotukhin, llvm-commits
Differential Revision: http://reviews.llvm.org/D18023
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263258
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Fri, 11 Mar 2016 17:15:34 +0000 (17:15 +0000)]
Do not specialize IRBuilder to strip names in SROA
Summary:
Following r263086, we are replacing this by a runtime check.
More cleanup will follow on the IRBuilder itself, but I submitted
this patch separately as SROA has a fancy "prefixInserter" class
that needs extra-love.
Reviewers: chandlerc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D18022
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263256
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 11 Mar 2016 16:54:07 +0000 (16:54 +0000)]
[misched] Fix a truncation issue from r263021.
The truncation was causing the sorting algorithm to behave oddly when comparing
positive and negative offsets. Fortunately, this doesn't currently happen in
practice and was exposed by a WIP. Thus, I can't test this change now, but the
follow on patch will.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263255
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 11 Mar 2016 16:25:19 +0000 (16:25 +0000)]
[PM] Sink the "Expression" type for GVN into the class as a private
member type.
Because of how this type is used by the ValueTable, it cannot actually
have hidden visibility. GCC actually nicely warns about this but Clang
just silently ... I don't even know. =/ We should do a better job either
way though.
This should resolve a bunch of the GCC warnings about visibility that
the port of GVN triggered and make the visibility story a bit more
correct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263250
91177308-0d34-0410-b5e6-
96231b3b80d8
Marianne Mailhot-Sarrasin [Fri, 11 Mar 2016 15:59:32 +0000 (15:59 +0000)]
More UTF string conversion wrappers
Added new string conversion wrappers that convert between `std::string` (of UTF-8 bytes) and `std::wstring`, which is particularly useful for Win32 interop. Also fixed a missing string conversion for `getenv` on Win32, using these new wrappers.
The motivation behind this is to provide the support functions required for LLDB to work properly on Windows with non-ASCII data; however, the functions are not LLDB specific.
Patch by cameron314
Differential Revision: http://reviews.llvm.org/D17549
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263247
91177308-0d34-0410-b5e6-
96231b3b80d8
Valery Pykhtin [Fri, 11 Mar 2016 14:53:28 +0000 (14:53 +0000)]
[AMDGPU] Fix VOPC instruction operand namings
Differential Revision: http://reviews.llvm.org/D17966
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263242
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 11 Mar 2016 14:39:10 +0000 (14:39 +0000)]
[X86][AVX] Fixed issue where a long chain of shuffles could attempt to combine to a single (illegal) PSHUFB instruction.
Its not enough that we test for SSSE3 - that's only OK for 128-bit vectors - we also need to test for AVX2 / AVX512BW for 256/512 bit vector cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263239
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 11 Mar 2016 13:53:18 +0000 (13:53 +0000)]
[AA] Make BasicAA just require domtree.
This doesn't change how many times we construct domtrees in the normal
pipeline, and it removes fragility and instability where basic-aa may
not be run in time to see domtrees because they happen to be constructed
afterward.
This isn't quite as clean as the change to memdep because there is
a mode where basic-aa specifically runs without domtrees -- in the
hacking version used by function-attrs with the legacy pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263234
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 11 Mar 2016 13:46:00 +0000 (13:46 +0000)]
[memdep] Just require domtree for memdep.
This doesn't cause us to construct dominator trees any more often in the
normal pipeline, and removes an entire mode of memdep that needed to be
reasoned about and maintained. Perhaps more importantly, it removes the
ability for the results of memdep to be different because of accidental
pass scheduling goofs or the order of evaluation of 'getResult' calls.
Essentially, 'getCachedResult', unless across IR-unit boundaries, is
extremely dangerous. We need to work much harder to avoid it (or its
analog in the old pass manager).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263232
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 11 Mar 2016 13:26:47 +0000 (13:26 +0000)]
[PM] The order of evaluation of these analyses is actually significant,
much to my horror, so use variables to fix it in place.
This terrifies me. Both basic-aa and memdep will provide more precise
information when the domtree and/or the loop info is available. Because
of this, if your pass (like GVN) requires domtree, and then queries
memdep or basic-aa, it will get more precise results. If it does this in
the other order, it gets less precise results.
All of the ideas I have for fixing this are, essentially, terrible. Here
I've just caused us to stop having unspecified behavior as different
implementations evaluate the order of these arguments differently. I'm
actually rather glad that they do, or the fragility of memdep and
basic-aa would have gone on unnoticed. I've left comments so we don't
immediately break this again. This should fix bots whose host compilers
evaluate the order of arguments differently from Clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263231
91177308-0d34-0410-b5e6-
96231b3b80d8
Vasileios Kalintiris [Fri, 11 Mar 2016 13:05:06 +0000 (13:05 +0000)]
[mips] MIPSR6 Instruction itineraries
Summary: Defines instruction itineraries for common MIPSR6 instructions.
Patch by Simon Dardis.
Reviewers: vkalintiris
Subscribers: MatzeB, dsanders, llvm-commits
Differential Revision: http://reviews.llvm.org/D17198
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263229
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 11 Mar 2016 12:10:15 +0000 (12:10 +0000)]
[PM] Update Kaleidoscope with the new header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263223
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 11 Mar 2016 11:37:50 +0000 (11:37 +0000)]
[mips] Range check simm4.
Summary:
Reviewers: vkalintiris
Subscribers: dsanders, llvm-commits
Differential Revision: http://reviews.llvm.org/D16811
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263220
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 11 Mar 2016 11:05:24 +0000 (11:05 +0000)]
[PM] Make the AnalysisManager parameter to run methods a reference.
This was originally a pointer to support pass managers which didn't use
AnalysisManagers. However, that doesn't realistically come up much and
the complexity of supporting it doesn't really make sense.
In fact, *many* parts of the pass manager were just assuming the pointer
was never null already. This at least makes it much more explicit and
clear.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263219
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 11 Mar 2016 10:33:22 +0000 (10:33 +0000)]
[PM] Rename the CRTP mixin base classes for the new pass manager to
clarify their purpose.
Firstly, call them "...Mixin" types so it is clear that there is no
type hierarchy being formed here. Secondly, use the term 'Info' to
clarify that they aren't adding any interesting *semantics* to the
passes or analyses, just exposing APIs used by the management layer to
get information about the pass or analysis.
Thanks to Manuel for helping pin down the naming confusion here and come
up with effective names to address it.
In case you already have some out-of-tree stuff, the following should be
roughly what you want to update:
perl -pi -e 's/\b(Pass|Analysis)Base\b/\1InfoMixin/g'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263217
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 11 Mar 2016 10:22:49 +0000 (10:22 +0000)]
[PM] Implement the final conclusion as to how the analysis IDs should
work in the face of the limitations of DLLs and templated static
variables.
This requires passes that use the AnalysisBase mixin provide a static
variable themselves. So as to keep their APIs clean, I've made these
private and befriended the CRTP base class (which is the common
practice).
I've added documentation to AnalysisBase for why this is necessary and
at what point we can go back to the much simpler system.
This is clearly a better pattern than the extern template as it caught
*numerous* places where the template magic hadn't been applied and
things were "just working" but would eventually have broken
mysteriously.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263216
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 11 Mar 2016 10:20:56 +0000 (10:20 +0000)]
[InstCombine] Use Twines to generate names.
Since the names are used in a loop this does more work in debug builds. In
release builds value names are generally discarded so we don't have to do
the concatenation at all. It's also simpler code, no functional change
intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263215
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikolay Haustov [Fri, 11 Mar 2016 09:27:25 +0000 (09:27 +0000)]
[AMDGPU] Assembler: change v_madmk operands to have same order as mad.
The constant is now at source operand 1 (previously at 2).
This is also how it is in legacy AMD sp3 assembler.
Update tests.
Differential Revision: http://reviews.llvm.org/D17984
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263212
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 11 Mar 2016 09:15:11 +0000 (09:15 +0000)]
[PM/AA] Teach the AAManager how to handle module analyses in addition to
function analyses, and use it to wire up globals-aa to the new pass
manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263211
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 11 Mar 2016 08:50:55 +0000 (08:50 +0000)]
[PM] Port GVN to the new pass manager, wire it up, and teach a couple of
tests to run GVN in both modes.
This is mostly the boring refactoring just like SROA and other complex
transformation passes. There is some trickiness in that GVN's
ValueNumber class requires hand holding to get to compile cleanly. I'm
open to suggestions about a better pattern there, but I tried several
before settling on this. I was trying to balance my desire to sink as
much implementation detail into the source file as possible without
introducing overly many layers of abstraction.
Much like with SROA, the design of this system is made somewhat more
cumbersome by the need to support both pass managers without duplicating
the significant state and logic of the pass. The same compromise is
struck here.
I've also left a FIXME in a doxygen comment as the GVN pass seems to
have pretty woeful documentation within it. I'd like to submit this with
the FIXME and let those more deeply familiar backfill the information
here now that we have a nice place in an interface to put that kind of
documentaiton.
Differential Revision: http://reviews.llvm.org/D18019
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263208
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 11 Mar 2016 08:20:50 +0000 (08:20 +0000)]
AMDGPU: Don't use InstVisitor for AMDGPUPromoteAlloca
Frontend authors are strongly encouraged to keep allocas
in the entry block, so don't bother visiting every instruction
in the other blocks of the function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263206
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 11 Mar 2016 08:00:27 +0000 (08:00 +0000)]
AMDGPU: R600 code splitting cleanup
Move a few functions only used by R600 to R600 specific code,
fix header macros to stop using R600, mark classes as final.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263204
91177308-0d34-0410-b5e6-
96231b3b80d8
Hrvoje Varga [Fri, 11 Mar 2016 08:00:11 +0000 (08:00 +0000)]
[mips] Invalid tests for MTC0, MTC2, MFC0, MFC2, DMTC0, DMFC0 MIPS instructions
Differential Revision: http://reviews.llvm.org/D18037
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263203
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 11 Mar 2016 07:42:49 +0000 (07:42 +0000)]
AMDGPU: Materialize sign bits with bfrev
If a constant is the same as the reverse of an inline immediate,
this is 4 bytes smaller than having to embed a 32-bit literal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263201
91177308-0d34-0410-b5e6-
96231b3b80d8
Junmo Park [Fri, 11 Mar 2016 07:05:32 +0000 (07:05 +0000)]
Minor code cleanups. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263200
91177308-0d34-0410-b5e6-
96231b3b80d8
Junmo Park [Fri, 11 Mar 2016 05:07:07 +0000 (05:07 +0000)]
Minor code cleanup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263196
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 11 Mar 2016 02:14:16 +0000 (02:14 +0000)]
Remove llvm::getDISubprogram in favor of Function::getSubprogram
llvm::getDISubprogram walks the instructions in a function, looking for one in the scope of the current function, so that it can find the !dbg entry for the subprogram itself.
Now that !dbg is attached to functions, this should not be necessary. This patch changes all uses to just query the subprogram directly on the function.
Ideally this should be NFC, but in reality its possible that a function:
has no !dbg (in which case there's likely a bug somewhere in an opt pass), or
that none of the instructions had a scope referencing the function, so we used to not find the !dbg on the function but now we will
Reviewed by Duncan Exon Smith.
Differential Revision: http://reviews.llvm.org/D18074
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263184
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Fri, 11 Mar 2016 00:51:57 +0000 (00:51 +0000)]
[gold] Fix common symbols handling.
LLVM Gold plugin decides which instance of a common symbol it wants
based on the symbol size in claim_file_hook. If the file that
contains the chosen instance is later dropped from the link, we end
up with an undefined reference.
This change delays this decision until the set of the included files
is known.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263180
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Thu, 10 Mar 2016 23:54:39 +0000 (23:54 +0000)]
[LLE] Add missed LoopSimplify dependence
The code assumed that we always had a preheader without making the pass
dependent on LoopSimplify.
Thanks to Mattias Eriksson V for reporting this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263173
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 10 Mar 2016 23:02:21 +0000 (23:02 +0000)]
AArch64: only try to use scaled fcvt ops on legal vector types.
Before we ended up calling getSimpleVectorType on a <3 x float>, which
asserted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263169
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 10 Mar 2016 22:35:33 +0000 (22:35 +0000)]
[x86] don't use a shuffle when a vselect will do; NFCI
Looking at the IR definition of a masked load made me realize
there was no reason to use a shuffle here, so we don't need
to convert the format of the mask at all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263167
91177308-0d34-0410-b5e6-
96231b3b80d8