Commit Graph

213342 Commits

Author SHA1 Message Date
Tobias Grosser ffa2446f28 BlockGenerator: Register outside users of scalars directly
Instead of checking at code generation time for each ScopStmt if a scalar has
external uses, we just iterate over the ScopArrayInfo descriptions we have and
check each of these for possible external uses.

Besides being somehow clearer, this approach has the benefit that we will always
create valid LLVM-IR even in case we disable the code generation of ScopStmt
bodies e.g. for testing purposes.

llvm-svn: 250608
2015-10-17 08:54:13 +00:00
Tobias Grosser 3839b422e6 Revert "Avoid unnecessay .s2a write access when used only in PHIs"
This reverts commit r250606 due to some bugs it introduced. After these bugs
have been resolved, we will add it back to tree.

llvm-svn: 250607
2015-10-17 08:54:05 +00:00
Tobias Grosser 26e59ee746 Drop unused parameter from handleOutsideUsers
llvm-svn: 250606
2015-10-17 08:25:54 +00:00
Davide Italiano c4958b4b52 [Frontend] Name variable correctly.
Reported by: Kim Grasman!

llvm-svn: 250605
2015-10-17 06:46:39 +00:00
Davide Italiano d178f312dd [JIT/Examples] Fix Fibonacci so that it runs again.
The old JIT is (long) gone.

llvm-svn: 250604
2015-10-17 06:36:46 +00:00
Kostya Serebryany fed509e73d [libFuzzer] add -shuffle flag
llvm-svn: 250603
2015-10-17 04:38:26 +00:00
Eric Fiselier 3acf5fdd88 Add an AST node matcher for TemplateTypeParmDecl objects.
llvm-svn: 250602
2015-10-17 02:34:44 +00:00
Colin LeMahieu 68d155be8e [Hexagon] Reverting test file change.
llvm-svn: 250601
2015-10-17 01:58:51 +00:00
Colin LeMahieu 7c9587136d [Hexagon] Adding skeleton of HVX extension instructions.
llvm-svn: 250600
2015-10-17 01:33:04 +00:00
Enrico Granata e0ee1e1cd6 Teach an old pony a few new tricks.
ValueObjectPrinter can now mask out pointer values during a printout; also, it supports helper functions to print declarations in different formats if needed

Practically speaking however, this change is NFC as nothing yet uses it in the codebase

llvm-svn: 250599
2015-10-17 01:05:50 +00:00
Matthias Braun 65e6d4a3f8 RegisterPressure: Unify the sparse sets in LiveRegsSet; NFC
Also do some cleanups comment improvements.

llvm-svn: 250598
2015-10-17 01:03:44 +00:00
Hal Finkel 8228198049 [ELF2/PPC64] Don't create .plt entries for weak undef symbols
Instead of specifically creating .plt entries for weak undef symbols, mirror
the logic in r250584, and use canBePreempted to determine is a REL24 relocation
needs a .plt entry. This might cause relocateOne to be called for a weak undef
symbol, with a REL24 relocation, but ignore this as a special case (this will
cause SA == 0, which won't happen under any other circumstance).

llvm-svn: 250597
2015-10-17 00:48:20 +00:00
Matthias Braun cdd2792aa6 RegisterPressure: allocatable physreg uses are always kills
This property was already used in the code path when no liveness
intervals are present. Unfortunately the code path that uses liveness
intervals tried to query a cached live interval for an allocatable
physreg, those are usually not computed so a conservative default was
used.

This doesn't affect any of the lit testcases. This is a foreclosure to
upcoming changes which should be NFC but without this patch this tidbit
wouldn't be NFC.

llvm-svn: 250596
2015-10-17 00:46:57 +00:00
Matthias Braun 5105e05e8f RegisterPressure: Remove 0 entries from PressureChange
This should not change behaviour because as far as I can see all code
reading the pressure changes has no effect if the PressureInc is 0.
Removing these entries however does avoid unnecessary computation, and
results in a more stable debug output. I want the stable debug output to
check that some upcoming changes are indeed NFC and identical even at
the debug output level.

llvm-svn: 250595
2015-10-17 00:35:59 +00:00
JF Bastien 3428ed4f53 WebAssembly: don't omit dead vregs from locals
Summary:
This is a temporary hack until we get around to remapping the vreg
numbers to local numbers. Dead vregs cause bad numbering and make
consumers sad.

We could also just look at debug info an use named locals instead, but
vregs have to work properly anyways so there!

Reviewers: binji, sunfish

Subscribers: jfb, llvm-commits, dschuff

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

llvm-svn: 250594
2015-10-17 00:25:38 +00:00
Eugene Zelenko fb2eec7e11 [LLDB] Fix Clang-tidy modernize-use-override warnings in some headers in source/Plugins/Process/Utility; other minor fixes.
Differential Revision: http://reviews.llvm.org/D13830

llvm-svn: 250593
2015-10-17 00:19:57 +00:00
Reid Kleckner f438a020bf Diagnose UnresolvedLookupExprs that resolve to instance members in static methods
During the initial template parse for this code, 'member' is unresolved
and we don't know anything about it:

  struct A { int member };
  template <typename T>
  struct B : public T {
    using T::member;
    static void f() {
      (void)member; // Could be static or non-static.
    }
  };
  template class B<A>;

The pattern declaration contains an UnresolvedLookupExpr rather than an
UnresolvedMemberExpr because `f` is static, and `member` should never be
a field. However, if the code is invalid, it may become a field, in
which case we should diagnose it.

Reviewers: rjmccall, rsmith

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

llvm-svn: 250592
2015-10-17 00:19:04 +00:00
JF Bastien 4f43e80ece WebAssembly: fix the syntax for comparisons
Summary: It has also slightly changed.

Reviewers: binji

Subscribers: jfb, dschuff, llvm-commits, sunfish

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

llvm-svn: 250591
2015-10-17 00:12:29 +00:00
Matthias Braun 96e411b90c RegisterPressure: Hide non-const iterators of PressureDiff
It is too easy to accidentally violate the ordering requirements when
modifying the PressureDiff entries through iterators.

llvm-svn: 250590
2015-10-17 00:08:48 +00:00
Matthias Braun 7f47272cda StreamWriter: List basic types instead of derived ones in HexNumber
This avoids problems with different (u)intXX definition on different
platforms. Specifically this fixes a case on OS/X which had uint64_t
defined as unsigned long long.

llvm-svn: 250589
2015-10-17 00:08:45 +00:00
Joseph Tremoulet 55b51e9dcc [WinEH] Fix eh.exceptionpointer intrinsic lowering
Summary:
Some shared code for handling eh.exceptionpointer and eh.exceptioncode
needs to not share the part that truncates to 32 bits, which is intended
just for exception codes.

Reviewers: rnk

Subscribers: llvm-commits

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

llvm-svn: 250588
2015-10-17 00:08:08 +00:00
Reid Kleckner ce10cec56a Disable a test relying on symbol demangling on non-Windows platforms
llvm-svn: 250587
2015-10-16 23:56:14 +00:00
Rui Ueyama eb3d5cef34 Remove DOS newlines.
llvm-svn: 250586
2015-10-16 23:55:40 +00:00
Reid Kleckner 793d96386d Speculative fix for GCC build
llvm-svn: 250585
2015-10-16 23:53:12 +00:00
George Rimar 8911d85c2f [ELF2] - Implemented R_X86_64_PLT32 relocation.
There is sometimes no need to generate relocation via PLT. 
Example - when symbol is not undefined and we are not creating shared library. Then we can create relative relocation instead of referencing and creating PLT records.

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

llvm-svn: 250584
2015-10-16 23:52:24 +00:00
Reid Kleckner 28e490342b [WinEH] Fix stack alignment in funclets and ParentFrameOffset calculation
Our previous value of "16 + 8 + MaxCallFrameSize" for ParentFrameOffset
is incorrect when CSRs are involved. We were supposed to have a test
case to catch this, but it wasn't very rigorous.

The main effect here is that calling _CxxThrowException inside a
catchpad doesn't immediately crash on MOVAPS when you have an odd number
of CSRs.

llvm-svn: 250583
2015-10-16 23:43:27 +00:00
Reid Kleckner 02b74368ce [llvm-symbolizer] Use the export table if no symbols are present
This lets us make guesses about symbols in third party DLLs without
debug info, like MSVCR120.dll or kernel32.dll. dbghelp does the same
thing.

llvm-svn: 250582
2015-10-16 23:43:22 +00:00
Enrico Granata 15560778df Handle eFormatVectorOfFloat16
llvm-svn: 250581
2015-10-16 23:42:04 +00:00
Greg Clayton 3fd1f746c3 Split getting the key from a window from the code that handles the key.
llvm-svn: 250580
2015-10-16 23:34:40 +00:00
Matthias Braun fdee8ec2bd RegisterPressure: Use range based for, cleanup
llvm-svn: 250579
2015-10-16 23:25:09 +00:00
Rafael Espindola 80c94a7856 Use a reference. NFC.
llvm-svn: 250578
2015-10-16 23:22:23 +00:00
Richard Smith 95dc57a611 [modules] Allow the error when explicitly loading an incompatible module file
via -fmodule-file= to be turned off; in that case, just include the relevant
files textually. This allows module files to be unconditionally passed to all
compile actions via CXXFLAGS, and to be ignored for rules that specify custom
incompatible flags.

llvm-svn: 250577
2015-10-16 23:20:19 +00:00
Adrian McCarthy 128d4ab71f Skip hanging watchpoint test on Windows (rather than just xfailing).
llvm-svn: 250576
2015-10-16 23:19:22 +00:00
Davide Italiano 4f05f32bb7 [llvm-readobj] Teach ELFDumper about symbol versioning.
Differential Revision:	 http://reviews.llvm.org/D13824

llvm-svn: 250575
2015-10-16 23:19:01 +00:00
Xinliang David Li 91c7321ea9 Instroduce a template file to define InstrPGO core data structures.
Changing PGO data format layout can be a pain. Many different places need
to be touched and kept in sync. Failing to do so usually results in errors
very time consuming to debug.

This file is intended to be the master file that defines the layout of the
core runtime data structures. Currently only two structure is covered: Per
function ProfData structure and the function record structure used in
coverage mapping.

No client code has been made yet, so this commit is NFC.

llvm-svn: 250574
2015-10-16 23:17:34 +00:00
Chris Bieneman 11a7160237 [CMake] Cleaning up and generalizing the LLVMInstallSymlink script so that it can be used for libraries too.
In order to resolve PR25059, we're going to need to be able to generate symlinks to libraries manually, so I need this code to be reusable.

llvm-svn: 250573
2015-10-16 23:17:13 +00:00
Michael J. Spencer 1bf73000cf [elf2] Sort allocated TLS sections at the start of the R/W PT_LOAD.
Differential Revision: http://reviews.llvm.org/D13763

llvm-svn: 250572
2015-10-16 23:11:07 +00:00
Kostya Serebryany d6edce97fb [libFuzzer] print a stack trace on timeout
llvm-svn: 250571
2015-10-16 23:04:31 +00:00
Benjamin Kramer b43d33bf0f Revert "This is a follow-up to the discussion in D12882."
Breaks clang selfhost, see PR25222. This reverts commits r250527 and r250528.

llvm-svn: 250570
2015-10-16 23:00:29 +00:00
Enrico Granata da7cb14236 Move TypeSummaryImpl over to LLVM-style RTTI for subclassing
llvm-svn: 250567
2015-10-16 22:51:56 +00:00
Rui Ueyama 6455852a28 ELF2: Treat IsMips64EL as a global configuration.
If one file is MIPS64EL, all files are MIPS64EL, and vice versa.
We do not have to look up MIPS-ness for each file. Currently we
do not support 64-bit MIPS, so the config value is always false.

llvm-svn: 250566
2015-10-16 22:51:43 +00:00
Kostya Serebryany a9da9b48ef [libFuzzer] reduce the size of artifacts printed on the screen
llvm-svn: 250565
2015-10-16 22:47:20 +00:00
Kostya Serebryany b91c62b1f3 [libFuzzer] When -test_single_input crashes the test it is not necessary to write crash-file because input is already known to the user. Patch by Mike Aizatsky
llvm-svn: 250564
2015-10-16 22:41:47 +00:00
Hal Finkel 230c5c5b52 [ELF2] Remove unneeded new Type parameter
As pointed out by Rafael (with a further suggestion by Rui), the new Type
parameter I added in r250555 is not needed. Remove it.

llvm-svn: 250563
2015-10-16 22:37:32 +00:00
Xinliang David Li 4da5de9c34 Use struct type instead of raw array for raw profile header (NFC)
This patch introduces a well defined header struct
to represent raw profile header instead of using raw array.
Previously the raw array is used in two different files and
is very error prone when header structure is re-organized.
This is a small cleanup with NFC.

llvm-svn: 250561
2015-10-16 22:21:56 +00:00
Sanjay Patel bbd524496c [x86] promote 'add nsw' to a wider type to allow more combines
The motivation for this patch starts with PR20134:
https://llvm.org/bugs/show_bug.cgi?id=20134

void foo(int *a, int i) {
  a[i] = a[i+1] + a[i+2];
}

It seems better to produce this (14 bytes):

movslq	%esi, %rsi
movl	0x4(%rdi,%rsi,4), %eax
addl	0x8(%rdi,%rsi,4), %eax
movl	%eax, (%rdi,%rsi,4)

Rather than this (22 bytes):

leal	0x1(%rsi), %eax
cltq             
leal	0x2(%rsi), %ecx      
movslq	%ecx, %rcx     
movl	(%rdi,%rcx,4), %ecx
addl	(%rdi,%rax,4), %ecx
movslq	%esi, %rax       
movl	%ecx, (%rdi,%rax,4)

The most basic problem (the first test case in the patch combines constants) should also be fixed in InstCombine, 
but it gets more complicated after that because we need to consider architecture and micro-architecture. For
example, AArch64 may not see any benefit from the more general transform because the ISA solves the sexting in
hardware. Some x86 chips may not want to replace 2 ADD insts with 1 LEA, and there's an attribute for that: 
FeatureSlowLEA. But I suspect that doesn't go far enough or maybe it's not getting used when it should; I'm 
also not sure if FeatureSlowLEA should also mean "slow complex addressing mode".

I see no perf differences on test-suite with this change running on AMD Jaguar, but I see small code size
improvements when building clang and the LLVM tools with the patched compiler.

A more general solution to the sext(add nsw(x, C)) problem that works for multiple targets is available
in CodeGenPrepare, but it may take quite a bit more work to get that to fire on all of the test cases that
this patch takes care of.

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

llvm-svn: 250560
2015-10-16 22:14:12 +00:00
Davide Italiano 27043302a4 [Frontend/CompilerInvocation] Use range-based loop. NFC.
llvm-svn: 250559
2015-10-16 22:13:53 +00:00
Hal Finkel c91740616a [ELF2] Don't create RelativeReloc for weak undef symbols
When we have a R_PPC64_ADDR64 for a weak undef symbol, which thus resolves to
0, and we're creating a shared library, we need to make sure that it stays 0
(because code that conditionally calls the weak function tests for this).
Unfortunately, we were creating a R_PPC64_RELATIVE for these relocation
targets, making the address of the undefined weak symbol equal to the base
address of the shared library (which is non-zero). In general, we should not be
creating RelativeReloc relocs for undef weak symbols.

llvm-svn: 250558
2015-10-16 22:11:05 +00:00
Jim Grosbach 0fdd572763 MC: Don't crash after issuing a diagnostic.
Crashing is bad, m'kay? Fixing a 4 year old bug of my own creation.
Adding the testcase now which I should have added then which would have
long since caught this.

The problem is that printMessage() will display the diagnostic but not
set HadError to true, resulting in the assembler continuing on its way
and trying to create relocations for things that may not allow them or
otherwise get itself into trouble. Using the Error() helper function
here rather than calling printMessage() directly resolves this.

rdar://23133240

llvm-svn: 250557
2015-10-16 22:07:59 +00:00
Michael J. Spencer 7dccca543a [elf2] Simplify and rename x86-64 relocation error tests.
llvm-svn: 250556
2015-10-16 22:05:52 +00:00