oota-llvm.git
8 years agoRemove getRelocationAddress.
Rafael Espindola [Mon, 6 Jul 2015 14:55:37 +0000 (14:55 +0000)]
Remove getRelocationAddress.

Originally added in r139314.

Back then it didn't actually get the address, it got whatever value the
relocation used: address or offset.

The values in different object formats are:

* MachO: Always an offset.
* COFF: Always an address, but when talking about the virtual address of
  sections it says: "for simplicity, compilers should set this to zero".
* ELF: An offset for .o files and and address for .so files. In the case of the
  .so, the relocation in not linked to any section (sh_info is 0). We can't
  really compute an offset.

Some API mappings would be:

* Use getAddress for everything. It would be quite cumbersome. To compute the
  address elf has to follow sh_info, which can be corrupted and therefore the
  method has to return an ErrorOr. The address of the section is also the same
  for every relocation in a section, so we shouldn't have to check the error
  and fetch the value for every relocation.

* Use a getValue and make it up to the user to know what it is getting.

* Use a getOffset and:
 * Assert for dynamic ELF objects. That is a very peculiar case and it is
   probably fair to ask any tool that wants to support it to use ELF.h. The
   only tool we have that reads those (llvm-readobj) already does that. The
   only other use case I can think of is a dynamic linker.
 * Check that COFF .obj files have sections with zero virtual address spaces. If
   it turns out that some assembler/compiler produces these, we can change
   COFFObjectFile::getRelocationOffset to subtract it. Given COFF format,
   this can be done without the need for ErrorOr.

The getRelocationAddress method was never implemented for COFF. It also
had exactly one use in a very peculiar case: a shortcut for adding the
section value to a pcrel reloc on MachO.

Given that, I don't expect that there is any use out there of the C API. If
that is not the case, let me know and I will add it back with the implementation
inlined and do a proper deprecation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241450 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix a bug in the A57FPLoadBalancing register tracking/scavenger.
Chad Rosier [Mon, 6 Jul 2015 14:46:34 +0000 (14:46 +0000)]
Fix a bug in the A57FPLoadBalancing register tracking/scavenger.

The code in AArch64A57FPLoadBalancing::scavengeRegister() to handle dead defs
was not correctly handling aliased registers.  E.g. if the dead def was of D2,
then S2 was not being marked as unavailable, so it could potentially be used
across a live-range in which it would be clobbered.

Patch by Geoff Berry <gberry@codeaurora.org>!
Phabricator: http://reviews.llvm.org/D10900

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241449 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoCheck that COFF .obj files have sections with zero virtual address spaces.
Rafael Espindola [Mon, 6 Jul 2015 14:26:07 +0000 (14:26 +0000)]
Check that COFF .obj files have sections with zero virtual address spaces.

When talking about the virtual address of sections the coff spec says:
  ... for simplicity, compilers should set this to zero. Otherwise, it is an
  arbitrary value that is subtracted from offsets during relocation.

We don't currently subtract it, so check that it is zero.

If some producer does create such files, we can change getRelocationOffset
instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241447 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Added missing stack folding test for SQRTSD and SQRTSS instructions.
Simon Pilgrim [Mon, 6 Jul 2015 14:15:02 +0000 (14:15 +0000)]
[X86][SSE] Added missing stack folding test for SQRTSD and SQRTSS instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241445 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][AVX512] Multiply Packed Unsigned Integers with Round and Scale
Asaf Badouh [Mon, 6 Jul 2015 14:03:40 +0000 (14:03 +0000)]
[X86][AVX512] Multiply Packed Unsigned Integers with Round and Scale
pmulhrsw

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241443 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Mips] Add support for MCJIT for MIPS32r6
Petar Jovanovic [Mon, 6 Jul 2015 12:50:55 +0000 (12:50 +0000)]
[Mips] Add support for MCJIT for MIPS32r6

Add support for resolving MIPS32r6 relocations in MCJIT.

Patch by Vladimir Radosavljevic.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241442 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix handling of ELF::R_MIPS_32 on Mips64.
Rafael Espindola [Mon, 6 Jul 2015 12:18:44 +0000 (12:18 +0000)]
Fix handling of ELF::R_MIPS_32 on Mips64.

Thanks to Aboud, Amjad for reporting the regression and providing the testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241440 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TableGen] Change a couple methods to return an ArrayRef instead of a const std:...
Craig Topper [Mon, 6 Jul 2015 06:23:01 +0000 (06:23 +0000)]
[TableGen] Change a couple methods to return an ArrayRef instead of a const std::vector reference. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241430 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMake this test a bit more interesting.
Rafael Espindola [Mon, 6 Jul 2015 02:45:01 +0000 (02:45 +0000)]
Make this test a bit more interesting.

Before every test was using a section with an address of zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241427 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUntabify.
NAKAMURA Takumi [Mon, 6 Jul 2015 00:48:17 +0000 (00:48 +0000)]
Untabify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241423 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agochange CHECK to CHECK-LABEL for more precision
Sanjay Patel [Sun, 5 Jul 2015 23:19:16 +0000 (23:19 +0000)]
change CHECK to CHECK-LABEL for more precision

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241422 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoremove unnecessary test specifications
Sanjay Patel [Sun, 5 Jul 2015 22:37:51 +0000 (22:37 +0000)]
remove unnecessary test specifications

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241419 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agominimize test case and remove unnecessary opt passes
Sanjay Patel [Sun, 5 Jul 2015 22:30:12 +0000 (22:30 +0000)]
minimize test case and remove unnecessary opt passes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241418 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoremove unnecessary temp variable; NFCI
Sanjay Patel [Sun, 5 Jul 2015 21:21:47 +0000 (21:21 +0000)]
remove unnecessary temp variable; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241415 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoVerifier: Forbid comdats on linker declarations.
Peter Collingbourne [Sun, 5 Jul 2015 20:52:40 +0000 (20:52 +0000)]
Verifier: Forbid comdats on linker declarations.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241414 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Do not consider available_externally linkage to be linker-weak.
Peter Collingbourne [Sun, 5 Jul 2015 20:52:35 +0000 (20:52 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241413 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agouse range-based for loops; NFCI
Sanjay Patel [Sun, 5 Jul 2015 20:15:21 +0000 (20:15 +0000)]
use range-based for loops; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241412 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TargetLowering] StringRefize asm constraint getters.
Benjamin Kramer [Sun, 5 Jul 2015 19:29:18 +0000 (19:29 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241411 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE3] Just use an explicit SSE3 target attribute - not a cpu type.
Simon Pilgrim [Sun, 5 Jul 2015 19:06:32 +0000 (19:06 +0000)]
[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....

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241410 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE2] Just use an explicit SSE2 target attribute - not a cpu type.
Simon Pilgrim [Sun, 5 Jul 2015 19:03:51 +0000 (19:03 +0000)]
[X86][SSE2] Just use an explicit SSE2 target attribute - not a cpu type.

corei7 is capable of a lot more than just SSE2....

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241409 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RuntimeDyld] Add comment documenting the behavior change in r241383.
Lang Hames [Sun, 5 Jul 2015 18:49:17 +0000 (18:49 +0000)]
[RuntimeDyld] Add comment documenting the behavior change in r241383.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241408 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[x86][AVX512] add Multiply High Op
Asaf Badouh [Sun, 5 Jul 2015 12:23:20 +0000 (12:23 +0000)]
[x86][AVX512] add Multiply High Op
include encoding and intrinsics tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241406 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Fix incorrect/inefficient pushw encodings for x86-64 targets
Michael Kuperstein [Sun, 5 Jul 2015 10:25:41 +0000 (10:25 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241404 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CMake] add_llvm_symbol_exports: Use Python oneliner instead of "cmd.exe /c type...
NAKAMURA Takumi [Sun, 5 Jul 2015 08:56:38 +0000 (08:56 +0000)]
[CMake] add_llvm_symbol_exports: Use Python oneliner instead of "cmd.exe /c type" to generate *.def.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241402 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd missing builtins to the PPC back end for ABI compliance (vol. 2)
Nemanja Ivanovic [Sun, 5 Jul 2015 06:03:51 +0000 (06:03 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241398 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agouse range-based for loops; NFCI
Sanjay Patel [Sat, 4 Jul 2015 19:38:52 +0000 (19:38 +0000)]
use range-based for loops; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241395 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Improved i8/i16 to f64 uint2fp vector conversions
Simon Pilgrim [Sat, 4 Jul 2015 15:33:34 +0000 (15:33 +0000)]
[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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241394 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agouse valid bits to avoid unnecessary machine trace metric recomputations
Sanjay Patel [Sat, 4 Jul 2015 15:00:28 +0000 (15:00 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241393 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix spelling, NFC.
Yaron Keren [Sat, 4 Jul 2015 05:48:52 +0000 (05:48 +0000)]
Fix spelling, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241392 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoLTO: expose LTO_SYMBOL_ALIAS, which indicates that the symbol is an alias.
Peter Collingbourne [Sat, 4 Jul 2015 03:42:35 +0000 (03:42 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241389 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoObject/COFF: Do not rely on VirtualSize being 0 in object files.
Rui Ueyama [Sat, 4 Jul 2015 03:25:51 +0000 (03:25 +0000)]
Object/COFF: Do not rely on VirtualSize being 0 in object files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241387 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RuntimeDyld] Skip relocations for external symbols with 64-bit address ~0ULL.
Lang Hames [Sat, 4 Jul 2015 01:35:26 +0000 (01:35 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241383 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Add proper 64-bit mode checks to jrcxz and jcxz.
Craig Topper [Sat, 4 Jul 2015 00:01:07 +0000 (00:01 +0000)]
[X86] Add proper 64-bit mode checks to jrcxz and jcxz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241381 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Fix indentation of switch
Matt Arsenault [Fri, 3 Jul 2015 23:33:38 +0000 (23:33 +0000)]
AMDGPU: Fix indentation of switch

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241380 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj tools
Simon Atanasyan [Fri, 3 Jul 2015 23:00:54 +0000 (23:00 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241377 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUse a continue to reduce indentation.
Rafael Espindola [Fri, 3 Jul 2015 22:02:28 +0000 (22:02 +0000)]
Use a continue to reduce indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241375 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUse a continue to reduce indentation.
Rafael Espindola [Fri, 3 Jul 2015 21:57:41 +0000 (21:57 +0000)]
Use a continue to reduce indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241374 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoContext is allocated just a few lines above. Don't check if it is null.
Rafael Espindola [Fri, 3 Jul 2015 21:54:41 +0000 (21:54 +0000)]
Context is allocated just a few lines above. Don't check if it is null.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241373 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix build with -DLLVM_USE_INTEL_JITEVENTS=ON -DLLVM_USE_OPROFILE=ON.
Rafael Espindola [Fri, 3 Jul 2015 21:47:00 +0000 (21:47 +0000)]
Fix build with -DLLVM_USE_INTEL_JITEVENTS=ON -DLLVM_USE_OPROFILE=ON.

Is anyone using those?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241372 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove always-true comparison, NFC.
Filipe Cabecinhas [Fri, 3 Jul 2015 20:12:01 +0000 (20:12 +0000)]
Remove always-true comparison, NFC.

Summary:
Looking at r241279, I noticed that UpgradedIntrinsics only gets written
to in the following code:

    if (UpgradeIntrinsicFunction(&F, NewFn))
      UpgradedIntrinsics[&F] = NewFn;

Looking through UpgradeIntrinsicFunction, we always return false OR
NewFn will be set to a different function from our source.

This patch pulls the F != NewFn into UpgradeIntrinsicFunction as an
assert, and removes the check from callers of UpgradeIntrinsicFunction.

Reviewers: rafael, chandlerc

Subscribers: llvm-commits-list

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241369 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Added 32-bit builds to fp<->int tests.
Simon Pilgrim [Fri, 3 Jul 2015 20:07:57 +0000 (20:07 +0000)]
[X86] Added 32-bit builds to fp<->int tests.

Ensure that i686 x87/SSE/SSE2 targets all build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241368 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDelete dead code. NFC.
Benjamin Kramer [Fri, 3 Jul 2015 19:10:09 +0000 (19:10 +0000)]
Delete dead code. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241367 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReturn ErrorOr from getSymbolAddress.
Rafael Espindola [Fri, 3 Jul 2015 18:19:00 +0000 (18:19 +0000)]
Return ErrorOr from getSymbolAddress.

It can fail trying to get the section on ELF and COFF. This makes sure the
error is handled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241366 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReplace a few more MachO only uses of getSymbolAddress.
Rafael Espindola [Fri, 3 Jul 2015 18:02:36 +0000 (18:02 +0000)]
Replace a few more MachO only uses of getSymbolAddress.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241365 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUse getValue instead of getAddress in a few MachO only cases.
Rafael Espindola [Fri, 3 Jul 2015 17:44:18 +0000 (17:44 +0000)]
Use getValue instead of getAddress in a few MachO only cases.

In MachO the value of the symbol is always the address, so we can use the
simpler function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241364 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoThis reverts commit r241350 and r241352.
Rafael Espindola [Fri, 3 Jul 2015 14:54:02 +0000 (14:54 +0000)]
This reverts commit r241350 and r241352.

r241350 broke lld tests.
r241352 depends on r241350.

Original messages:
"[ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj tools"
"[ELFYAML] Make the Size field for .bss section optional"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241354 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDelete dead code.
Rafael Espindola [Fri, 3 Jul 2015 14:46:17 +0000 (14:46 +0000)]
Delete dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241353 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ELFYAML] Make the Size field for .bss section optional
Simon Atanasyan [Fri, 3 Jul 2015 14:19:06 +0000 (14:19 +0000)]
[ELFYAML] Make the Size field for .bss section optional

It's a common case to have a zero-size .bss section in an object file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241352 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj tools
Simon Atanasyan [Fri, 3 Jul 2015 14:07:06 +0000 (14:07 +0000)]
[ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj tools

SHT_NOBITS sections do not have content in an object file. Now yaml2obj
tool does not accept `Content` field for such sections, and obj2yaml
tool does not attempt to read the section content from a file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241350 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAvoid warning about unused variable when building without assertions.
Rafael Espindola [Fri, 3 Jul 2015 12:53:50 +0000 (12:53 +0000)]
Avoid warning about unused variable when building without assertions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241348 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAvoid a use after free.
Rafael Espindola [Fri, 3 Jul 2015 12:20:34 +0000 (12:20 +0000)]
Avoid a use after free.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241345 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoContinue to remove the notion that ELF has dynamic and static symbols.
Rafael Espindola [Fri, 3 Jul 2015 12:00:05 +0000 (12:00 +0000)]
Continue to remove the notion that ELF has dynamic and static symbols.

The ELFObjectFile now just reasons about a section/index pair, removing
one of the users that force ELF.h to maintain the difference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241344 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agollvm/test/CodeGen/ARM/fnattr-trap.ll: Add -mtriple, to appease targeting *-win32.
NAKAMURA Takumi [Fri, 3 Jul 2015 08:21:38 +0000 (08:21 +0000)]
llvm/test/CodeGen/ARM/fnattr-trap.ll: Add -mtriple, to appease targeting *-win32.

  LLVM ERROR: CPU: 'generic' does not support ARM mode execution!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241329 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agowhitespace tidyup. NFC.
Simon Pilgrim [Fri, 3 Jul 2015 08:02:12 +0000 (08:02 +0000)]
whitespace tidyup. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241326 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Sign extension for target vector sizes less than 128 bits (pt2)
Simon Pilgrim [Fri, 3 Jul 2015 08:01:36 +0000 (08:01 +0000)]
[X86][SSE] Sign extension for target vector sizes less than 128 bits (pt2)

Add support for v2i8/v2i16 to v2f64 by using a sign extension to v2i32 before conversion to v2f64.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241325 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoInitialize booleans CallsUnwindInit and CallsEHReturn with false instead of 0.
Yaron Keren [Fri, 3 Jul 2015 07:56:24 +0000 (07:56 +0000)]
Initialize booleans CallsUnwindInit and CallsEHReturn with false instead of 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241324 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Sign extension for target vector sizes less than 128 bits (pt1)
Simon Pilgrim [Fri, 3 Jul 2015 07:51:01 +0000 (07:51 +0000)]
[X86][SSE] Sign extension for target vector sizes less than 128 bits (pt1)

This patch adds support for sign extension for sub 128-bit vectors, such as to v2i32. It concatenates with UNDEF subvectors up to 128-bits, performs the sign extension (i.e. as v4i32) and then extracts the target subvector.

Patch 1/2 of D10589 - the second patch covers the conversion of v2i8/v2i16 to v2f64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241323 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix an overly aggressive assertion in getCopyFromPartsVector.
Nadav Rotem [Thu, 2 Jul 2015 23:23:52 +0000 (23:23 +0000)]
Fix an overly aggressive assertion in getCopyFromPartsVector.

The assertion in getCopyFromPartsVector assumed that the vector 'part' must
match the type of argument (arguments are potentially split into multiple
parts). However, in some cases the targets return a 'part' of the right size
but with a different type. We already handle this case correctly later on
and generate a bitcast. This commit just makes sure that we are actually
checking the property that we care about.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241312 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDIBuilder: Now that DICompileUnit is distinct, stop using temporary nodes
Adrian Prantl [Thu, 2 Jul 2015 22:32:52 +0000 (22:32 +0000)]
DIBuilder: Now that DICompileUnit is distinct, stop using temporary nodes
for the arrays.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241308 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUse function attribute "trap-func-name" and remove TargetOptions::TrapFuncName.
Akira Hatanaka [Thu, 2 Jul 2015 22:13:27 +0000 (22:13 +0000)]
Use function attribute "trap-func-name" and remove TargetOptions::TrapFuncName.

This commit changes normal isel and fast isel to read the user-defined trap
function name from function attribute "trap-func-name" attached to llvm.trap or
llvm.debugtrap instead of from TargetOptions::TrapFuncName. This is needed to
use clang's command line option "-ftrap-function" for LTO and enable changing
the trap function name on a per-call-site basis.

Out-of-tree projects currently using TargetOptions::TrapFuncName to specify the
trap function name should attach attribute "trap-func-name" to the call sites
of llvm.trap and llvm.debugtrap instead.

rdar://problem/21225723

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241305 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd functions for adding and testing string attributes to CallInst. NFC.
Akira Hatanaka [Thu, 2 Jul 2015 22:08:48 +0000 (22:08 +0000)]
Add functions for adding and testing string attributes to CallInst. NFC.

This change is needed later when I make changes to attach string function
attributes to llvm.trap and llvm.debugtrap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241304 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WebAssembly] Set the HasFloatingPointExceptions flag for WebAssembly.
Dan Gohman [Thu, 2 Jul 2015 21:36:25 +0000 (21:36 +0000)]
[WebAssembly] Set the HasFloatingPointExceptions flag for WebAssembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241302 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTry to fix the build of IntelJITEventListener.
Rafael Espindola [Thu, 2 Jul 2015 21:24:12 +0000 (21:24 +0000)]
Try to fix the build of IntelJITEventListener.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241301 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReturn ErrorOr from SymbolRef::getName.
Rafael Espindola [Thu, 2 Jul 2015 20:55:21 +0000 (20:55 +0000)]
Return ErrorOr from SymbolRef::getName.

This function can really fail since the string table offset can be out of
bounds.

Using ErrorOr makes sure the error is checked.

Hopefully a lot of the boilerplate code in tools/* can go away once we have
a diagnostic manager in Object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241297 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PPC64LE] Remove implicit-subreg restriction from VSX swap removal
Bill Schmidt [Thu, 2 Jul 2015 19:01:22 +0000 (19:01 +0000)]
[PPC64LE] Remove implicit-subreg restriction from VSX swap removal

In r241285, I removed the SUBREG_TO_REG restriction from VSX swap
removal, determining that this was overly conservative.  We have
another form of the same restriction in that we check for the presence
of implicit subregs in vector operations.  As with SUBREG_TO_REG for
partial register conversions, an implicit subreg is safe in and of
itself, provided no other operation makes a lane-sensitive assumption
about the result.  This patch removes that restriction, by removing
the HasImplicitSubreg flag and all code that relies on it.

I've added a test case that fails to optimize before this patch is
applied, and optimizes properly with the patch.  Test based on a
report from Anton Blanchard.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241290 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Statepoints] Make operator bool() explicit.
Sanjoy Das [Thu, 2 Jul 2015 18:15:18 +0000 (18:15 +0000)]
[Statepoints] Make operator bool() explicit.

(Addressing post-commit review.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241288 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove a report_fatal_error that should be unreachable.
Rafael Espindola [Thu, 2 Jul 2015 17:16:07 +0000 (17:16 +0000)]
Remove a report_fatal_error that should be unreachable.

If we created a relocation iterator, we have a valid relocation section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241286 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PPC64LE] Teach swap optimization about the doubleword splat idiom
Bill Schmidt [Thu, 2 Jul 2015 17:03:06 +0000 (17:03 +0000)]
[PPC64LE] Teach swap optimization about the doubleword splat idiom

With a previous patch, the VSX swap optimization is able to recognize
the doubleword load-splat idiom that can be implemented using lxvdsx.
However, that does not cover a doubleword splat where the source is a
register.  We can implement this using xxspltd (a special form of
xxpermdi).  This patch teaches the swap optimization pass about this
idiom.

As a prerequisite, it also permits swap optimization to succeed for
all forms of SUBREG_TO_REG.  Previously we were conservative and only
allowed SUBREG_TO_REG when it copied a full register.  However, on
reflection any form of SUBREG_TO_REG is safe in and of itself, so long
as an unsafe operation is not performed on its result.  In particular,
a widening SUBREG_TO_REG often occurs as an input to a doubleword
splat idiom, particularly in auto-vectorized code.

The doubleword splat idiom is an XXPERMDI operation where both source
registers are identical, and the selection mask is either 0 (splat the
first element) or 3 (splat the second element).  To determine whether
the registers are identical, we use the existing mechanism for looking
through "copy-like" operations.  That mechanism has a side effect of
marking the XXPERMDI operation as using a physical register, which
would invalidate its presence in a swap-optimized region.  This is
correct for the form of XXPERMDI that performs a swap and hence would
be removed, but is not what we want for a doubleword-splat variety of
XXPERMDI.  Therefore we reset the physical-register flag on the
XXPERMDI when it represents a splat.

A simple test case is added to verify that we generate the splat and
that we also remove the xxswapd instructions that would otherwise be
associated with the load and store of another operand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241285 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoConvert a member variable to a local one.
Rafael Espindola [Thu, 2 Jul 2015 16:59:57 +0000 (16:59 +0000)]
Convert a member variable to a local one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241284 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReworking the test part of r241149
Gabor Ballabas [Thu, 2 Jul 2015 16:53:23 +0000 (16:53 +0000)]
Reworking the test part of r241149

The test part of r241149 has been reverted in r241451, due to misplaced test cases.
This patch splits those test cases among the appropriate targets.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241283 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix for PR23310: llvm-dis crashes when trying to upgrade an intrinsic.
Rafael Espindola [Thu, 2 Jul 2015 16:22:40 +0000 (16:22 +0000)]
Fix for PR23310: llvm-dis crashes when trying to upgrade an intrinsic.

When trying to upgrade @llvm.x86.sse2.psrl.dq while parsing a module,
BitcodeReader adds the function to its worklist twice, resulting in a
crash when accessing it the second time.

This patch replaces the worklist vector by a map.

Patch by Philip Pfaffe.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241281 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoHandle .dynsym a bit more like we handle .symtab.
Rafael Espindola [Thu, 2 Jul 2015 16:03:38 +0000 (16:03 +0000)]
Handle .dynsym a bit more like we handle .symtab.

They have the same format and we find them in the same way, no reason to handle
them differently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241280 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRangify some loops.
Rafael Espindola [Thu, 2 Jul 2015 15:55:09 +0000 (15:55 +0000)]
Rangify some loops.

Patch by Philip Pfaffe!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241279 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUse default member initializes. NFC.
Rafael Espindola [Thu, 2 Jul 2015 15:48:05 +0000 (15:48 +0000)]
Use default member initializes. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241277 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Support] Lazy load of dbghlp.dll on Windows
Leny Kholodov [Thu, 2 Jul 2015 14:34:57 +0000 (14:34 +0000)]
[Support] Lazy load of dbghlp.dll on Windows

This patch changes linkage with dbghlp.dll for clang from static (at load time)
to on demand (at the first use of required functions). Clang uses dbghlp.dll
only in minor use-cases. First of all in case of crash and in case of plugin load.
The dbghlp.dll library can be absent on system. In this case clang will fail
to load. With lazy load of dbghlp.dll clang can work even if dbghlp.dll
is not available.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241271 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Convert an instruction relaxation test to use objdump instead of readobj
Michael Kuperstein [Thu, 2 Jul 2015 14:27:35 +0000 (14:27 +0000)]
[X86] Convert an instruction relaxation test to use objdump instead of readobj

Patch by: david.l.kreitzer@intel.com

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241270 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMove error checking from once per relocation to once per relocation section.
Rafael Espindola [Thu, 2 Jul 2015 14:27:07 +0000 (14:27 +0000)]
Move error checking from once per relocation to once per relocation section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241269 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove whitespace from start of line, NFC.
Yaron Keren [Thu, 2 Jul 2015 14:25:09 +0000 (14:25 +0000)]
Remove whitespace from start of line, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241268 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoExpose getRel and getRela to reduce code duplication.
Rafael Espindola [Thu, 2 Jul 2015 14:21:38 +0000 (14:21 +0000)]
Expose getRel and getRela to reduce code duplication.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241266 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDelete whitespace at start of line.
Yaron Keren [Thu, 2 Jul 2015 14:17:12 +0000 (14:17 +0000)]
Delete whitespace at start of line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241265 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoImprove error message.
Rafael Espindola [Thu, 2 Jul 2015 11:48:48 +0000 (11:48 +0000)]
Improve error message.

Thanks to Sean Silva for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241255 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReapply r240291: Fix shl folding in DAG combiner.
Pawel Bylica [Thu, 2 Jul 2015 11:44:54 +0000 (11:44 +0000)]
Reapply r240291: Fix shl folding in DAG combiner.

The code responsible for shl folding in the DAGCombiner was assuming incorrectly that all constants are less than 64 bits. This patch simply changes the way values are compared.

It has been reverted previously because of some problems with comparing APInt with raw uint64_t. That has been fixed/changed with r241204.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241254 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GraphWriter] Don't wait on xdg-open when not on Apple.
Charlie Turner [Thu, 2 Jul 2015 09:32:07 +0000 (09:32 +0000)]
[GraphWriter] Don't wait on xdg-open when not on Apple.

By default, the GraphWriter code assumes that the generic file open
program (`open` on Apple, `xdg-open` on other systems) can wait on the
forked proces to complete. When the fork ends, the code would delete
the temporary dot files created, and return.

On GNU/Linux, the xdg-open program does not have a "wait for your fork
to complete before dying" option. So the behaviour was that xdg-open
would launch a process, quickly die itself, and then the GraphWriter
code would think its OK to quickly delete all the temporary files.
Once the temporary files were deleted, the dot viewers would get very
upset, and often give you weird errors.

This change only waits on the generic open program on Apple platforms.
Elsewhere, we don't wait on the process, and hence we don't try and
clean up the temporary files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241250 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NFC] Minor editorial fixes to the CodeGen docs.
Charlie Turner [Thu, 2 Jul 2015 09:32:01 +0000 (09:32 +0000)]
[NFC] Minor editorial fixes to the CodeGen docs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241249 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NFC] Make the Statepoint class more like CallSite
Sanjoy Das [Thu, 2 Jul 2015 02:53:45 +0000 (02:53 +0000)]
[NFC] Make the Statepoint class more like CallSite

Summary: Rename some methods to make Statepoint look more like CallSite.

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241235 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Statepoints][NFC] Constify accessors on Statepoint.
Sanjoy Das [Thu, 2 Jul 2015 02:53:41 +0000 (02:53 +0000)]
[Statepoints][NFC] Constify accessors on Statepoint.

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241234 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Statepoints][NFC] Rename variables to llvm style.
Sanjoy Das [Thu, 2 Jul 2015 02:53:39 +0000 (02:53 +0000)]
[Statepoints][NFC] Rename variables to llvm style.

Summary:
(I don't think this change needs review, this was uploaded to
phabricator to provide context for later dependent changes.)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241233 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Statepoints][NFC] Add Statepoint::operator bool()
Sanjoy Das [Thu, 2 Jul 2015 02:53:36 +0000 (02:53 +0000)]
[Statepoints][NFC] Add Statepoint::operator bool()

Summary:
This allows the "if (Statepoint SP = Statepoint(I))" idiom.

(I don't think this change needs review, this was uploaded to
phabricator to provide context for later dependent changes.)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241232 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Statepoints][NFC] Add Statepoint::getGCResult.
Sanjoy Das [Thu, 2 Jul 2015 02:53:34 +0000 (02:53 +0000)]
[Statepoints][NFC] Add Statepoint::getGCResult.

Summary:
Introduce a simple accessor to get the gc_result hanging off of a
statepoint.

(I don't think this change needs review, this was uploaded to
phabricator to provide context for later dependent changes.)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241231 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LazyCallGraph] Port test case from r240039 to LCG.
Sanjoy Das [Thu, 2 Jul 2015 02:03:58 +0000 (02:03 +0000)]
[LazyCallGraph] Port test case from r240039 to LCG.

Summary:
r240039 adds a test case to check that CallGraph does the right thing
with respect to non-leaf intrinsics like statepoint and patchpoint.
This ports the same test case to LazyCallGraph.  LazyCallGraph already
does the right thing with respect to escaping function pointers so there
is no need to change any code.

Reviewers: chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241226 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMake an X86 specific directory and put the recent X86 tti specific
Eric Christopher [Thu, 2 Jul 2015 01:36:31 +0000 (01:36 +0000)]
Make an X86 specific directory and put the recent X86 tti specific
inlining test into it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241223 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoImplement TargetTransformInfo::hasCompatibleFunctionAttributes for X86.
Eric Christopher [Thu, 2 Jul 2015 01:11:50 +0000 (01:11 +0000)]
Implement TargetTransformInfo::hasCompatibleFunctionAttributes for X86.

This checks subtarget feature compatibility for inlining by verifying
that the callee is a strict subset of the caller's features. This includes
the cpu as part of the subtarget we can get via the incoming functions as
the backend takes CPUs as feature sets.

This allows us to inline things like:

int foo() { return baz(); }

int __attribute__((target("sse4.2"))) bar() {
  return foo();
}

so that generic code can be inlined into specialized functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241221 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd a routine to TargetTransformInfo that will allow targets to look
Eric Christopher [Thu, 2 Jul 2015 01:11:47 +0000 (01:11 +0000)]
Add a routine to TargetTransformInfo that will allow targets to look
at the attributes on a function to determine whether or not to allow
inlining.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241220 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoWebAssembly: start instructions
JF Bastien [Wed, 1 Jul 2015 23:41:25 +0000 (23:41 +0000)]
WebAssembly: start instructions

Summary:
* Add 64-bit address space feature.
* Rename SIMD feature to SIMD128.
* Handle single-thread model with an IR pass (same way ARM does).
* Rename generic processor to MVP, to follow design's lead.
* Add bleeding-edge processors, with all features included.
* Fix a few DEBUG_TYPE to match other backends.

Test Plan: ninja check

Reviewers: sunfish

Subscribers: jfb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241211 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TwoAddressInstructionPass] Try 3 Addr Conversion After Commuting.
Quentin Colombet [Wed, 1 Jul 2015 23:12:13 +0000 (23:12 +0000)]
[TwoAddressInstructionPass] Try 3 Addr Conversion After Commuting.

TwoAddressInstructionPass stops after a successful commuting but 3 Addr
conversion might be good for some cases.

Consider:

int foo(int a, int b) {
  return a + b;
}

Before this commit, we emit:

addl %esi, %edi
movl %edi, %eax
ret

After this commit, we try 3 Addr conversion:

leal (%rsi,%rdi), %eax
ret

Patch by Volkan Keles <vkeles@apple.com>!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241206 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoChange APInt comparison with uint64_t.
Pawel Bylica [Wed, 1 Jul 2015 22:56:43 +0000 (22:56 +0000)]
Change APInt comparison with uint64_t.

Summary:
This patch changes the way APInt is compared with a value of type uint64_t.
Before the uint64_t value was truncated to the size of APInt before comparison.
Now the comparison takes into account full 64-bit precision.

Test Plan: Unit tests added. No regressions. Self-hosted check-all done as well.

Reviewers: chandlerc, dexonsmith

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241204 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTest for specific output in lit test
Matthias Braun [Wed, 1 Jul 2015 22:34:59 +0000 (22:34 +0000)]
Test for specific output in lit test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241200 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopVectorize] Use ReplaceInstWithInst() helper where appropriate.
Alexey Samsonov [Wed, 1 Jul 2015 22:18:30 +0000 (22:18 +0000)]
[LoopVectorize] Use ReplaceInstWithInst() helper where appropriate.

This is mostly an NFC, which increases code readability (instead of
saving old terminator, generating new one in front of old, and deleting
old, we just call a function). However, it would additionaly copy
the debug location from old instruction to replacement, which
would help PR23837.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241197 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPack MCSymbol::Flags in to the bitfield with other members. NFC.
Pete Cooper [Wed, 1 Jul 2015 21:57:51 +0000 (21:57 +0000)]
Pack MCSymbol::Flags in to the bitfield with other members.  NFC.

All file formats only needed 16-bits right now which is enough to fit
in to the padding with other fields.

This reduces the size of MCSymbol to 24-bytes on a 64-bit system.  The
layout is now

   0 | class llvm::MCSymbol
   0 |   class llvm::PointerIntPair SectionOrFragmentAndHasName
   0 |     intptr_t Value
     |   [sizeof=8, dsize=8, align=8
     |    nvsize=8, nvalign=8]

   8 |   unsigned int IsTemporary
   8 |   unsigned int IsRedefinable
   8 |   unsigned int IsUsed
   8 |   _Bool IsRegistered
   8 |   unsigned int IsExternal
   8 |   unsigned int IsPrivateExtern
   8 |   unsigned int Kind
   9 |   unsigned int IsUsedInReloc
   9 |   unsigned int SymbolContents
   9 |   unsigned int CommonAlignLog2
  10 |   uint32_t Flags
  12 |   uint32_t Index
  16 |   union
  16 |     uint64_t Offset
  16 |     uint64_t CommonSize
  16 |     const class llvm::MCExpr * Value
     |   [sizeof=8, dsize=8, align=8
     |    nvsize=8, nvalign=8]

     | [sizeof=24, dsize=24, align=8
     |  nvsize=24, nvalign=8]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241196 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WebAssembly] Define separate Target instances for 32-bit and 64-bit.
Dan Gohman [Wed, 1 Jul 2015 21:42:34 +0000 (21:42 +0000)]
[WebAssembly] Define separate Target instances for 32-bit and 64-bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241193 91177308-0d34-0410-b5e6-96231b3b80d8