Commit Graph

204598 Commits

Author SHA1 Message Date
Rui Ueyama adcde5384e COFF: Make ArchiveFile::getMember thread-safe.
This function is called SymbolTable::readObjects, so in order to
parallelize that function, we have to make this function thread-safe.

llvm-svn: 241420
2015-07-05 22:50:00 +00:00
Sanjay Patel 787e12aec1 remove unnecessary test specifications
llvm-svn: 241419
2015-07-05 22:37:51 +00:00
Sanjay Patel 8ee056c5e7 minimize test case and remove unnecessary opt passes
llvm-svn: 241418
2015-07-05 22:30:12 +00:00
Rui Ueyama e2eb15577d COFF: Use CAS to update Sym->Body.
Note that the linker is not multi-threaded yet.
This is a preparation for that.

llvm-svn: 241417
2015-07-05 22:05:08 +00:00
Rui Ueyama c80c03da6c COFF: Use atomic pointers in preparation for parallelizing.
In the new design, mutation of Symbol pointers is the name resolution
operation. This patch makes them atomic pointers so that they can
be mutated by multiple threads safely. I'm going to use atomic
compare-exchange on these pointers.

dyn_cast<> doesn't recognize atomic pointers as pointers,
so we need to call load(). This is unfortunate, but in other places
automatic type conversion works fine.

llvm-svn: 241416
2015-07-05 21:54:42 +00:00
Sanjay Patel cc9fad0bf7 remove unnecessary temp variable; NFCI
llvm-svn: 241415
2015-07-05 21:21:47 +00:00
Peter Collingbourne 46eb0f539c Verifier: Forbid comdats on linker declarations.
Differential Revision: http://reviews.llvm.org/D10945

llvm-svn: 241414
2015-07-05 20:52:40 +00:00
Peter Collingbourne 6a9d1774d0 IR: Do not consider available_externally linkage to be linker-weak.
From the linker's perspective, an available_externally global is equivalent
to an external declaration (per isDeclarationForLinker()), so it is incorrect
to consider it to be a weak definition.

Also clean up some logic in the dead argument elimination pass and clarify
its comments to better explain how its behavior depends on linkage,
introduce GlobalValue::isStrongDefinitionForLinker() and start using
it throughout the optimizers and backend.

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

llvm-svn: 241413
2015-07-05 20:52:35 +00:00
Sanjay Patel a4860f3af2 use range-based for loops; NFCI
llvm-svn: 241412
2015-07-05 20:15:21 +00:00
Benjamin Kramer 9bfb627a0e [TargetLowering] StringRefize asm constraint getters.
There is some functional change here because it changes target code from
atoi(3) to StringRef::getAsInteger which has error checking. For valid
constraints there should be no difference.

llvm-svn: 241411
2015-07-05 19:29:18 +00:00
Simon Pilgrim 08049fedc7 [X86][SSE3] Just use an explicit SSE3 target attribute - not a cpu type.
Merged arch/target into a specific triple - we had i686 and x86_64 targets overriding each other....

llvm-svn: 241410
2015-07-05 19:06:32 +00:00
Simon Pilgrim 434cb684a8 [X86][SSE2] Just use an explicit SSE2 target attribute - not a cpu type.
corei7 is capable of a lot more than just SSE2.... 

llvm-svn: 241409
2015-07-05 19:03:51 +00:00
Lang Hames a3229d7ff8 [RuntimeDyld] Add comment documenting the behavior change in r241383.
llvm-svn: 241408
2015-07-05 18:49:17 +00:00
Yaron Keren e41dee1da4 Document problems when trying libclang tests on Windows 7.
llvm-svn: 241407
2015-07-05 17:53:00 +00:00
Asaf Badouh 73f26f8ffc [x86][AVX512] add Multiply High Op
include encoding and intrinsics tests.

review
http://reviews.llvm.org/D10896

llvm-svn: 241406
2015-07-05 12:23:20 +00:00
Nemanja Ivanovic e00fa61412 Add the missing return statements from revision 241399.
llvm-svn: 241405
2015-07-05 10:54:10 +00:00
Michael Kuperstein 5f05153fbb [X86] Fix incorrect/inefficient pushw encodings for x86-64 targets
Correctly support assembling "pushw $imm8" on x86-64 targets. 
Also some cleanup of the PUSH instructions (PUSH64i16 and PUSHi16 actually
represent the same instruction)

This fixes PR23996

Patch by: david.l.kreitzer@intel.com
Differential Revision: http://reviews.llvm.org/D10878

llvm-svn: 241404
2015-07-05 10:25:41 +00:00
NAKAMURA Takumi 5f6278968c [CMake] clang-*.*: Prevent versioning if the buildhost is targeting for Win32.
CMake-2.8.12 is hardcoded to create symlinked clang.exe if the target property VERSION is present and the host is not Win32.
Then clang.exe-*.* is generated and clang.exe is symlinked to it.

  lrwxrwxrwx. 1 bb bb      13 Jul  5 18:04 clang.exe -> clang.exe-3.7
  -rwxr-x---. 1 bb bb  244763 Jul  5 18:04 clang++.exe
  -rwxr-x---. 1 bb bb  244763 Jul  5 18:04 clang.exe-3.7

It made me unhappy when built binaries were copied to the Windows target.

FIXME: Could we just remove the target property VERSION in add_llvm_executable() ?
llvm-svn: 241403
2015-07-05 10:16:24 +00:00
NAKAMURA Takumi 3eb06667bd [CMake] add_llvm_symbol_exports: Use Python oneliner instead of "cmd.exe /c type" to generate *.def.
llvm-svn: 241402
2015-07-05 08:56:38 +00:00
NAKAMURA Takumi 86042f1d2e clang/test/CodeGen/builtins-ppc-vsx.c: Fix for -Asserts.
llvm-svn: 241401
2015-07-05 08:37:54 +00:00
Jay Foad b120712b29 Enable this test for PPC64.
llvm-svn: 241400
2015-07-05 08:11:36 +00:00
Nemanja Ivanovic 1c7ad715ec Add missing builtins to altivec.h for ABI compliance (vol. 2)
This patch corresponds to review:
http://reviews.llvm.org/D10875

The bulk of the second round of additions to altivec.h.
The following interfaces were added:
vector double vec_floor(vector double)
vector double vec_madd(vector double, vector double, vector double)
vector float vec_msub(vector float, vector float, vector float)
vector double vec_msub(vector double, vector double, vector double)
vector float vec_mul(vector float, vector float)
vector double vec_mul(vector double, vector double)
vector float vec_nmadd(vector float, vector float, vector float)
vector double vec_nmadd(vector double, vector double, vector double)
vector double vec_nmsub(vector double, vector double, vector double)
vector double vec_nor(vector double, vector double)
vector double vec_or(vector double, vector double)
vector float vec_rint(vector float)
vector double vec_rint(vector double)
vector float vec_nearbyint(vector float)
vector double vec_nearbyint(vector double)
vector float vec_sqrt(vector float)
vector double vec_sqrt(vector double)
vector double vec_rsqrte(vector double)
vector double vec_sel(vector double, vector double, vector unsigned long long)
vector double vec_sel(vector double, vector double, vector unsigned long long)
vector double vec_sub(vector double, vector double)
vector double vec_trunc(vector double)
vector double vec_xor(vector double, vector double)
vector double vec_xor(vector double, vector bool long long)
vector double vec_xor(vector bool long long, vector double)

New VSX paths for the following interfaces:
vector float vec_madd(vector float, vector float, vector float)
vector float vec_nmsub(vector float, vector float, vector float)
vector float vec_rsqrte(vector float)
vector float vec_trunc(vector float)
vector float vec_floor(vector float)

llvm-svn: 241399
2015-07-05 06:40:52 +00:00
Nemanja Ivanovic d358b8f80d Add missing builtins to the PPC back end for ABI compliance (vol. 2)
This patch corresponds to review:
http://reviews.llvm.org/D10874

Back end portion of the second round of additions to altivec.h.

llvm-svn: 241398
2015-07-05 06:03:51 +00:00
Rui Ueyama 2b82d5f8ca COFF: Do not warn on identical /merge options.
llvm-svn: 241397
2015-07-04 23:54:52 +00:00
Rui Ueyama 6600eb18cd COFF: Implement /merge option.
/merge:.foo=.bar makes the linker to merge section .foo with section .bar.

llvm-svn: 241396
2015-07-04 23:37:32 +00:00
Sanjay Patel f73f8919ed use range-based for loops; NFCI
llvm-svn: 241395
2015-07-04 19:38:52 +00:00
Simon Pilgrim ea1b6ee366 [X86][SSE] Improved i8/i16 to f64 uint2fp vector conversions
Followup to D10433 and D10589 that fixes i8/i16 uint2fp vector conversions by zero extending to i32 and using the sint2fp path (unless the target does actually support uint2fp).

llvm-svn: 241394
2015-07-04 15:33:34 +00:00
Sanjay Patel 82db3b7d5e use valid bits to avoid unnecessary machine trace metric recomputations
Although this does cut the number of traces recomputed by ~10% for the
test case mentioned in http://reviews.llvm.org/D10460, it doesn't
make a dent in the overall performance. That example needs to be more
selective when invalidating traces.

llvm-svn: 241393
2015-07-04 15:00:28 +00:00
Yaron Keren fffc068d68 Fix spelling, NFC.
llvm-svn: 241392
2015-07-04 05:48:52 +00:00
Peter Collingbourne 2612a32ce5 COFF: Numerous fixes for interaction between LTO and weak externals.
We were previously hitting assertion failures in the writer in cases where
a regular object file defined a weak external symbol that was defined by
a bitcode file. Because /export and /entry name mangling were implemented
using weak externals, the same problem affected mangled symbol names in
bitcode files.

The underlying cause of the problem was that weak external symbols were
being resolved before doing LTO, so the symbol table may have contained stale
references to bitcode symbols. The fix here is to defer weak external symbol
resolution until after LTO.

Also implement support for weak external symbols in bitcode files
by modelling them as replaceable DefinedBitcode symbols.

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

llvm-svn: 241391
2015-07-04 05:28:41 +00:00
Bruce Mitchener 0b6ba7c668 Use string::find(char) for single character strings.
Summary: Use string::find(char) for single character strings.

Reviewers: abidh, ki.stfu, clayborg

Subscribers: lldb-commits

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

llvm-svn: 241390
2015-07-04 05:16:58 +00:00
Peter Collingbourne 17eff10f68 LTO: expose LTO_SYMBOL_ALIAS, which indicates that the symbol is an alias.
This is needed for COFF linkers to distinguish between weak external aliases
and regular symbols with LLVM weak linkage, which are represented as strong
symbols in COFF.

llvm-svn: 241389
2015-07-04 03:42:35 +00:00
Rui Ueyama 0569ecfa9b Revert "COFF: Do not use VirtualSize section header field for directive sections."
This reverts commit r241386 because the issue is addressed in LLVM (r241387).

llvm-svn: 241388
2015-07-04 03:27:46 +00:00
Rui Ueyama d5297ee724 Object/COFF: Do not rely on VirtualSize being 0 in object files.
llvm-svn: 241387
2015-07-04 03:25:51 +00:00
Rui Ueyama cffbe7cb55 COFF: Do not use VirtualSize section header field for directive sections.
Looks like clang-cl sets a bogus value to the field, which makes
getSectionContents() to truncate section contents. This patch directly
uses SizeOfRawData field instead of VirtualSize to see if this can
make buildbot green.

llvm-svn: 241386
2015-07-04 02:26:20 +00:00
Rui Ueyama 3126c6c565 Use map::insert instead of checking existence of a key and insert. NFC.
llvm-svn: 241385
2015-07-04 02:00:22 +00:00
Rui Ueyama a3d463df6f COFF: Print directive section contents if /verbose.
llvm-svn: 241384
2015-07-04 01:39:11 +00:00
Lang Hames 78937c2ae5 [RuntimeDyld] Skip relocations for external symbols with 64-bit address ~0ULL.
Requested by Eugene Rozenfeld of the LLILC team, this feature allows JIT
clients to skip relocations for selected external symbols by returning ~0ULL
from their symbol resolver. If this value is returned for a given symbol,
RuntimeDyld will skip all relocations for that symbol. The client will be
responsible for applying the skipped relocations manually before the code
is executed.

llvm-svn: 241383
2015-07-04 01:35:26 +00:00
Rui Ueyama b0398827c2 COFF: Fix bug in garbage collector.
GC root may have non-regular defined symbols, such as DefinedImportThunk,
so this cast<> was a wrong assumption.

llvm-svn: 241382
2015-07-04 01:10:32 +00:00
Craig Topper de8395229a [X86] Add proper 64-bit mode checks to jrcxz and jcxz.
llvm-svn: 241381
2015-07-04 00:01:07 +00:00
Matt Arsenault 24e33d10a0 AMDGPU: Fix indentation of switch
llvm-svn: 241380
2015-07-03 23:33:38 +00:00
Rui Ueyama 4b8cdd20fb COFF: Don't print warning message for identical /export options.
llvm-svn: 241379
2015-07-03 23:23:29 +00:00
Simon Atanasyan 1e7b08b68d [ELF] Fix ELF test cases. Do not provide content for bss sections.
llvm-svn: 241378
2015-07-03 23:06:24 +00:00
Simon Atanasyan 5db0276925 [ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj tools
SHT_NOBITS sections do not have content in an object file. Now the yaml2obj
tool does not accept `Content` field for such sections, and the obj2yaml
tool does not attempt to read the section content from a file.

Restore r241350 and r241352.

llvm-svn: 241377
2015-07-03 23:00:54 +00:00
Peter Collingbourne da2f094bbb COFF: Fix the case where an object defines a weak external and its alias.
This worked before, but only by accident, and only with assertions disabled.
We ended up storing a DefinedRegular symbol in the WeakAlias field,
and never using it as an Undefined.

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

llvm-svn: 241376
2015-07-03 22:03:36 +00:00
Rafael Espindola d74b4f0a32 Use a continue to reduce indentation.
llvm-svn: 241375
2015-07-03 22:02:28 +00:00
Rafael Espindola 74d079b272 Use a continue to reduce indentation.
llvm-svn: 241374
2015-07-03 21:57:41 +00:00
Rafael Espindola a88a196f04 Context is allocated just a few lines above. Don't check if it is null.
llvm-svn: 241373
2015-07-03 21:54:41 +00:00
Rafael Espindola a4b2733c86 Fix build with -DLLVM_USE_INTEL_JITEVENTS=ON -DLLVM_USE_OPROFILE=ON.
Is anyone using those?

llvm-svn: 241372
2015-07-03 21:47:00 +00:00
Adhemerval Zanella c0ad64543b [ELF/AArch64] Set correct loader name in linking context
This patch reimplements ELFLinkingContext::getDefaultInterpreter for aarch64
with correct loader name. It is required to exclude the loader from DT_NEEDED
in shared library creation.

llvm-svn: 241371
2015-07-03 21:24:36 +00:00