Commit Graph

218435 Commits

Author SHA1 Message Date
George Rimar bfb7bf7429 [ELF] - R_386_GOTOFF relocation implemented.
R_386_GOTOFF is calculated as S + A - GOT, where:
S - Represents the value of the symbol whose index resides in the relocation entry.
A - Represents the addend used to compute the value of the relocatable field.
GOT - Represents the address of the global offset table.

Differential revision: http://reviews.llvm.org/D15383

llvm-svn: 256143
2015-12-21 10:00:12 +00:00
Gabor Horvath c6ff9c349d Fix a false positive case in ContainerSizeEmpty check (PR25893).
llvm-svn: 256142
2015-12-21 09:43:52 +00:00
George Rimar e72bebaf2d [ELF] - Fixed padding for CIE/FDE entries of .eh_frame section
Spec says both CIE/FDE has "Padding
Extra bytes to align the CIE structure to an addressing unit size boundary."
https://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-PDA/LSB-PDA/ehframechpt.html

Patch aligns CIE/FDE entries to the size of platform pointer.

Differential revision: http://reviews.llvm.org/D15637

llvm-svn: 256141
2015-12-21 09:38:59 +00:00
Tobias Grosser 594882573e ScopInfo: Return immediately if scop is unprofitable and marked invalid
As we already log an error when calling invalid, scops unprofitable scops are in
any case marked invalid, but returning immediately safes (a tiny bit of) compile
time and is consistent with our use of 'invalid' in the remainder of the file.

Found by inspection.

llvm-svn: 256140
2015-12-21 09:09:44 +00:00
Tobias Grosser bfaf1ae309 ScopInfo: Return in case we found an invalid array size
Without this return we still log the incorrect array size (and do not detect
this scop), but we would unnecessarily continue to verify that access functions
are affine. As we do not need to do this, we can return right ahead and
consequently safe compile time.

This issue was found by inspection.

llvm-svn: 256139
2015-12-21 09:09:39 +00:00
NAKAMURA Takumi 8c6c95ad81 check-llvm: Tweak the feature "timestamps" for autoconf.
Note, ENABLE_TIMESTAMPS is either 1 or 0 in Makefile.config.

llvm-svn: 256138
2015-12-21 08:46:12 +00:00
David Majnemer 18663f8787 [MC, COFF] Unbreak support for COFF timestamps
Support for COFF timestamps was unintentionally broken in r246905 when
it was conditionally available depending on whether or not LLVM was
configured with LLVM_ENABLE_TIMESTAMPS.  However, Config/config.h was
never included which essentially broke the feature.  Due to lax testing,
the breakage was never identified until we observed strange failures
during incremental links of Chromium.

This issue is resolved by simply including Config/config.h in
WinCOFFObjectWriter and teaching lit that the MC/COFF/timestamp.s test
is conditionally supported depending on LLVM_ENABLE_TIMESTAMPS.  With
this in place, we can strengthen the test to ensure that it will not
accidentally get broken in the future.

This fixes PR25891.

llvm-svn: 256137
2015-12-21 08:03:07 +00:00
Tobias Grosser 949e8c6ac6 ScopInfo: Check for the existance of a single memory accesses
Instead of counting all array memory accesses associated with a load
instruction, we now explicitly check that the single array access that could
(potentially) be associated with a load instruction does not exist. This helps
to document the current behavior of Polly where load instructions can indeed
have at most one associated array access. In the unlikely case this changes
in the future, we add an assert for the case where two load accesses would
prevent us to return a single memory access, but we still should communicate
that not all array memory accesses have been removed.

This addresses post-commit comments from Johannes Doerfert for commit 255776.

llvm-svn: 256136
2015-12-21 07:10:39 +00:00
Craig Topper dfe29ae5db [Sema] Use range-based for loops. NFC
llvm-svn: 256135
2015-12-21 06:35:56 +00:00
NAKAMURA Takumi 9ec6a826dd [Cygwin] Enable TLS as emutls.
It resolves clang selfhosting with std::once() for Cygwin.

FIXME: It may be EmulatedTLS-generic also for X86-Android.
FIXME: Pass EmulatedTLS to LLVM CodeGen from Clang with -femulated-tls.
llvm-svn: 256134
2015-12-21 02:37:23 +00:00
NAKAMURA Takumi ecba4c3d0b check-clang-tools requires clang-headers due to test/clang-tidy.
clang-modernize provided clang-headers but it was removed.

llvm-svn: 256133
2015-12-21 01:35:28 +00:00
Manuel Jacob 8050a49737 [RS4GC] Add an assert which fails if there is a (yet unsupported) addrspacecast.
The slightly strange indentation comes from clang-format.

llvm-svn: 256132
2015-12-21 01:26:46 +00:00
Craig Topper eafbd57ebc [InstCombine] Fix indentation. NFC.
llvm-svn: 256131
2015-12-21 01:02:28 +00:00
Dylan McKay f061e9b7b2 [AVR] Added AVRCallingConv.td
llvm-svn: 256130
2015-12-20 23:17:44 +00:00
Xinliang David Li d1c84b078a [PGO] testing _WIN64 instead of _WIN32
llvm-svn: 256129
2015-12-20 19:55:15 +00:00
Xinliang David Li f82944db76 [PGO] Implement BOOL_CMPXCHG for Windows
llvm-svn: 256128
2015-12-20 19:11:44 +00:00
Craig Topper ca66fc5473 [X86] Use range-based for loop. NFC
llvm-svn: 256127
2015-12-20 18:41:57 +00:00
Craig Topper 074e845260 [X86] Prevent constant hoisting for a couple compare immediates that the selection DAG knows how to optimize into a shift.
This allows "icmp ugt %a, 4294967295" and "icmp uge %a, 4294967296" to be optimized into right shifts by 32 which can fold the immediate into the shift instruction. These patterns show up with some regularity in real code.

Unfortunately, since getImmCost can't see the icmp predicate we can't be tell if we're only catching these specific cases.

llvm-svn: 256126
2015-12-20 18:41:54 +00:00
Johannes Doerfert 30e2307f61 [FIX] Schedule generation for block exiting multiple loops.
This fixes bug PR25604.

llvm-svn: 256125
2015-12-20 17:12:22 +00:00
Michael Kruse 8fc2896ee0 Compile fix: Use "&&" operator instead of "and"
llvm-svn: 256124
2015-12-20 14:42:32 +00:00
Tobias Grosser 75dc40c3be ScopInfo: Bail out in case of complex branch structures
Scops that contain many complex branches are likely to result in complex domain
conditions that consist of a large (> 100) number of conjucts.  Transforming
such domains is expensive and unlikely to result in efficient code.  To avoid
long compile times we detect this case and skip such scops. In the future we may
improve this by either using non-affine subregions to hide such complex
condition structures or by exploiting in certain cases properties (e.g.,
dominance) that allow us to construct the domains of a scop in a way that
results in a smaller number improving conjuncts.

Example of a code that results in complex iteration spaces:

      loop.header
     /    |    \ \
   A0    A2    A4 \
     \  /  \  /    \
      A1    A3      \
     /  \  /  \     |
   B0    B2    B4   |
     \  /  \  /     |
      B1    B3      ^
     /  \  /  \     |
   C0    C2    C4   |
     \  /  \  /    /
      C1    C3    /
       \   /     /
    loop backedge

llvm-svn: 256123
2015-12-20 13:31:48 +00:00
Michael Kuperstein 591278c08d [X86] Add missing m64/int64 conversions
Define the 64-bit equivalents of _m_to_int and _m_from_int.

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

llvm-svn: 256122
2015-12-20 12:37:18 +00:00
Michael Kuperstein beae026738 [X86] Add signed aliases for popcnt intrinsics
The Intel manual documents both an unsigned form (_mm_popcnt_u32)
and a signed form (_popcnt32) of the intrinsic. Add the missing signed form.

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

llvm-svn: 256121
2015-12-20 12:35:35 +00:00
Dylan McKay 029346f438 Add AVR.td and AVRRegisterInfo.td
Summary:
This adds the core AVR TableGen file, along with the register descriptions.

Lines in AVR.td which require other TableGen files which haven't been committed
yet are commented out.

This is a fairly trivial patch, and should only require a quick review.

I kept the line width smaller than 80 columns, but there are a few exceptions
because I'm not sure how to split a string over several lines.

Reviewers: stoklund

Subscribers: dylanmckay, agnat

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

llvm-svn: 256120
2015-12-20 12:16:20 +00:00
Simon Atanasyan 1d7df40711 [ELF][MIPS] MIPS .reginfo sections handling
MIPS .reginfo section provides information on the registers used by
the code in the object file. Linker should collect this information and
write .reginfo section in the output file. This section contains a union
of used registers masks taken from input .reginfo sections and final
value of the `_gp` symbol.

For details see the "Register Information" section in Chapter 4 in the
following document:
ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf

The patch implements .reginfo sections handling with a couple missed
features: a) it does not put output .reginfo section into the separate
REGINFO segment; b) it does not merge `ri_cprmask` masks from input
section. These features will be implemented later.

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

llvm-svn: 256119
2015-12-20 10:57:34 +00:00
Davide Italiano e85abf7269 [llvm-objdump] Move COFF function to where it belongs.
Ideally much more stuff should be moved out of llvm-objdump.cpp, but that
will happen later.

llvm-svn: 256118
2015-12-20 09:54:34 +00:00
Xinliang David Li 242ad0aded Fix a bug in test case -- duplicate entries
llvm-svn: 256117
2015-12-20 08:49:31 +00:00
Xinliang David Li 6005728843 Fix a latent UAF bug in profwriter
llvm-svn: 256116
2015-12-20 08:46:18 +00:00
Weiming Zhao 613c6862fa Fix mapping of @llvm.arm.ssat/usat intrinsics to ssat/usat instructions for Thumb2
Summary:
r250697 fixed the mapping for ARM mode. We have to do the same for Thumb2 otherwise the same llvm.arm.ssat() will generate different saturating amount for ARM and Thumb.

r250697: http://reviews.llvm.org/rL250697

Reviewers: rmaprath

Subscribers: aemerson, llvm-commits, rengolin

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

llvm-svn: 256115
2015-12-20 06:41:44 +00:00
Xinliang David Li a716cc5c33 [PGO] Improve Indexed Profile Reader efficiency
With the support of value profiling added, the Indexed prof
reader gets less efficient. The prof reader initialization
used to be just reading the file header, but with VP support
added, initialization needs to walk through all profile keys
of ondisk hash table resulting in very poor locality and large
memory increase (keys are stored together with the profile data
in the mapped profile buffer). Even worse, when the reader is 
used by the compiler (not llvm-profdata too), the penalty becomes
very high as compilation of each single module requires touching
profile data buffer for the whole program. 

In this patch, the icall target values (MD5hash) are no longer eargerly 
converted back to name strings when the data is read into memory. New
interface is added to to profile reader so that InstrProfSymtab can be
lazily created for Indexed profile reader on-demand. Creating of the 
symtab is intended to be used by llvm-profdata tool for symbolic dumping
of  VP data. It can be used with compiler (for legacy out of tree uses)
too but not recommended due to compile time and memory reasons 
mentioned above.

Some other cleanups are also included: Function Addr to md5 map is now
consolated into InstrProfSymtab. InstrProfStringtab is no longer used and
eliminated.

llvm-svn: 256114
2015-12-20 06:22:13 +00:00
Xinliang David Li 5c24da5d8e Minor clean up -- move large single use method out of header(NFC)
llvm-svn: 256113
2015-12-20 05:15:45 +00:00
NAKAMURA Takumi 68369b1c2f Revert r219171, "llvm/test/lit.cfg: Suppress dwarf stuff for targeting x86_64-mingw32 while investigating since r219108."
It has been fixed since r219280 by David Majnemer.

llvm-svn: 256112
2015-12-20 03:48:23 +00:00
Mehdi Amini fa4e474741 ThreadPool unittests: do not hold mutex when calling condition_variable:notify()
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 256111
2015-12-19 22:56:24 +00:00
Sanjoy Das ab0626e35f Nonnull elements in OperandBundleCallSites are not all Instructions
`CloneAndPruneIntoFromInst` sometimes RAUW's dead instructions with
`undef` before erasing them (to avoid deleting instructions that still
have uses).  This changes the `WeakVH` in `OperandBundleCallSites` to
hold an `undef`, and we need to guard for this situation in eventuality
in `llvm::InlineFunction`.

llvm-svn: 256110
2015-12-19 22:40:28 +00:00
Sanjoy Das b496834f8e [Deopt bundles] Fix a test case
The `CHECK-NOT` line was incorrect, and would not have caught a
breakage.

llvm-svn: 256109
2015-12-19 22:40:22 +00:00
Davide Italiano 540e92157c [llvm-objdump] Fail early if we can't parse the object header.
llvm-svn: 256108
2015-12-19 22:09:40 +00:00
Rafael Espindola 30941d264b Delete APIs that have been deprecated since 2010.
llvm-svn: 256107
2015-12-19 21:42:07 +00:00
Paul Robinson 5f2a8c18ff The PS4 baton passes.
llvm-svn: 256106
2015-12-19 20:04:03 +00:00
Rafael Espindola e01e363fd9 Assert that we have all use/users in the getters.
An error that is pretty easy to make is to use the lazy bitcode reader
and then do something like

if (V.use_empty())

The problem is that uses in unmaterialized functions are not accounted
for.

This patch adds asserts that all uses are known.

llvm-svn: 256105
2015-12-19 20:03:23 +00:00
Paul Robinson 0334a047df Driver part of debugger tuning.
Adds driver options named -glldb and -gsce to mean -g plus tuning for
lldb and SCE debuggers respectively; the existing -ggdb option does
the same for gdb. Existing options -ggdb0, -ggdb1 etc. unpack into
-ggdb -g<N>.  (There will not be -glldb<N> or -gsce<N> options.) The
tuning gets a target-specific default in the driver, and is passed
into cc1 with the new -debugger-tuning option.

As fallout, fixes where '-gsplit-dwarf -g0' would ignore the -g0 part
on Linux.

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

llvm-svn: 256104
2015-12-19 19:41:48 +00:00
Xinliang David Li f48a1f54dd [PGO] Fix build failure with MSVC
llvm-svn: 256103
2015-12-19 19:16:32 +00:00
JF Bastien 374ea4bda5 WebAssembly: add vtable test
The test will mainly be useful to check that the .s file assembles and relocates properly because vtables reference functions in their data section.

llvm-svn: 256102
2015-12-19 18:55:18 +00:00
Manuel Jacob 5b90b147d4 Remove unnecessary casts. NFC.
llvm-svn: 256101
2015-12-19 18:38:42 +00:00
Manuel Jacob f4b3577d66 Remove double blanks. NFC.
llvm-svn: 256100
2015-12-19 18:26:53 +00:00
Xinliang David Li c96d3d10f4 Improve InstrProfSymtab test coverage
llvm-svn: 256099
2015-12-19 18:20:09 +00:00
Matt Arsenault d206d6cc54 SelectionDAG: Cleanup integer bin op promotion functions.
SDIV and UDIV had special handling, but this is the same handling
that min/max need.

llvm-svn: 256098
2015-12-19 17:18:43 +00:00
Vedant Kumar 3791e3d742 [unittests] ThreadPool: Remove redundant loop, NFC
llvm-svn: 256097
2015-12-19 09:54:27 +00:00
Vedant Kumar 2cf75338f8 [unittests] ThreadPool: Guard updates to MainThreadReady
llvm-svn: 256096
2015-12-19 09:49:09 +00:00
Vedant Kumar 3a63fb316c Re-reapply "[IR] Move optional data in llvm::Function into a hungoff uselist"
Make personality functions, prefix data, and prologue data hungoff
operands of Function.

This is based on the email thread "[RFC] Clean up the way we store
optional Function data" on llvm-dev.

Thanks to sanjoyd, majnemer, rnk, loladiro, and dexonsmith for feedback!

Includes a fix to scrub value subclass data in dropAllReferences. Does not
use binary literals.

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

llvm-svn: 256095
2015-12-19 08:52:49 +00:00
Vedant Kumar 44dd9871e8 Revert "Reapply "[IR] Move optional data in llvm::Function into a hungoff uselist""
This reverts commit r256093.

This broke lld-x86_64-win7 because of -Werror,-Wc++1y-extensions.

llvm-svn: 256094
2015-12-19 08:48:43 +00:00