Commit Graph

124025 Commits

Author SHA1 Message Date
Xinliang David Li
4d60f67763 Fix unaligned memory read issue exposed by ubsan
Indexed profile data as designed today does not guarantee
counter data to be well aligned, so reading needs to use
the slower form (with memcpy). This is less than ideal and 
should be improved in the future (i.e., with fixed length
function key instead of variable length name key).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253309 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-17 03:47:21 +00:00
Davide Italiano
15d19608b0 [Documentation] Add guidelines for grouping tests together.
This was considered a good practice but it was not documented. Now it is.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253281 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-17 02:17:35 +00:00
Rafael Espindola
8dcaa9fb08 Drop prelink support.
The way prelink used to work was

* The compiler decides if a given section only has relocations that
are know to point to the same DSO. If so, it names it
.data.rel.ro.local<something>.
* The static linker puts all of these together.
* The prelinker program assigns addresses to each library and resolves
the local relocations.

There are many problems with this:
* It is incompatible with address space randomization.
* The information passed by the compiler is redundant. The linker
knows if a given relocation is in the same DSO or not. If could sort
by that if so desired.
* There are newer ways of speeding up DSO (gnu hash for example).
* Even if we want to implement this again in the compiler, the previous
  implementation is pretty broken. It talks about relocations that are
  "resolved by the static linker". If they are resolved, there are none
  left for the prelinker. What one needs to track is if an expression
  will require only dynamic relocations that point to the same DSO.

At this point it looks like the prelinker is an historical curiosity.
For example, fedora has retired it because it failed to build for two
releases
(http://pkgs.fedoraproject.org/cgit/prelink.git/commit/?id=eb43100a8331d91c801ee3dcdb0a0bb9babfdc1f)

This patch removes support for it. That is, it stops printing the
".local" sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253280 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-17 00:51:23 +00:00
Matthias Braun
0b897129c1 Assume lane masks are always precise
Allowing imprecise lane masks in case of more than 32 sub register lanes
lead to some tricky corner cases, and I need another bugfix for another
one. Instead I rather declare lane masks as precise and let tablegen
abort if we do not have enough bits.

This does not affect any in-tree target, even AMDGPU only needs 16 lanes
at the moment. If the 32 lanes turn out to be a problem in the future,
then we can easily change the LaneBitmask typedef to uint64_t.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253279 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-17 00:50:55 +00:00
David Blaikie
0f6bba93de Fix indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253278 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-17 00:41:02 +00:00
David Blaikie
7cd8652959 dwarfdump: Use the index to find the right abbrev offset in DWP files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253277 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-17 00:39:55 +00:00
Derek Schuff
36eebaa409 [WebAssembly] Fix printing of global operands
This was regressed in r252656 which wasn't quite NFC. Instead of using a
custom instruction as before, use a pattern to select CONST_I32 for the
global addrs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253276 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-17 00:20:44 +00:00
Philip Reames
1836bbe6cd [PRE] Preserve !invariant.load metadata
Spoted via inspection.  Test case included.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253275 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-17 00:15:09 +00:00
Simon Pilgrim
3305a140fd [X86][SSE] Merged BLEND shuffle decode comments. NFC.
Now that we can recognise different vector sizes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253268 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 23:03:18 +00:00
David Blaikie
10f0544c8b Demote a single-use named function object to a lambda
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253267 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 22:56:30 +00:00
Simon Pilgrim
7dd95ec212 [X86][SSE] Merged ALIGNR/SLLDQ/SRLDQ shuffle decode comments. NFC.
Now that we can recognise different vector sizes - will make future AVX512 additions easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253266 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 22:54:41 +00:00
Simon Pilgrim
f780acfa6b [X86][SSE] Merged SHUF/PERM shuffle decode comments. NFC.
Now that we can recognise different vector sizes - will make future AVX512 additions easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253260 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 22:39:27 +00:00
Simon Pilgrim
e80993a4e4 [X86][SSE] Merged UNPCK shuffle decode comments. NFC.
Now that we can recognise different vector sizes - will make future AVX512 additions easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253258 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 22:21:10 +00:00
Sanjay Patel
eaf6bc683e use range-based for loop; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253256 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 22:16:52 +00:00
Stephen Canon
0136ee950c Add isInteger() to APFloat.
Useful utility function; this wasn't too hard to do before, but also wasn't
obviously discoverable.  Make it explicit.  Reviewed offline by Michael
Gottesman.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253254 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 21:52:48 +00:00
Michael Zolotukhin
b13e139754 [PR25538]: Fix a failure caused by r253126.
In r253126 we stopped to recompute LCSSA after loop unrolling in all
cases, except the unrolling is full and at least one of the loop exits
is outside the parent loop. In other cases the transformation should not
break LCSSA, but it turned out, that we also call SimplifyLoop on the
parent loop, which might break LCSSA by itself. This fix just triggers
LCSSA recomputation in this case as well.

I'm committing it without a test case for now, but I'll try to invent
one. It's a bit tricky because in an isolated test LoopSimplify would
be scheduled before LoopUnroll, and thus will change the test and hide
the problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253253 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 21:17:26 +00:00
Derek Schuff
1a4e019fc0 [WebAssembly] Fix function return type printing
Summary:
Previously return type information for a function was derived from
return dag nodes. But this didn't work for dags with != return node. So
instead compute it directly from the LLVM function as is done for imports.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253251 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 21:12:41 +00:00
Derek Schuff
8f9915e419 [WebAssembly] Reverse the order of operands for br_if
Summary: This is to match the new version in the spec

Reviewers: sunfish

Subscribers: jfb, llvm-commits, dschuff

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253249 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 21:04:51 +00:00
David Majnemer
3ee61b8306 [IR] Manage TheNoneToken with a std::unique_ptr
Hopefully, this will make the sanitizer build bots happy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253248 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 20:55:57 +00:00
Kit Barton
90858d35f8 Find available scratch register to use in function prologue and epilogue as part of shrink wrapping.
Phabricator: http://reviews.llvm.org/D13955

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253247 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 20:22:15 +00:00
Reid Kleckner
e689ed5002 [WinEH] Don't let UnwindHelp alias the return address
On top of that, don't bother allocating and initializing UnwindHelp if
we don't have any funclets. Currently we always use RBP as our frame
pointer when funclets are present, so this change makes it impossible to
come here without any fixed stack objects.

Fixes PR25533.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253245 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 18:47:25 +00:00
Reid Kleckner
0929f1339a Use the subtarget reference that we already have
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253244 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 18:47:12 +00:00
Owen Anderson
2a949077a9 Add intermediate subtract instructions to reassociation worklist.
We sometimes create intermediate subtract instructions during
reassociation.  Adding these to the worklist to revisit exposes many
additional reassociation opportunities.

Patch by Aditya Nandakumar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253240 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 18:07:30 +00:00
David Majnemer
578dced0a1 [LoopStrengthReduce] Don't increment iterator past the end of the BB
We tried to move the insertion point beyond instructions like landingpad
and cleanuppad.
However, we *also* tried to move past catchpad.  This is problematic
because catchpad is also a terminator.

This fixes PR25541.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253238 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 17:37:58 +00:00
Vasileios Kalintiris
a90c8e5d67 [mips] Disable code generation through FastISel for MIPS32R6.
Reviewers: dsanders

Subscribers: llvm-commits, dsanders

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253225 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 17:05:01 +00:00
Davide Italiano
6736b2f9fa [SimplifyLibCalls] Generalize a comment. This doesn't apply only to sqrt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253224 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 16:54:28 +00:00
Petr Pavlu
1890cef0c5 [ARM] Prevent use of a value pointed by end() iterator when placing a jump table
Function ARMConstantIslands::doInitialJumpTablePlacement() iterates over all
basic blocks in a machine function. It calls `MI = MBB.getLastNonDebugInstr()`
to get the last instruction in each block and then uses MI->getOpcode() to
decide what to do. If getLastNonDebugInstr() returns MBB.end() (for example,
when the block does not contain any instructions) then calling getOpcode() on
this value is incorrect. Avoid this problem by checking the result of
getLastNonDebugInstr().

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253222 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 16:41:13 +00:00
Oliver Stannard
20bb042d74 [ARM,AArch64] Store source location of asm constant pool entries
Storing the source location of the expression that created a constant pool
entry allows us to emit better error messages if we later discover that the
expression cannot be represented by a relocation.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253220 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 16:25:47 +00:00
Oliver Stannard
1b10e7aa06 [ARM,AArch64] Store source location for values in assembly files
The MCValue class can store a SMLoc to allow better error messages to be
emitted if an error is detected after parsing. The ARM and AArch64 assembly
parsers were not setting this, so error messages did not have source
information.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253219 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 16:22:47 +00:00
Dan Gohman
e5484b4329 [WebAssembly] Prototype passes for register coloring and register stackifying.
These passes are not yet enabled by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253217 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 16:18:28 +00:00
Daniel Sanders
a3a518c309 [mips][ias] Remove spurious ';' from inline assembly test.
IAS will not emit it. NFC at the moment but will prevent a test failure once
IAS is enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253210 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 14:19:32 +00:00
Daniel Sanders
5bc4edecec [mips][ias] Accept $31 or $ra in hf16call32.ll. IAS prints the latter.
NFC at the moment, but it will prevent a test failure once IAS is enabled.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253209 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 14:16:45 +00:00
Daniel Sanders
4f0f3087bb [mips][ias] Allow whitespace after commas in inlineasm*.ll tests.
IAS always prints whitespace after a comma. NFC at the moment but this will
prevent failures when IAS is enabled.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253208 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 14:14:59 +00:00
Artyom Skrobov
4c351fd4e8 Handle ARMv6KZ naming
Summary:
* ARMv6KZ is the "canonical" name, given in the ARMARM
* ARMv6Z is an "official abbreviation" for it, mentioned in the ARMARM
* ARMv6ZK is a popular misspelling, which we should support as an alias.

The patch corrects the handling of the names.

Functional changes:
* ARMv6Z no longer treated as an architecture in its own right
* ARMv6ZK renamed to ARMv6KZ, accepting ARMv6ZK as an alias
* arm1176jz-s and arm1176jzf-s recognized as ARMv6ZK, instead of ARMv6K
* default ARMv6K CPU changed to arm1176j-s

Reviewers: rengolin, logan, compnerd

Subscribers: aemerson, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253206 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 14:05:32 +00:00
Artyom Skrobov
05400e9493 NFC refactorings in lib/Support/TargetParser.cpp
Summary:
* declare FPUNames, ARCHNames, ARCHExtNames, HWDivNames, CPUNames
  as static const
* implement getDefaultExtensions with a StringSwitch, in the same
  way getDefaultFPU is implemented

Reviewers: rengolin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253201 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 12:08:05 +00:00
Bradley Smith
870fdb54c3 [ARM] Allow TargetParser to accurately target architectures
Instead of defaulting to an empty string, we want to default to
the CPU 'generic' in the case of no valid default CPU being found,
(as long as the architecture is actually valid).

In order to do this we add a default FPU for each architecture, as
well as falling back to architecture defaults for extensions and FPU
in the case of a generic CPU is specified.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253198 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 11:15:22 +00:00
Bradley Smith
7c1b77248b [ARM] Introduce subtarget features per ARM architecture.
This allows for accurate architecture targeting as well as removing
duplicate information (hardcoded feature strings) from MCTargetDesc.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253196 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 11:10:19 +00:00
James Molloy
61639fb856 Properly check if a CMPZ node is in fact comparing against zero
This was left implicit and never ever checked, which means we could have a CMPZ against some non-zero value and we were carrying on with BFI conversion regardless.

Caught by Oliver Stannard using csmith; regression test added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253195 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 10:49:25 +00:00
Pavel Labath
168146e84b Don't generate discriminators for calls to debug intrinsics
Summary:
This fails a check in Verifier.cpp, which checks for location matches between the declared
variable and the !dbg attachments.

Reviewers: dnovillo, dblaikie, danielcdh

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253194 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 10:40:38 +00:00
Oliver Stannard
f88d08f7c5 [AArch64] ldr= pseudo-instruction silently ignored if register invalid
The AArch64 assembler was silently ignoring instructions like this:
  ldr foo, =bar

AArch64AsmParser::parseOperand was returning true as the parse failed, but was
not calling AArch64AsmParser::Error to report this to the user, so the
instruction was ignored without printing an error message.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253193 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 10:25:19 +00:00
James Molloy
8b4675ffaa [GlobalOpt] Address post-commit review comments on r253168
Address Duncan Exon Smith's comments on D14148, which was added after the patch had been LGTM'd and committed:
  * clang-format one area where whitespace diffs occurred.
  * Add a threshold to limit the store/load dominance checks as they are quadratic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253192 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 10:16:22 +00:00
Benjamin Kramer
a147660147 Move helper classes into anonymous namespaces. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253189 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 09:01:28 +00:00
Keno Fischer
e35a90c9bb Fix r253186 test case
Referencing a DILocation whose scope is a different subprogram causes
an assertion failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253187 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 08:25:14 +00:00
Keno Fischer
238d6fc46f [DIBuilder] Make createReferenceType take size and align
Summary: Since we're passing references to dbg.value as pointers,
we need to have the frontend properly declare their sizes and
alignments (as it already does for regular pointers) in preparation
for my upcoming patch to have the verifer check that the sizes agree.

Also augment the backend logic that skips actually emitting this
information into DWARF such that it also handles reference types.

Reviewers: aprantl, dexonsmith, dblaikie

Subscribers: dblaikie, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253186 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 07:57:32 +00:00
Igor Breger
99b62327bf AVX512: Implemented encoding and intrinsics for VMOVSHDUP/VMOVSLDUP instructions.
Differential Revision: http://reviews.llvm.org/D14322

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253185 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 07:22:00 +00:00
Keno Fischer
48f4451501 Also map the personality function in CloneFunctionInto
Summary: The Old personality function gets copied over, but the
Materializer didn't  have a chance to inspect it (e.g. to fix up
references to the correct module for the target function).
Also add a verifier check that makes sure the personality routine
is in the same module as the function whose personality it is.

Reviewers: majnemer

Subscribers: jevinskie, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253183 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 05:13:30 +00:00
Keno Fischer
888d479702 [Sink] Don't move landingpads
Summary: Moving landingpads into successor basic blocks makes the
verifier sad. Teach Sink that much like PHI nodes and terminator
instructions, landingpads (and cleanuppads, etc.) may not be moved
between basic blocks.

Reviewers: majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253182 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 04:47:58 +00:00
Vedant Kumar
253c929691 [ADT] Make capacity_in_bytes support BitVector. NFC.
This makes it a bit easier to replace instances of vector<bool> with
BitVector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253180 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 04:02:36 +00:00
Dan Gohman
284e00c04e [WebAssembly] Use tabs instead of spaces in assembly output.
This seems to be the most popular convention among the other backends.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253172 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-15 15:34:19 +00:00
Simon Pilgrim
8adc1eabfb [X86][SSE] Tidyup with implicit SDValue bool check. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253171 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-15 14:57:07 +00:00