133757 Commits

Author SHA1 Message Date
Evgeniy Stepanov
57ba611520 Fix BitVector move ctor/assignment.
Current implementation leaves the object in an invalid state.

This reverts commit bf0c389ac683cd6c0e5959b16537e59e5f4589e3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272965 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 21:45:13 +00:00
Matt Arsenault
6d25c4fea6 TTI: Add hook for memory width to vectorize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272964 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 21:43:12 +00:00
David Majnemer
5dd02f3333 [CodeView] Implement support for enums
MSVC handles enums differently from structs and classes: a forward
declaration is not emitted unconditionally.  MSVC does not emit an S_UDT
record for the enum.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272960 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 21:32:16 +00:00
Matt Arsenault
dc9478ac13 AArch64: Fix range loop contradicting comment above it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 21:21:49 +00:00
Changpeng Fang
a3e290966a AMDGPU/SI: Propagate the Kill flag in storeRegToStackSlot and eliminateFrameIndex
Reviewers: arsenm, tstellarAMD

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272958 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 21:20:47 +00:00
Nirav Dave
afacc9421f Revert "Refactor and cleanup Assembly Parsing / Lexing"
Reverting for unexpected crashes on various platforms.

This reverts commit r272953.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272957 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 21:19:23 +00:00
Matt Arsenault
f3108f6961 AMDGPU: Fix maximum instruction size for amdgcn
This was causing the conservative estimate of inline asm
size to be twice as big as expected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272956 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 21:14:05 +00:00
Sanjoy Das
7d80f210a6 [EarlyCSE] Minor cosmetic NFC changes
- Avoid implicit conversion from pointer to bool
 - Add a comment when passing in a boolean value

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272955 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 21:00:57 +00:00
Sanjoy Das
60eee05a65 [EarlyCSE] Fold invariant loads
Redundant invariant loads can be CSE'ed with very little extra effort
over what early-cse already tracks, so it looks reasonable to make
early-cse handle this case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272954 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 20:47:57 +00:00
Nirav Dave
e0348ce1ac Refactor and cleanup Assembly Parsing / Lexing
Add explicit Comment Token in Assembly Lexing for future support for
outputting explicit comments from inline assembly. As part of this,
CPPHash Directives are now explicitly distinguished from Hash line
comments in Lexer.

Line comments are recorded as EndOfStatement tokens, not Comment tokens
to simplify compatibility with current TargetParsers. This slightly
complicates comment output.

This remove all lexing tasks out of the parser, does minor cleanup
to remove extraneous newlines Asm Output, and some improvements white
space handling.

Reviewers: rtrieu, dwmw2, rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272953 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 20:34:22 +00:00
Kostya Serebryany
c0e47a82c1 [libFuzzer] use the new chainable malloc hooks instead of the old un-chainable ones, use atomic for malloc/free counters instead of a thread local counter in the main thread. This should make on-the-spot leak detection in libFuzzer more reliable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272948 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 20:17:41 +00:00
Justin Lebar
47367896f1 Fix strip-dead-debug-info test if path contains "bar".
This test checks that the string 'bar' (no quotes) doesn't exist in the
output after running opt.  But opt embeds the absolute path to the
filename, and on my machine, the filename contains the string 'jlebar',
causing the test to fail.

This patch changes the test to look for the string '"bar"' instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272941 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 19:39:55 +00:00
Paul Robinson
18105824ee Make check lines not match themselves.
Noticed during review of the recent FileCheck change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272940 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 19:38:48 +00:00
Rafael Espindola
4029bd9503 Refactor more duplicated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272939 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 19:30:55 +00:00
Sanjoy Das
394afc7ae2 NFC; refactor getFrameIndexReferenceFromSP
Summary:
... into getFrameIndexReferencePreferSP.  This change folds the
fail-then-retry logic into getFrameIndexReferencePreferSP.

There is a non-functional but behaviorial change in WinException --
earlier if `getFrameIndexReferenceFromSP` failed we'd trip an assert,
but now we'll silently use the (wrong) offset from the base pointer.  I
could not write the assert I'd like to write ("FrameReg ==
StackRegister", like I've done in X86FrameLowering) since there is no
easy way to get to the stack register from WinException (happy to be
proven wrong here).  One solution to this is to add a `bool
OnlyStackPointer` parameter to `getFrameIndexReferenceFromSP` that
asserts if it could not satisfy its promise of returning an offset from
a stack pointer, but that seems overkill.

Reviewers: rnk

Subscribers: sanjoy, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 18:54:06 +00:00
Rafael Espindola
a49d9c3777 Refactor duplicated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272936 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 18:50:12 +00:00
Sanjay Patel
a240c3eb0e [x86] autoupgrade and remove AVX2 integer min/max intrinsics
This will (hopefully very temporarily) break clang.
The clang side of this should be the next commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272932 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 18:44:20 +00:00
Rui Ueyama
6b7e0cc92c [codeview] Use hashBufferV8 to verify all type records.
Differential Revision: http://reviews.llvm.org/D21393

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272930 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 18:39:17 +00:00
Zachary Turner
e8d381d02c Resubmit "[pdb] Change type visitor pattern to be dynamic."
There was a regression introduced during type stream merging when
visiting a field list record.  This has been fixed in this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272929 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 18:22:27 +00:00
Rafael Espindola
1f4afa2405 dos2unix this test. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272928 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 18:21:11 +00:00
Zachary Turner
575a9fbcc9 Revert "[pdb] Change type visitor pattern to be dynamic."
This reverts commit fb0dd311e1ad945827b8ffd5354f4810e2be1579.

This breaks some llvm-readobj tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272927 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 18:09:04 +00:00
Zachary Turner
fb0dd311e1 [pdb] Change type visitor pattern to be dynamic.
This allows better catching of compiler errors since we can use
the override keyword to verify that methods are actually
overridden.

Also in this patch I've changed from storing a boolean Error
code everywhere to returning an llvm::Error, to propagate richer
error information up the call stack.

Reviewed By: ruiu, rnk
Differential Revision: http://reviews.llvm.org/D21410

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272926 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 18:00:28 +00:00
Davide Italiano
705956ea8f [PM] Revert the port of MergeLoadStoreMotion to the new pass manager.
Daniel Berlin expressed some real concerns about the port and proposed
and alternative approach. I'll revert this for now while working on a
new patch, which I hope to put up for review shortly. Sorry for the churn.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272925 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 17:40:53 +00:00
Chad Rosier
8e662dc4d5 [DSE] Minor style cleanup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272922 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 17:06:04 +00:00
Sanjay Patel
255484c723 remove old FileCheck lines that are no longer used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272921 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 17:04:16 +00:00
Sanjay Patel
f449b0e944 [DAG] Remove redundant FMUL in Newton-Raphson SQRT code
When calculating a square root using Newton-Raphson with two constants,
a naive implementation is to use five multiplications (four muls to calculate
reciprocal square root and another one to calculate the square root itself).
However, after some reassociation and CSE the same result can be obtained
with only four multiplications. Unfortunately, there's no reliable way to do
such a reassociation in the back-end. So, the patch modifies NR code itself
so that it directly builds optimal code for SQRT and doesn't rely on any
further reassociation.

Patch by Nikolai Bozhenov!

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272920 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 16:58:54 +00:00
Wei Ding
4edb79d2d9 AMDGPU: Add v_mad 16-bit instructions definition.
Differential Revision: http://reviews.llvm.org/D21362

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 16:50:04 +00:00
Adam Nemet
b4b586ba9c [LLE] New test to check that no versioning for symbolic strides occurs. NFC
This is currently only performed in the Vectorizer.  I will change this
as symbolic stride collection is moved to LAA.

This test will track when the actual functional change occurs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 16:45:29 +00:00
Matt Arsenault
ce9eebb1ec LangRef: Note expectations when loading with extra alignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272914 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 16:33:41 +00:00
Igor Laevsky
bf43bfa0c0 Revert r272891 "[JumpThreading] Prevent dangling pointer problems in BranchProbabilityInfo"
It was causing failures in Profile-i386 and Profile-x86_64 tests.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272912 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 16:25:53 +00:00
Reid Kleckner
71b1fedfef [PATCH] Fix RuntimeDyldCOFFI386 to handle relocations with a non-zero addend
This fixes IMAGE_REL_I386_DIR32, IMAGE_REL_I386_DIR32NB,
IMAGE_REL_I386_SECREL, and IMAGE_REL_I386_REL32 relocations.

Based on patch by Jon Turney <jon.turney@dronecode.org.uk>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 16:21:41 +00:00
Rafael Espindola
b72793375f Don't print (PLT) on arm.
The R_ARM_PLT32 relocation is deprecated and is not produced by MC.

This means that the code being deleted is dead from the .o point of
view and was making the .s more confusing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272909 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 16:09:53 +00:00
Sanjay Patel
2c8c45d695 [x86] autoupgrade and remove SSE2/SSE41 integer min/max intrinsics
Follow-up to:
http://reviews.llvm.org/rL272806
http://reviews.llvm.org/rL272807


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 15:48:30 +00:00
Daniel Sanders
7b8f692aa1 Remove redundant -mattr options from llvm-objdump commands.
The -mattr options in these four tests have no effect on the output of
llvm-objdump. In the case of the two Mips tests, removing the -mattr option
left duplicate RUN lines so the duplicates have been removed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272906 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 15:47:19 +00:00
Rafael Espindola
4b205a57a6 Refactor duplicated code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272905 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 15:44:06 +00:00
Rafael Espindola
cb6c7a5185 Refactor duplicated code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272904 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 15:40:24 +00:00
Rafael Espindola
bb6bdeccf1 Refactor duplicated code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 15:31:06 +00:00
Rafael Espindola
5f2b7065a7 Refactor duplicated code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272901 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 15:22:01 +00:00
Rui Ueyama
43c7bd0b82 [codeview] Pass CVRecord to visitTypeBegin callback.
Both parameters to visitTypeBegin are actually members of CVRecord,
so we can just pass CVRecord instead of destructuring it.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272899 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 14:47:23 +00:00
Rui Ueyama
70154cb57e [codeview] Remove unused parameter.
Differential Revision: http://reviews.llvm.org/D21433

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272898 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 14:41:22 +00:00
Vasileios Kalintiris
c5b5eea1fd [mips] Fix small typo. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272895 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 14:25:13 +00:00
Rui Ueyama
a3568c118e Implement pdb::hashBufferV8 hash function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272894 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 13:48:16 +00:00
Igor Laevsky
5695246406 [JumpThreading] Prevent dangling pointer problems in BranchProbabilityInfo
We should update results of the BranchProbabilityInfo after removing block in JumpThreading. Otherwise 
we will get dangling pointer inside BranchProbabilityInfo cache.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 13:28:25 +00:00
Rui Ueyama
7d0c878650 Remove redundant namespace specifiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272889 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 13:17:59 +00:00
Rui Ueyama
1d884ca9ef [codeview] Use CVTypeVisitor instead of a hand-written switch-cases.
Differential Revision: http://reviews.llvm.org/D21418

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272888 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 13:14:42 +00:00
Patrik Hagglund
d116e8943c PR27938: Don't remove valid DebugLoc in Scalarizer
Added checks to make sure the Scalarizer::transferMetadata() don't
remove valid debug locations from instructions. This is important as
the verifier pass require that e.g. inlinable callsites have a valid
debug location.

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

Patch by Karl-Johan Karlsson

Reviewers: dblaikie

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272884 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 10:48:54 +00:00
Daniel Sanders
efa6f4843e [mips][mips16] Fix machine verifier errors about incorrect register classes on load/stores.
Summary:
[ls][bh] and [ls][bh]u cannot use sp-relative addresses and must therefore
lower frameindex nodes such that there is a copy to a CPU16Regs register. This
is now done consistently using a separate addressing mode that does not
permit frameindex nodes.

As part of this I've had to remove an optimization that reduced the number of
instructions needed to work around the lack of sp-relative addresses on [ls][bh]
and [ls][bh]u. This optimization used one of the eight CPU16Regs registers as
a copy of the stack pointer and it's implementation was the root cause of many
of the register vs register class mismatches.

lw/sw can use sp-relative addresses but we ought to ensure that we use the
correct version of lw/sw internally for things like IAS. This is not currently
the case and this change does not fix this. However, this change does clean it
up sufficiently well to fix the machine verifier failures.

Also removed irrelevant functions from stchar.ll.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272882 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 10:20:59 +00:00
Daniel Sanders
0b8fc77698 [llvm-objdump] Support detection of feature bits from the object and implement this for Mips.
Summary:
The Mips implementation only covers the feature bits described by the ELF
e_flags so far. Mips stores additional feature bits such as MSA in the
.MIPS.abiflags section.

Also fixed a small bug this revealed where microMIPS wouldn't add the
EF_MIPS_MICROMIPS flag when using -filetype=obj.

Reviewers: echristo, rafael

Subscribers: rafael, mehdi_amini, dsanders, sdardis, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272880 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 09:17:03 +00:00
Adam Nemet
2e5ed34ad6 [LAA] Rename Strides to SymblicStrides in analyzeLoop. NFC
This is to facilitate to move of SymblicStrides from LV to LAA.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272879 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 08:27:03 +00:00
Adam Nemet
08e6f75e04 [LAA] Default getInfo to not speculate symbolic strides. NFC
Soon we won't be passing Strides to getInfo and then we'll have fewer
call sites to update.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272878 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 08:26:56 +00:00