platform/upstream/llvm.git
10 years agoAdding some very nascent information about the clang tablegen backends, with a promis...
Aaron Ballman [Mon, 24 Mar 2014 18:18:31 +0000 (18:18 +0000)]
Adding some very nascent information about the clang tablegen backends, with a promise to add more information later.

llvm-svn: 204635

10 years ago[PowerPC] Generate little-endian object files
Ulrich Weigand [Mon, 24 Mar 2014 18:16:09 +0000 (18:16 +0000)]
[PowerPC] Generate little-endian object files

As a first step towards real little-endian code generation, this patch
changes the PowerPC MC layer to actually generate little-endian object
files.  This involves passing the little-endian flag through the various
layers, including down to createELFObjectWriter so we actually get basic
little-endian ELF objects, emitting instructions in little-endian order,
and handling fixups and relocations as appropriate for little-endian.

The bulk of the patch is to update most test cases in test/MC/PowerPC
to verify both big- and little-endian encodings.  (The only test cases
*not* updated are those that create actual big-endian ABI code, like
the TLS tests.)

Note that while the object files are now little-endian, the generated
code itself is not yet updated, in particular, it still does not adhere
to the ELFv2 ABI.

llvm-svn: 204634

10 years agoUse CHECK-DAG in a test so that it isn't sensitive to metadata order.
Bob Wilson [Mon, 24 Mar 2014 18:14:15 +0000 (18:14 +0000)]
Use CHECK-DAG in a test so that it isn't sensitive to metadata order.

This was failing on an internal branch where the order was different for
some reason. <rdar://problem/16407581>

llvm-svn: 204633

10 years agoInclude <mutex> for std::once.
Greg Clayton [Mon, 24 Mar 2014 18:08:18 +0000 (18:08 +0000)]
Include <mutex> for std::once.

llvm-svn: 204632

10 years ago[X86][ISelDAG] Add missing fallback patterns for avx2 broadcast instructions.
Quentin Colombet [Mon, 24 Mar 2014 17:54:19 +0000 (17:54 +0000)]
[X86][ISelDAG] Add missing fallback patterns for avx2 broadcast instructions.
Those patterns are used when the load cannot be folded into the related broadcast
during the select phase.
This happens when the load gets additional uses that were not anticipated during
the previous lowering phases (constant vector to constant load, then constant
load reused) or when selection DAG is not able to prove that folding the load
will not create a cycle in the DAG.

<rdar://problem/16074331>

llvm-svn: 204631

10 years agoR600/SI: Fix 64-bit private loads.
Matt Arsenault [Mon, 24 Mar 2014 17:50:46 +0000 (17:50 +0000)]
R600/SI: Fix 64-bit private loads.

llvm-svn: 204630

10 years agoVS integration installer: set SUCCESS=1 if we find VS 2013
Hans Wennborg [Mon, 24 Mar 2014 17:33:22 +0000 (17:33 +0000)]
VS integration installer: set SUCCESS=1 if we find VS 2013

Previously we would print an error message on machines where the only VS
version we find is 2013, even though we successfully install the integration
files for it.

Also, we shouldn't have two END labels.

llvm-svn: 204629

10 years agoRenamed a struct from i386 to i386_.
Hafiz Abid Qadeer [Mon, 24 Mar 2014 17:33:09 +0000 (17:33 +0000)]
Renamed a struct from i386 to i386_.
It is to avoid build error when gcc defines i386.

llvm-svn: 204628

10 years ago[PPC64LE] Add a CALL_ELF macro to indicate use of the ELFv2 ABI.
Will Schmidt [Mon, 24 Mar 2014 17:27:03 +0000 (17:27 +0000)]
[PPC64LE] Add a CALL_ELF macro to indicate use of the ELFv2 ABI.

Additional clarification from Uli for the background on _CALL_ELF:
"Historically GCC has provided various _CALL_... predefines depending on the
ABI currently being compiled for. (_CALL_SYSV,_CALL_AIXDESC, _CALL_DARWIN )
When we needed a new define for the current ABI, we decided on using _CALL_ELF
since the official name of the ABI is the OpenPower ElfV2 ABI, with the
current Linux ABI retro-actively being renamed the ELFv1 ABI
and so we decided on using _CALL_ELF to identify the Linux (+BSD etc.) ELF ABI,
with _CALL_ELF=1 for the v1 ABI and _CALL_ELF=2 for the v2 ABI.
(Note that this matches the gcc compiler switch -mabi=elfv1 vs. -mabi=elfv2)."

In code, a (_CALL_ELF==2) check will indicate when the ELFv2 ABI is
to be used.   This is the desired default for the PPC64 LE target.

llvm-svn: 204627

10 years agoUpdate the parameters passed to the assembler and linker for
Will Schmidt [Mon, 24 Mar 2014 17:10:37 +0000 (17:10 +0000)]
Update the parameters passed to the assembler and linker for
the PPC64LE target.  Specifically:
(assembler) adds/uses  -mppc64 -mlittle-endian
(linker) adds/uses  elf64lppc

Testcase included.

llvm-svn: 204626

10 years agoAdd test to test/CodeGen/NVPTX for "alloca buffer" arguments.
Eli Bendersky [Mon, 24 Mar 2014 16:52:30 +0000 (16:52 +0000)]
Add test to test/CodeGen/NVPTX for "alloca buffer" arguments.

Make sure such IR gets properly lowered to PTX.

llvm-svn: 204624

10 years ago[X86] Fix non-determinism in LowerVectorAllZeroTest
Adam Nemet [Mon, 24 Mar 2014 16:52:08 +0000 (16:52 +0000)]
[X86] Fix non-determinism in LowerVectorAllZeroTest

This can be observed with the old testcase of CodeGen/X86/pr12312.ll:

47c47
<       vorps   %ymm0, %ymm1, %ymm0
---
>       vorps   %ymm1, %ymm0, %ymm0
97c97
<       vorps   %ymm1, %ymm0, %ymm0
---
>       vorps   %ymm0, %ymm1, %ymm0

The vector VecIns is populated with all the values from VecInMap. This is done
while iterating VecInMap.  VecInMap uses a hash of pointer values so the
resulting order can vary depending on the memory layout.

The fix is to populate the vector VecIns earlier as VecInMap is populated.
This is done in DAG traversal order.

Fixes <rdar://problem/16398806>

llvm-svn: 204623

10 years agoModified patch from Piotr Rak that makes GetSharedModuleList() more thread safe and...
Greg Clayton [Mon, 24 Mar 2014 16:50:33 +0000 (16:50 +0000)]
Modified patch from Piotr Rak that makes GetSharedModuleList() more thread safe and also fixed a missed member initialization on the copy contractor and also makes the assignment operator safer.

llvm-svn: 204622

10 years ago[mips] Add error message when trying to use $at in '.set noat' mode.
Daniel Sanders [Mon, 24 Mar 2014 16:48:01 +0000 (16:48 +0000)]
[mips] Add error message when trying to use $at in '.set noat' mode.

Summary:
Patch by David Chisnall
His work was sponsored by: DARPA, AFRL

Differential Revision: http://llvm-reviews.chandlerc.com/D3158

llvm-svn: 204621

10 years agoRemoves the NVPTXSplitBBatBar pass.
Eli Bendersky [Mon, 24 Mar 2014 16:36:39 +0000 (16:36 +0000)]
Removes the NVPTXSplitBBatBar pass.

This pass is a historic remnant and actually causes less efficient code to be
generated in some cases.

llvm-svn: 204620

10 years agoUpdate for Ubuntu 13.10 after feedback from Eran Ifrah.
Greg Clayton [Mon, 24 Mar 2014 16:30:59 +0000 (16:30 +0000)]
Update for Ubuntu 13.10 after feedback from Eran Ifrah.

llvm-svn: 204619

10 years agoR600/SI: Fix warning with gcc 4.8.2
Tom Stellard [Mon, 24 Mar 2014 16:12:34 +0000 (16:12 +0000)]
R600/SI: Fix warning with gcc 4.8.2

llvm-svn: 204618

10 years agoR600/SI: Promote fp64 SELECT to i64
Tom Stellard [Mon, 24 Mar 2014 16:07:30 +0000 (16:07 +0000)]
R600/SI: Promote fp64 SELECT to i64

This type promotion is replacing a Tablegen pattern and it is already
covered by existing tests.

llvm-svn: 204617

10 years agoSelectionDAG: Allow promotion of SELECT nodes from float to int types
Tom Stellard [Mon, 24 Mar 2014 16:07:28 +0000 (16:07 +0000)]
SelectionDAG: Allow promotion of SELECT nodes from float to int types

And vice-versa, as long as the types are the same width.

There are a few R600 tests that will cover this.

llvm-svn: 204616

10 years agoR600: Reorganize tablegen instruction definitions
Tom Stellard [Mon, 24 Mar 2014 16:07:25 +0000 (16:07 +0000)]
R600: Reorganize tablegen instruction definitions

Each GPU family now has its own file.

llvm-svn: 204615

10 years ago[PPC64LE] ELFv2 ABI updates for the .opd section
Will Schmidt [Mon, 24 Mar 2014 16:04:15 +0000 (16:04 +0000)]
[PPC64LE] ELFv2 ABI updates for the .opd section

[PPC64LE] ELFv2 ABI updates for the .opd section
The PPC64 Little Endian (PPC64LE) target supports the ELFv2 ABI, and as
such, does not have a ".opd" section.  This is keyed off a _CALL_ELF=2
macro check.

The CALL_ELF check is not clearly documented at this time.  The basis
for usage in this patch is from the gcc thread here:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01144.html

> Adding comment from Uli:
Looks good to me.  I think the old-style JIT doesn't really work
anyway for 64-bit, but at least with this patch LLVM will compile
and link again on a ppc64le host ...

llvm-svn: 204614

10 years agoUpdate DataLayout/DescriptionString for ppc64le
Will Schmidt [Mon, 24 Mar 2014 15:48:02 +0000 (15:48 +0000)]
Update DataLayout/DescriptionString for ppc64le
Update DataLayout/DescriptionString for ppc64le

Similar LLVM change made in r203664

Testcase included.

llvm-svn: 204613

10 years ago[mips] Add regression tests for parenthetic expressions in MIPS assembly.
Daniel Sanders [Mon, 24 Mar 2014 15:42:21 +0000 (15:42 +0000)]
[mips] Add regression tests for parenthetic expressions in MIPS assembly.

Summary:
These expressions already worked but weren't tested.

Patch by Robert N. M. Watson and David Chisnall (it was originally two patches)
Their work was sponsored by: DARPA, AFRL

Differential Revision: http://llvm-reviews.chandlerc.com/D3156

llvm-svn: 204612

10 years ago[mips] Allow dsubu to take an immediate as an alias for dsubiu.
Daniel Sanders [Mon, 24 Mar 2014 15:38:00 +0000 (15:38 +0000)]
[mips] Allow dsubu to take an immediate as an alias for dsubiu.

Summary:
Patch by David Chisnall
His work was sponsored by: DARPA, AFRL

Differential Revision: http://llvm-reviews.chandlerc.com/D3155

llvm-svn: 204611

10 years agotsan: reduce default number of threads in benchmarks
Dmitry Vyukov [Mon, 24 Mar 2014 15:23:05 +0000 (15:23 +0000)]
tsan: reduce default number of threads in benchmarks
buildbots seem to OOM with that many threads

llvm-svn: 204610

10 years ago[PowerPC] Mark many instructions as commutative
Hal Finkel [Mon, 24 Mar 2014 15:07:28 +0000 (15:07 +0000)]
[PowerPC] Mark many instructions as commutative

I'm under the impression that we used to infer the isCommutable flag from the
instruction-associated pattern. Regardless, we don't seem to do this (at least
by default) any more. I've gone through all of our instruction definitions, and
marked as commutative all of those that should be trivial to commute (by
exchanging the first two operands). There has been special code for the RL*
instructions, and that's not changed.

Before this change, we had the following commutative instructions:

 RLDIMI
 RLDIMIo
 RLWIMI
 RLWIMI8
 RLWIMI8o
 RLWIMIo
 XSADDDP
 XSMULDP
 XVADDDP
 XVADDSP
 XVMULDP
 XVMULSP

After:

 ADD4
 ADD4o
 ADD8
 ADD8o
 ADDC
 ADDC8
 ADDC8o
 ADDCo
 ADDE
 ADDE8
 ADDE8o
 ADDEo
 AND
 AND8
 AND8o
 ANDo
 CRAND
 CREQV
 CRNAND
 CRNOR
 CROR
 CRXOR
 EQV
 EQV8
 EQV8o
 EQVo
 FADD
 FADDS
 FADDSo
 FADDo
 FMADD
 FMADDS
 FMADDSo
 FMADDo
 FMSUB
 FMSUBS
 FMSUBSo
 FMSUBo
 FMUL
 FMULS
 FMULSo
 FMULo
 FNMADD
 FNMADDS
 FNMADDSo
 FNMADDo
 FNMSUB
 FNMSUBS
 FNMSUBSo
 FNMSUBo
 MULHD
 MULHDU
 MULHDUo
 MULHDo
 MULHW
 MULHWU
 MULHWUo
 MULHWo
 MULLD
 MULLDo
 MULLW
 MULLWo
 NAND
 NAND8
 NAND8o
 NANDo
 NOR
 NOR8
 NOR8o
 NORo
 OR
 OR8
 OR8o
 ORo
 RLDIMI
 RLDIMIo
 RLWIMI
 RLWIMI8
 RLWIMI8o
 RLWIMIo
 VADDCUW
 VADDFP
 VADDSBS
 VADDSHS
 VADDSWS
 VADDUBM
 VADDUBS
 VADDUHM
 VADDUHS
 VADDUWM
 VADDUWS
 VAND
 VAVGSB
 VAVGSH
 VAVGSW
 VAVGUB
 VAVGUH
 VAVGUW
 VMADDFP
 VMAXFP
 VMAXSB
 VMAXSH
 VMAXSW
 VMAXUB
 VMAXUH
 VMAXUW
 VMHADDSHS
 VMHRADDSHS
 VMINFP
 VMINSB
 VMINSH
 VMINSW
 VMINUB
 VMINUH
 VMINUW
 VMLADDUHM
 VMULESB
 VMULESH
 VMULEUB
 VMULEUH
 VMULOSB
 VMULOSH
 VMULOUB
 VMULOUH
 VNMSUBFP
 VOR
 VXOR
 XOR
 XOR8
 XOR8o
 XORo
 XSADDDP
 XSMADDADP
 XSMAXDP
 XSMINDP
 XSMSUBADP
 XSMULDP
 XSNMADDADP
 XSNMSUBADP
 XVADDDP
 XVADDSP
 XVMADDADP
 XVMADDASP
 XVMAXDP
 XVMAXSP
 XVMINDP
 XVMINSP
 XVMSUBADP
 XVMSUBASP
 XVMULDP
 XVMULSP
 XVNMADDADP
 XVNMADDASP
 XVNMSUBADP
 XVNMSUBASP
 XXLAND
 XXLNOR
 XXLOR
 XXLXOR

This is a by-inspection change, and I'm not sure how to write a reliable test
case. I would like advice on this, however.

llvm-svn: 204609

10 years agotsan: add benchmarks for synchronization handling
Dmitry Vyukov [Mon, 24 Mar 2014 14:32:59 +0000 (14:32 +0000)]
tsan: add benchmarks for synchronization handling

llvm-svn: 204608

10 years ago[Mips] Fix formatting.
Simon Atanasyan [Mon, 24 Mar 2014 14:12:37 +0000 (14:12 +0000)]
[Mips] Fix formatting.

llvm-svn: 204607

10 years ago[Mips] Sort R_MIPS_LO16 / R_MIPS_HI16 / R_MIPS_GOT16 before finding
Simon Atanasyan [Mon, 24 Mar 2014 14:09:17 +0000 (14:09 +0000)]
[Mips] Sort R_MIPS_LO16 / R_MIPS_HI16 / R_MIPS_GOT16 before finding
pairs and calculate AHL addend.

llvm-svn: 204606

10 years ago[mips] Implement shorthand add / sub forms for MIPS.
Daniel Sanders [Mon, 24 Mar 2014 14:05:39 +0000 (14:05 +0000)]
[mips] Implement shorthand add / sub forms for MIPS.

Summary:
- If only two registers are passed to a three-register operation, then the
  first argument is both source and destination register.

- If a non-register is passed as the last argument, generate the immediate
  version of the instruction.

Also mark DADD commutative and add scheduling information (to the generic
scheduler), and implement DSUB.

Patch by David Chisnall
His work was sponsored by: DARPA, AFRL

CC: theraven
Differential Revision: http://llvm-reviews.chandlerc.com/D3148

llvm-svn: 204605

10 years agoAArch64_BE test case for predefined macros
Christian Pirker [Mon, 24 Mar 2014 13:57:21 +0000 (13:57 +0000)]
AArch64_BE test case for predefined macros

llvm-svn: 204604

10 years agoUse --whole-archive linker option for minw too.
Hafiz Abid Qadeer [Mon, 24 Mar 2014 13:44:52 +0000 (13:44 +0000)]
Use --whole-archive linker option for minw too.
It is already used for Linux and FreeBSD.

llvm-svn: 204603

10 years ago[CMake] Rename the variable
Alexey Samsonov [Mon, 24 Mar 2014 13:29:20 +0000 (13:29 +0000)]
[CMake] Rename the variable

llvm-svn: 204602

10 years agoRemoved a redundant entry.
Hafiz Abid Qadeer [Mon, 24 Mar 2014 13:05:09 +0000 (13:05 +0000)]
Removed a redundant entry.
Revision 203667 has already added lldbHostWindows.a
to USEDLIBS. Revision 203785 just ended up adding a redundant entry.

llvm-svn: 204601

10 years ago[NVPTX] Add isel patterns for addrspacecast
Justin Holewinski [Mon, 24 Mar 2014 11:17:53 +0000 (11:17 +0000)]
[NVPTX] Add isel patterns for addrspacecast

llvm-svn: 204600

10 years agoFix a compile-time warning
Timur Iskhodzhanov [Mon, 24 Mar 2014 11:09:01 +0000 (11:09 +0000)]
Fix a compile-time warning

lib/CodeGen/CGBuiltin.cpp:3136:12: warning: variable ‘TblPos’ set but not used [-Wunused-but-set-variable]

llvm-svn: 204599

10 years agoUpdate release notes with EHABI current behaviour
Renato Golin [Mon, 24 Mar 2014 11:02:38 +0000 (11:02 +0000)]
Update release notes with EHABI current behaviour

llvm-svn: 204598

10 years agoFix a VS compile-time warning
Timur Iskhodzhanov [Mon, 24 Mar 2014 10:47:37 +0000 (10:47 +0000)]
Fix a VS compile-time warning

warning C4345: behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized

llvm-svn: 204597

10 years agoRevert r204562,204566,204586,204587 as they broke ASan on Windows
Timur Iskhodzhanov [Mon, 24 Mar 2014 10:31:09 +0000 (10:31 +0000)]
Revert r204562,204566,204586,204587 as they broke ASan on Windows

llvm-svn: 204596

10 years agoA fix for sanitizers' TLS support on FreeBSD
Viktor Kutuzov [Mon, 24 Mar 2014 10:01:54 +0000 (10:01 +0000)]
A fix for sanitizers' TLS support on FreeBSD

llvm-svn: 204595

10 years ago[PowerPC] Don't schedule VSX copy legalization unless VSX is enabled
Hal Finkel [Mon, 24 Mar 2014 09:51:41 +0000 (09:51 +0000)]
[PowerPC] Don't schedule VSX copy legalization unless VSX is enabled

There is no need to schedule this extra pass if it will have nothing to do.

llvm-svn: 204594

10 years ago[CMake] Respect CMAKE_CXX_FLAGS in custom clang_compile commands
Alexey Samsonov [Mon, 24 Mar 2014 09:42:12 +0000 (09:42 +0000)]
[CMake] Respect CMAKE_CXX_FLAGS in custom clang_compile commands

llvm-svn: 204593

10 years agoMake MSan unittest -Werror=sign-compare clean
Alexey Samsonov [Mon, 24 Mar 2014 09:41:11 +0000 (09:41 +0000)]
Make MSan unittest -Werror=sign-compare clean

llvm-svn: 204592

10 years ago[PowerPC] Update comment re: VSX copy-instruction selection
Hal Finkel [Mon, 24 Mar 2014 09:36:36 +0000 (09:36 +0000)]
[PowerPC] Update comment re: VSX copy-instruction selection

I've done some experimentation with this, and it looks like using the
lower-latency (but lower throughput) copy instruction is essentially always the
right thing to do.

My assumption is that, in order to be relatively sure that the higher-latency
copy will increase throughput, we'd want to have it unlikely to be in-flight
with its use. On the P7, the global completion table (GCT) can hold a maximum
of 120 instructions, shared among all active threads (up to 4), giving 30
instructions per thread.  So specifically, I'd require at least that many
instructions between the copy and the use before the high-latency variant is
used.

Trying this, however, over the entire test suite resulted in zero cases where
the high-latency form would be preferable. This may be a consequence of the
fact that the scheduler views copies as free, and so they tend to end up close
to their uses. For this experiment I created a function:

  unsigned chooseVSXCopy(MachineBasicBlock &MBB,
                         MachineBasicBlock::iterator I,
                         unsigned DestReg, unsigned SrcReg,
                         unsigned StartDist = 1,
                         unsigned Depth = 3) const;

with an implementation like:

  if (!Depth)
    return PPC::XXLOR;

  const unsigned MaxDist = 30;
  unsigned Dist = StartDist;
  for (auto J = I, JE = MBB.end(); J != JE && Dist <= MaxDist; ++J) {
    if (J->isTransient() && !J->isCopy())
      continue;

    if (J->isCall() || J->isReturn() || J->readsRegister(DestReg, TRI))
      return PPC::XXLOR;

    ++Dist;
  }

  // We've exceeded the required distance for the high-latency form, use it.
  if (Dist > MaxDist)
    return PPC::XVCPSGNDP;

  // If this is only an exit block, use the low-latency form.
  if (MBB.succ_empty())
    return PPC::XXLOR;

  // We've reached the end of the block, check the successor blocks (up to some
  // depth), and use the high-latency form if that is okay with all successors.
  for (auto J = MBB.succ_begin(), JE = MBB.succ_end(); J != JE; ++J) {
    if (chooseVSXCopy(**J, (*J)->begin(), DestReg, SrcReg,
                      Dist, --Depth) == PPC::XXLOR)
      return PPC::XXLOR;
  }

  // All of our successor blocks seem okay with the high-latency variant, so
  // we'll use it.
  return PPC::XVCPSGNDP;

and then changed the copy opcode selection from:
    Opc = PPC::XXLOR;
to:
    Opc = chooseVSXCopy(MBB, std::next(I), DestReg, SrcReg);

In conclusion, I'm removing the FIXME from the comment, because I believe that
there is, at least absent other examples, nothing to fix.

llvm-svn: 204591

10 years ago[asan] Disable setjmp/sigsetjmp tests.
Evgeniy Stepanov [Mon, 24 Mar 2014 08:30:59 +0000 (08:30 +0000)]
[asan] Disable setjmp/sigsetjmp tests.

Failing due to PR19207.

llvm-svn: 204590

10 years ago[asan] Fix a comment.
Evgeniy Stepanov [Mon, 24 Mar 2014 08:27:31 +0000 (08:27 +0000)]
[asan] Fix a comment.

llvm-svn: 204589

10 years agoDriver: Fix a typo in a command line description
David Majnemer [Mon, 24 Mar 2014 05:53:13 +0000 (05:53 +0000)]
Driver: Fix a typo in a command line description

Thanks to Richard Smith for catching this!

llvm-svn: 204588

10 years agoCodeGen: Remove unneeded directives
David Majnemer [Mon, 24 Mar 2014 05:53:11 +0000 (05:53 +0000)]
CodeGen: Remove unneeded directives

Use two check-prefix patterns per FileCheck invocation for these tests,
this cleanly removes redundant CHECK directives.

Thanks to Richard Smith for the idea!

llvm-svn: 204587

10 years agoMS ABI: Add tests, other cleanups for r204562
David Majnemer [Mon, 24 Mar 2014 05:53:08 +0000 (05:53 +0000)]
MS ABI: Add tests, other cleanups for r204562

This commit cleans up a few accidents:
- Do not rely on the order in which StringLiteral lays out bytes.
- Use a more efficient mechanism for handling so-called
  "special-mappings" when mangling string literals.
- There is no need to allocate a copy of the mangled name.
- Add the test written for r204562.

Thanks to Richard Smith for pointing these out!

llvm-svn: 204586

10 years agoUpdate for llvm change.
Rafael Espindola [Mon, 24 Mar 2014 05:00:40 +0000 (05:00 +0000)]
Update for llvm change.

llvm-svn: 204585

10 years agoTeach llvm-readobj to print human friendly description of reserved sections.
Rafael Espindola [Mon, 24 Mar 2014 05:00:34 +0000 (05:00 +0000)]
Teach llvm-readobj to print human friendly description of reserved sections.

llvm-svn: 204584

10 years agoAllow constant folding of ceil function whenever feasible
Karthik Bhat [Mon, 24 Mar 2014 04:36:06 +0000 (04:36 +0000)]
Allow constant folding of ceil function whenever feasible

llvm-svn: 204583

10 years agoAdd back tests that were reverted in r204203.
Rafael Espindola [Mon, 24 Mar 2014 03:48:15 +0000 (03:48 +0000)]
Add back tests that were reverted in r204203.

They pass again with the fix in r204581.

llvm-svn: 204582

10 years agoPropagate section from base to derived symbol.
Rafael Espindola [Mon, 24 Mar 2014 03:43:21 +0000 (03:43 +0000)]
Propagate section from base to derived symbol.

We were already propagating the section in

a = b

With this patch we also propagate it for

a = b + 1

llvm-svn: 204581

10 years agoInstrProf: Silence spurious warnings in GCC 4.8
Duncan P. N. Exon Smith [Mon, 24 Mar 2014 00:47:18 +0000 (00:47 +0000)]
InstrProf: Silence spurious warnings in GCC 4.8

No functionality change.

llvm-svn: 204580

10 years agoSupportTests.LockFileManagerTest: Add assertions for Win32.
NAKAMURA Takumi [Sun, 23 Mar 2014 23:55:57 +0000 (23:55 +0000)]
SupportTests.LockFileManagerTest: Add assertions for Win32.

  - create_link doesn't work for nonexistent file.
  - remove cannot remove working directory.

llvm-svn: 204579

10 years agoRemove unused diagnostic.
Benjamin Kramer [Sun, 23 Mar 2014 23:06:04 +0000 (23:06 +0000)]
Remove unused diagnostic.

llvm-svn: 204578

10 years agoFix tests in r204576
Nico Rieck [Sun, 23 Mar 2014 22:07:53 +0000 (22:07 +0000)]
Fix tests in r204576

Proper redeclaration warnings for dllimport are not implemented yet.

llvm-svn: 204577

10 years agoTreat dllimport globals without explicit storage class as extern
Nico Rieck [Sun, 23 Mar 2014 21:24:01 +0000 (21:24 +0000)]
Treat dllimport globals without explicit storage class as extern

dllimport implies a definition which means the 'extern' keyword is optional
when declaring imported variables.

llvm-svn: 204576

10 years agoARM: no need to update SplatBits as it is not used
Arnaud A. de Grandmaison [Sun, 23 Mar 2014 21:14:32 +0000 (21:14 +0000)]
ARM: no need to update SplatBits as it is not used

llvm-svn: 204575

10 years agoAdd missing file from r204570.
Richard Smith [Sun, 23 Mar 2014 21:01:41 +0000 (21:01 +0000)]
Add missing file from r204570.

llvm-svn: 204574

10 years agollvm-profdata: Check for bad data in the show command
Justin Bogner [Sun, 23 Mar 2014 20:55:53 +0000 (20:55 +0000)]
llvm-profdata: Check for bad data in the show command

llvm-svn: 204573

10 years agoConsistently dump default template arguments for template parameters as 'TemplateArgu...
Richard Smith [Sun, 23 Mar 2014 20:50:39 +0000 (20:50 +0000)]
Consistently dump default template arguments for template parameters as 'TemplateArgument's.

llvm-svn: 204572

10 years agollvm-profdata: Use Format.h instead of handrolling a formatter
Justin Bogner [Sun, 23 Mar 2014 20:43:50 +0000 (20:43 +0000)]
llvm-profdata: Use Format.h instead of handrolling a formatter

llvm-svn: 204571

10 years agoIf a name is injected into an imported inline namespace without reopening that
Richard Smith [Sun, 23 Mar 2014 20:41:56 +0000 (20:41 +0000)]
If a name is injected into an imported inline namespace without reopening that
namespace, we need to update both the visible names of that namespace and of
its enclosing namespace set.

llvm-svn: 204570

10 years agoCleanup dead assignments reported by scan-build
Arnaud A. de Grandmaison [Sun, 23 Mar 2014 20:28:07 +0000 (20:28 +0000)]
Cleanup dead assignments reported by scan-build

llvm-svn: 204569

10 years agoWhen we inject a declaration into a namespace, add the primary DeclContext to
Richard Smith [Sun, 23 Mar 2014 19:45:26 +0000 (19:45 +0000)]
When we inject a declaration into a namespace, add the primary DeclContext to
the update set rather than the current DeclContext. Add test for the local
extern case too.

llvm-svn: 204568

10 years agoSimplify test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp by forcing...
Timur Iskhodzhanov [Sun, 23 Mar 2014 19:09:08 +0000 (19:09 +0000)]
Simplify test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp by forcing VFTableBuilder invocation with virtual function calls or constructors codegen

Previously the vftables were built at the end of the TU in a reverse-to-random order

llvm-svn: 204567

10 years agoCodeGen: Make string tests exercise the MS ABI
David Majnemer [Sun, 23 Mar 2014 18:22:10 +0000 (18:22 +0000)]
CodeGen: Make string tests exercise the MS ABI

r204562 unwittingly failed tests for some bots.  Make those tests work
with both the Itanium and MS ABIs.

llvm-svn: 204566

10 years agoWinCOFF: Add support for -ffunction-sections
David Majnemer [Sun, 23 Mar 2014 17:47:39 +0000 (17:47 +0000)]
WinCOFF: Add support for -ffunction-sections

This is a pretty straight forward translation for COFF, we just need to
stick the function in a COMDAT section marked as
IMAGE_COMDAT_SELECT_NODUPLICATES.

llvm-svn: 204565

10 years agoDriver: Map /Gy to -ffunction-sections
David Majnemer [Sun, 23 Mar 2014 17:47:22 +0000 (17:47 +0000)]
Driver: Map /Gy to -ffunction-sections

/Gy is equivalent to -ffunction-sections.
/Gy- is equivalent to -fno-function-sections.

Currently, LLVM doesn't do anything interesting with -ffunction-sections
under WinCOFF.

llvm-svn: 204564

10 years agoDriver: cleanup /vd2 test
David Majnemer [Sun, 23 Mar 2014 17:47:18 +0000 (17:47 +0000)]
Driver: cleanup /vd2 test

/vd2 is not ignored anymore, remove it from the ignored list.

Add a test to ensure that it does the right thing.

llvm-svn: 204563

10 years agoMS ABI: Eliminate Duplicate Strings
David Majnemer [Sun, 23 Mar 2014 17:47:16 +0000 (17:47 +0000)]
MS ABI: Eliminate Duplicate Strings

COFF doesn't have mergeable sections so LLVM/clang's normal tactics for
string deduplication will not have any effect.

To remedy this we place each string inside it's own section and mark
the section as IMAGE_COMDAT_SELECT_ANY.  However, we can only do this if the
string has an external name that we can generate from it's contents.

To be compatible with MSVC, we must use their scheme.  Otherwise identical
strings in translation units from clang may not be deduplicated with
translation units in MSVC.

This fixes PR18248.

N.B. We will not attempt to do anything with a string literal which is not of
type 'char' or 'wchar_t' because their compiler does not support unicode
string literals as of this date.

llvm-svn: 204562

10 years agoremove a bunch of unused private methods
Nuno Lopes [Sun, 23 Mar 2014 17:12:37 +0000 (17:12 +0000)]
remove a bunch of unused private methods
found with a smarter version of -Wunused-member-function that I'm playwing with.
Appologies in advance if I removed someone's WIP code.

 ARCMigrate/TransProperties.cpp                  |    8 -----
 AST/MicrosoftMangle.cpp                         |    1
 Analysis/AnalysisDeclContext.cpp                |    5 ---
 Analysis/LiveVariables.cpp                      |   14 ----------
 Index/USRGeneration.cpp                         |   10 -------
 Sema/Sema.cpp                                   |   33 +++++++++++++++++++++---
 Sema/SemaChecking.cpp                           |    3 --
 Sema/SemaDecl.cpp                               |   20 ++------------
 StaticAnalyzer/Checkers/GenericTaintChecker.cpp |    1
 9 files changed, 34 insertions(+), 61 deletions(-)

llvm-svn: 204561

10 years agoremove a bunch of unused private methods
Nuno Lopes [Sun, 23 Mar 2014 17:09:26 +0000 (17:09 +0000)]
remove a bunch of unused private methods
found with a smarter version of -Wunused-member-function that I'm playwing with.
Appologies in advance if I removed someone's WIP code.

 include/llvm/CodeGen/MachineSSAUpdater.h            |    1
 include/llvm/IR/DebugInfo.h                         |    3
 lib/CodeGen/MachineSSAUpdater.cpp                   |   10 --
 lib/CodeGen/PostRASchedulerList.cpp                 |    1
 lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp    |   10 --
 lib/IR/DebugInfo.cpp                                |   12 --
 lib/MC/MCAsmStreamer.cpp                            |    2
 lib/Support/YAMLParser.cpp                          |   39 ---------
 lib/TableGen/TGParser.cpp                           |   16 ---
 lib/TableGen/TGParser.h                             |    1
 lib/Target/AArch64/AArch64TargetTransformInfo.cpp   |    9 --
 lib/Target/ARM/ARMCodeEmitter.cpp                   |   12 --
 lib/Target/ARM/ARMFastISel.cpp                      |   84 --------------------
 lib/Target/Mips/MipsCodeEmitter.cpp                 |   11 --
 lib/Target/Mips/MipsConstantIslandPass.cpp          |   12 --
 lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp              |   21 -----
 lib/Target/NVPTX/NVPTXISelDAGToDAG.h                |    2
 lib/Target/PowerPC/PPCFastISel.cpp                  |    1
 lib/Transforms/Instrumentation/AddressSanitizer.cpp |    2
 lib/Transforms/Instrumentation/BoundsChecking.cpp   |    2
 lib/Transforms/Instrumentation/MemorySanitizer.cpp  |    1
 lib/Transforms/Scalar/LoopIdiomRecognize.cpp        |    8 -
 lib/Transforms/Scalar/SCCP.cpp                      |    1
 utils/TableGen/CodeEmitterGen.cpp                   |    2
 24 files changed, 2 insertions(+), 261 deletions(-)

llvm-svn: 204560

10 years ago[PowerPC] Make use of VSX f64 <-> i64 conversion instructions
Hal Finkel [Sun, 23 Mar 2014 05:35:00 +0000 (05:35 +0000)]
[PowerPC] Make use of VSX f64 <-> i64 conversion instructions

When VSX is available, these instructions should be used in preference to the
older variants that only have access to the scalar floating-point registers.

llvm-svn: 204559

10 years agoRevert r204076 for now - it caused significant regressions in a number of
Lang Hames [Sun, 23 Mar 2014 04:22:31 +0000 (04:22 +0000)]
Revert r204076 for now - it caused significant regressions in a number of
benchmarks.

<rdar://problem/16368461>

llvm-svn: 204558

10 years agoInstrProf: Check pointer size in raw profile
Duncan P. N. Exon Smith [Sun, 23 Mar 2014 03:38:12 +0000 (03:38 +0000)]
InstrProf: Check pointer size in raw profile

Since the profile can come from 32-bit machines, we need to check the
pointer size.  Change the magic number to facilitate this.

Adds tests for reading 32-bit and 64-bit binaries (both big- and
little-endian).  The tests write a binary using printf in RUN lines
(like raw-magic-but-no-header.test).  Assuming the bots don't complain,
this seems like a better way forward for testing RawInstrProfReader than
committing binary files.

<rdar://problem/16400648>

llvm-svn: 204557

10 years agoInstrProf: Indicate pointer size in raw profile
Duncan P. N. Exon Smith [Sun, 23 Mar 2014 03:38:05 +0000 (03:38 +0000)]
InstrProf: Indicate pointer size in raw profile

Since the profile can come from 32-bit machines, the reader needs to
check the pointer size.  Change the magic number to facilitate this.

<rdar://problem/16400648>

llvm-svn: 204556

10 years agoPropagate types from symbol to aliases.
Rafael Espindola [Sun, 23 Mar 2014 03:33:20 +0000 (03:33 +0000)]
Propagate types from symbol to aliases.

This is similar, but not identical to what gas does. The logic in MC is to just
compute the symbol table after parsing the entire file. GAS is mixed, given

.type b, @object
a = b
b:
.type b, @function

It will propagate the change and make 'a' a function. Given

.type b, @object
b:
a = b
.type b, @function

the type of 'a' is still object.

Since we do the computation in the end, we produce a function in both cases.

llvm-svn: 204555

10 years agoIf a template instantation introduces a name into a namespace, we need to write
Richard Smith [Sun, 23 Mar 2014 02:30:01 +0000 (02:30 +0000)]
If a template instantation introduces a name into a namespace, we need to write
out a visible update record for that namespace even if it was never declared in
this module.

llvm-svn: 204554

10 years ago[CMake] LLVMProfileData: No need to add LINK_LIBS here. LLVMBuild should do.
NAKAMURA Takumi [Sun, 23 Mar 2014 01:23:36 +0000 (01:23 +0000)]
[CMake] LLVMProfileData: No need to add LINK_LIBS here. LLVMBuild should do.

llvm-svn: 204553

10 years agollvm-profdata doesn't require LLVMCore.
NAKAMURA Takumi [Sun, 23 Mar 2014 01:23:26 +0000 (01:23 +0000)]
llvm-profdata doesn't require LLVMCore.

llvm-svn: 204552

10 years agoRemoved unused include
Alexander Kornienko [Sun, 23 Mar 2014 00:32:18 +0000 (00:32 +0000)]
Removed unused include

llvm-svn: 204551

10 years agoIf an update record makes a declaration interesting, pass it to the consumer.
Richard Smith [Sun, 23 Mar 2014 00:27:18 +0000 (00:27 +0000)]
If an update record makes a declaration interesting, pass it to the consumer.

llvm-svn: 204550

10 years agollvm-profdata: Don't pipe stderr into show for the tests
Justin Bogner [Sat, 22 Mar 2014 23:53:43 +0000 (23:53 +0000)]
llvm-profdata: Don't pipe stderr into show for the tests

Some text shows up on stderr when using guard malloc, and this test
was trying to treat that as input to llvm-profdata show. There's no
reason to pipe stderr into show at all here.

llvm-svn: 204549

10 years agoPrune includes in ARM target.
Craig Topper [Sat, 22 Mar 2014 23:51:00 +0000 (23:51 +0000)]
Prune includes in ARM target.

llvm-svn: 204548

10 years agoEmit an update record if we instantiate the definition of a function template
Richard Smith [Sat, 22 Mar 2014 23:33:22 +0000 (23:33 +0000)]
Emit an update record if we instantiate the definition of a function template
specialization from a module. (This can also happen for function template
specializations in PCHs if they're instantiated eagerly, because they're
constexpr or have a deduced return type.)

llvm-svn: 204547

10 years agoCleanup some dead assignements reported by scan-build
Arnaud A. de Grandmaison [Sat, 22 Mar 2014 20:23:26 +0000 (20:23 +0000)]
Cleanup some dead assignements reported by scan-build

No functionnal change.

llvm-svn: 204545

10 years agoARM IAS: properly handle function entries in .thumb
Saleem Abdulrasool [Sat, 22 Mar 2014 19:26:18 +0000 (19:26 +0000)]
ARM IAS: properly handle function entries in .thumb

When a label is parsed, check if there is type information available for the
label.  If so, check if the symbol is a function.  If the symbol is a function
and we are in thumb mode and no explicit thumb_func has been emitted, adjust the
symbol data to indicate that the function definition is a thumb function.

The application of this inferencing is improved value handling in the object
file (the required thumb bit is set on symbols which are thumb functions).  It
also helps improve compatibility with binutils.

The one complication that arises from this handling is the MCAsmStreamer.  The
default implementation of getOrCreateSymbolData in MCStreamer does not support
tracking the symbol data.  In order to support the semantics of thumb functions,
track symbol data in assembly streamer.  Although O(n) in number of labels in
the TU, this is already done in various other streamers and as such the memory
overhead is not a practical concern in this scenario.

llvm-svn: 204544

10 years ago[PowerPC] Fix the VSX v2f64 return register
Hal Finkel [Sat, 22 Mar 2014 18:24:43 +0000 (18:24 +0000)]
[PowerPC] Fix the VSX v2f64 return register

v2f64 values, like other 128-bit values, are returned under VSX in register
vs34 (Altivec register v2).

llvm-svn: 204543

10 years ago[TableGen] Don't assert, produce an error, when an instruction has too few operands
Hal Finkel [Sat, 22 Mar 2014 11:33:32 +0000 (11:33 +0000)]
[TableGen] Don't assert, produce an error, when an instruction has too few operands

When an instruction's operand list does not have a sufficient number of
operands to match with all of the variables that contribute to its
encoding, instead of asserting inside a call to getSubOperandNumber, produce an
informative error.

llvm-svn: 204542

10 years ago[Mips] Make the test to be a bit more relaxed to lld YAML output.
Simon Atanasyan [Sat, 22 Mar 2014 06:20:38 +0000 (06:20 +0000)]
[Mips] Make the test to be a bit more relaxed to lld YAML output.

llvm-svn: 204541

10 years agollvm-profdata: Avoid F_Text in "merge" for now, since "llvm-profdata show" is confuse...
NAKAMURA Takumi [Sat, 22 Mar 2014 05:38:22 +0000 (05:38 +0000)]
llvm-profdata: Avoid F_Text in "merge" for now, since "llvm-profdata show" is confused with CRLF.

FIXME: line_iterator should be tolerant of CR.
llvm-svn: 204540

10 years agoRevert r204493, "Make clang/test/lit.cfg pre-scan the RUN line looking for tool names,"
NAKAMURA Takumi [Sat, 22 Mar 2014 04:46:59 +0000 (04:46 +0000)]
Revert r204493, "Make clang/test/lit.cfg pre-scan the RUN line looking for tool names,"

It was incompatible to standlalone clang build.

llvm-svn: 204539

10 years ago[Constant Hoisting] Erase dead cast instructions.
Juergen Ributzka [Sat, 22 Mar 2014 01:49:30 +0000 (01:49 +0000)]
[Constant Hoisting] Erase dead cast instructions.

The cleanup code that removes dead cast instructions only removed them from the
basic block, but didn't delete them. This fix erases them now too.

llvm-svn: 204538

10 years ago[Constant Hoisting] Fix multiple entries for the same basic block in PHI nodes.
Juergen Ributzka [Sat, 22 Mar 2014 01:49:27 +0000 (01:49 +0000)]
[Constant Hoisting] Fix multiple entries for the same basic block in PHI nodes.

A PHI node usually has only one value/basic block pair per incoming basic block.
In the case of a switch statement it is possible that a following PHI node may
have more than one such pair per incoming basic block. E.g.:
%0 = phi i64 [ 123456, %case2 ], [ 654321, %Entry ], [ 654321, %Entry ]
This is valid and the verfier doesn't complain, because both values are the
same.

Constant hoisting materializes the constant for each operand separately and the
value is still the same, but the variable names have changed. As a result the
verfier can't recognize anymore that they are the same value and complains.

This fix adds special update code for PHI node in constant hoisting to prevent
this corner case.

This fixes <rdar://problem/16394449>

llvm-svn: 204537

10 years ago[DAG] Fix an assertion failure caused by an invalid cast in method 'BuildVectorSDNode...
Andrea Di Biagio [Sat, 22 Mar 2014 01:47:22 +0000 (01:47 +0000)]
[DAG] Fix an assertion failure caused by an invalid cast in method 'BuildVectorSDNode::isConstantSplat'

This patch renames method 'isConstantSplat' as 'getConstantSplatValue'
(mainly for consistency reasons), and rewrites its logic to ensure
that we always perform a legal 'cast<ConstantSDNode>'.

Added test shift-combine-crash.ll to verify that DAGCombiner no longer crashes with an assertion failure in the attempt to simplify a vector shift by a vector of all undef counts.

llvm-svn: 204536

10 years agoRefactor: move loading pending instantiations from chained PCHs to a more appropriate...
Richard Smith [Sat, 22 Mar 2014 01:43:32 +0000 (01:43 +0000)]
Refactor: move loading pending instantiations from chained PCHs to a more appropriate place, so that we only ask the external source once.

llvm-svn: 204535

10 years agoIf a single step ends on a breakpoint, it should be reported as a breakpoint hit
Jim Ingham [Sat, 22 Mar 2014 00:44:41 +0000 (00:44 +0000)]
If a single step ends on a breakpoint, it should be reported as a breakpoint hit
even though the underlying exception is a trace exception.

<rdar://problem/15243355>

llvm-svn: 204534