platform/upstream/llvm.git
8 years agoReapply "[Modules] Fix regression when an elaborated-type-specifier mentions a hidden...
Ben Langmuir [Fri, 11 Dec 2015 22:05:13 +0000 (22:05 +0000)]
Reapply "[Modules] Fix regression when an elaborated-type-specifier mentions a hidden tag"

Now not trying to use a C++ lookup mechanism in C (d'oh).  Unqualified
lookup is actually fine for this case in C.

llvm-svn: 255377

8 years agoHinted lock (OpenMP 4.5 feature) Updates/Fixes Part 3
Jonathan Peyton [Fri, 11 Dec 2015 22:04:05 +0000 (22:04 +0000)]
Hinted lock (OpenMP 4.5 feature) Updates/Fixes Part 3

This change set includes all changes to make the code conform to the OMP 4.5 specification:

* Removed hint / hinted_init definitions from include/40 files
* Hint values are powers of 2 to enable composition (4.5 spec)
* Hinted lock initialization functions were renamed (4.5 spec)
  kmp_init_lock_hinted -> omp_init_lock_with_hint
  kmp_init_nest_lock_hinted -> omp_init_nest_lock_with_hint
* __kmpc_critical_section_with_hint was added to support a critical section with
  a hint (4.5 spec)
* __kmp_map_hint_to_lock was added to convert a hint (possibly a composite) to
  an internal lock type
* kmpc_init_lock_with_hint and kmpc_init_nest_lock_with_hint were added as
  internal entries for the hinted lock initializers. The preivous internal
  functions (__kmp_init*) were moved to kmp_csupport.c and reused in multiple
  places
* Added the two init functions to dllexports
* KMP_USE_DYNAMIC_LOCK is turned on if OMP_41_ENABLED is turned on

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

llvm-svn: 255376

8 years agoHinted lock (OpenMP 4.5 feature) Updates/Fixes Part 2
Jonathan Peyton [Fri, 11 Dec 2015 21:57:06 +0000 (21:57 +0000)]
Hinted lock (OpenMP 4.5 feature) Updates/Fixes Part 2

* Added a new user TSX lock implementation, RTM, This implementation is a
  light-weight version of the adaptive lock implementation, omitting the
  back-off logic for deciding when to specualte (or not). The fall-back lock is
  still the queuing lock.
* Changed indirect lock table management. The data for indirect lock management
  was encapsulated in the "kmp_indirect_lock_table_t" type. Also, the lock table
  dimension was changed to 2D (was linear), and each entry is a
  kmp_indirect_lock_t object now (was a pointer to an object).
* Some clean up in the critical section code
* Removed the limits of the tuning parameters read from KMP_ADAPTIVE_LOCK_PROPS
* KMP_USE_DYNAMIC_LOCK=1 also turns on these two switches:
  KMP_USE_TSX, KMP_USE_ADAPTIVE_LOCKS

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

llvm-svn: 255375

8 years agoRemove hardcoded registers from Hexagon ABI
Ted Woodward [Fri, 11 Dec 2015 21:52:47 +0000 (21:52 +0000)]
Remove hardcoded registers from Hexagon ABI

Summary: The Hexagon ABI plugin uses hardcoded registers when setting up function calls. This is OK for the Hexagon simulator, but the register numbers are different on the gdbserver running on hardware. Change the hardcoded registers to LLDB generic registers.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 255374

8 years agoHinted lock (OpenMP 4.5 feature) Updates/Fixes
Jonathan Peyton [Fri, 11 Dec 2015 21:49:08 +0000 (21:49 +0000)]
Hinted lock (OpenMP 4.5 feature) Updates/Fixes

There are going to be two more patches which bring this feature up to date and in line with OpenMP 4.5.

* Renamed jump tables for the lock functions (and some clean up).
* Renamed some macros to be in KMP_ namespace.
* Return type of unset functions changed from void to int.
* Enabled use of _xebgin() et al. intrinsics for accessing TSX instructions.

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

llvm-svn: 255373

8 years agoUnify diagnostics for type defintitions in bad contexts
Reid Kleckner [Fri, 11 Dec 2015 21:39:12 +0000 (21:39 +0000)]
Unify diagnostics for type defintitions in bad contexts

The message for a type definition in an "if" condition was different
from the other three for no particular reason.

llvm-svn: 255372

8 years agoError on redeclaring with a conflicting asm label and on redeclaring with an asm...
Nick Lewycky [Fri, 11 Dec 2015 21:28:55 +0000 (21:28 +0000)]
Error on redeclaring with a conflicting asm label and on redeclaring with an asm label after the first ODR-use. Detects problems like the one in PR22830 where gcc and clang both compiled the file but with different behaviour.

llvm-svn: 255371

8 years agoAdd tests for bitcast-bitcast sequences for all scalar/vector permutations
Sanjay Patel [Fri, 11 Dec 2015 20:26:30 +0000 (20:26 +0000)]
Add tests for bitcast-bitcast sequences for all scalar/vector permutations

As noted in http://reviews.llvm.org/D15392 , we should be able to improve this.

llvm-svn: 255370

8 years ago[PGO] Revert r255365: solution incomplete, not handling lambda yet
Xinliang David Li [Fri, 11 Dec 2015 20:23:22 +0000 (20:23 +0000)]
[PGO] Revert r255365: solution incomplete, not handling lambda yet

llvm-svn: 255369

8 years ago[PGO] Revert r255366: solution incomplete, not handling lambda yet
Xinliang David Li [Fri, 11 Dec 2015 20:23:12 +0000 (20:23 +0000)]
[PGO] Revert r255366: solution incomplete, not handling lambda yet

llvm-svn: 255368

8 years ago[PGO] Stop using invalid char in instr variable names.
Xinliang David Li [Fri, 11 Dec 2015 19:53:35 +0000 (19:53 +0000)]
[PGO] Stop using invalid char in instr variable names.

(This is part-2 of the patch -- fixing test cases)

Before the patch, -fprofile-instr-generate compile will fail
if no integrated-as is specified when the file contains
any static functions (the -S output is also invalid).

This patch fixed the issue. With the change, the index format
version will be bumped up by 1. Backward compatibility is
preserved with this change.

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

llvm-svn: 255366

8 years ago[PGO] Stop using invalid char in instr variable names.
Xinliang David Li [Fri, 11 Dec 2015 19:53:19 +0000 (19:53 +0000)]
[PGO] Stop using invalid char in instr variable names.

Before the patch, -fprofile-instr-generate compile will fail
if no integrated-as is specified when the file contains
any static functions (the -S output is also invalid).

This patch fixed the issue. With the change, the index format
version will be bumped up by 1. Backward compatibility is
preserved with this change.

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

llvm-svn: 255365

8 years agoFix Clang-tidy modernize-use-nullptr and readability-simplify-boolean-expr warnings...
Eugene Zelenko [Fri, 11 Dec 2015 19:52:15 +0000 (19:52 +0000)]
Fix Clang-tidy modernize-use-nullptr and readability-simplify-boolean-expr warnings in source/Target/Target.cpp.

Simplify smart pointers checks in conditions.

llvm-svn: 255364

8 years agoAdd expected timeout support to test event architecture.
Todd Fiala [Fri, 11 Dec 2015 19:44:23 +0000 (19:44 +0000)]
Add expected timeout support to test event architecture.

llvm-svn: 255363

8 years agoCodeGen: Redo analyzePhysRegs() and computeRegisterLiveness()
Matthias Braun [Fri, 11 Dec 2015 19:42:09 +0000 (19:42 +0000)]
CodeGen: Redo analyzePhysRegs() and computeRegisterLiveness()

computeRegisterLiveness() was broken in that it reported dead for a
register even if a subregister was alive. I assume this was because the
results of analayzePhysRegs() are hard to understand with respect to
subregisters.

This commit: Changes the results of analyzePhysRegs (=struct
PhysRegInfo) to be clearly understandable, also renames the fields to
avoid silent breakage of third-party code (and improve the grammar).

Fix all (two) users of computeRegisterLiveness() in llvm: By reenabling
it and removing workarounds for the bug.

This fixes http://llvm.org/PR24535 and http://llvm.org/PR25033

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

llvm-svn: 255362

8 years agoRemove -S option from dotest.py.
Zachary Turner [Fri, 11 Dec 2015 19:21:49 +0000 (19:21 +0000)]
Remove -S option from dotest.py.

llvm-svn: 255361

8 years agoRemove -r and -R options from dotest.py.
Zachary Turner [Fri, 11 Dec 2015 19:21:34 +0000 (19:21 +0000)]
Remove -r and -R options from dotest.py.

llvm-svn: 255360

8 years agoStart replacing vector_extract/vector_insert with extractelt/insertelt
Matt Arsenault [Fri, 11 Dec 2015 19:20:16 +0000 (19:20 +0000)]
Start replacing vector_extract/vector_insert with extractelt/insertelt

These are redundant pairs of nodes defined for
INSERT_VECTOR_ELEMENT/EXTRACT_VECTOR_ELEMENT.
insertelement/extractelement are slightly closer to the corresponding
C++ node name, and has stricter type checking so prefer it.

Update targets to only use these nodes where it is trivial to do so.
AArch64, ARM, and Mips all have various type errors on simple replacement,
so they will need work to fix.

Example from AArch64:

def : Pat<(sext_inreg (vector_extract (v16i8 V128:$Rn), VectorIndexB:$idx), i8),
          (i32 (SMOVvi8to32 V128:$Rn, VectorIndexB:$idx))>;

Which is trying to do sext_inreg i8, i8.

llvm-svn: 255359

8 years agoDisassemblerLLVMC now gets the disassembler comments for an instruction
Sean Callanan [Fri, 11 Dec 2015 19:10:04 +0000 (19:10 +0000)]
DisassemblerLLVMC now gets the disassembler comments for an instruction
and appends them to our list of comments (which can additionally include
things like decoded addresses).

llvm-svn: 255358

8 years agoTreat unnamed symbols as locals.
Rafael Espindola [Fri, 11 Dec 2015 19:09:21 +0000 (19:09 +0000)]
Treat unnamed symbols as locals.

There is work under way in llvm to avoid creating unnecessary names for
symbols. This makes lld capable of handling that.

llvm-svn: 255357

8 years ago[WebAssembly] Fix ADJCALLSTACKDOWN/UP use/defs
Derek Schuff [Fri, 11 Dec 2015 18:55:34 +0000 (18:55 +0000)]
[WebAssembly] Fix ADJCALLSTACKDOWN/UP use/defs

Summary:
ADJCALLSTACK{DOWN,UP} (aka CALLSEQ_{START,END}) MIs are supposed to use
and def the stack pointer. Since they do not, all the nodes are being
eliminated by DeadMachineInstructionElim, so they aren't in the IR when
PrologEpilogInserter/eliminateCallFramePseudo needs them.

This change fixes that, but since RegStackify will not stackify across
them (and it runs early, before PEI), change LowerCall to only emit them
when the call frame size is > 0. That makes the current code work the
same way and makes code handled by D15344 also work the same way. We can
expand the condition beyond NumBytes > 0 in the future if needed.

Reviewers: sunfish, jfb

Subscribers: jfb, dschuff, llvm-commits

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

llvm-svn: 255356

8 years agoDiscard local symbols from SHF_MERGE sections.
Rafael Espindola [Fri, 11 Dec 2015 18:49:29 +0000 (18:49 +0000)]
Discard local symbols from SHF_MERGE sections.

This matches the behavior of both gold and bfd ld.

llvm-svn: 255355

8 years agoRevert r255247, r255265, and r255286 due to serious compile-time regressions.
Chad Rosier [Fri, 11 Dec 2015 18:39:41 +0000 (18:39 +0000)]
Revert r255247, r255265, and r255286 due to serious compile-time regressions.

Revert "[DSE] Disable non-local DSE to see if the bots go green."
Revert "[DeadStoreElimination] Use range-based loops. NFC."
Revert "[DeadStoreElimination] Add support for non-local DSE."

llvm-svn: 255354

8 years agoCXX_FAST_TLS calling convention: target independent portion.
Manman Ren [Fri, 11 Dec 2015 18:24:30 +0000 (18:24 +0000)]
CXX_FAST_TLS calling convention: target independent portion.

The access function has a short entry and a short exit, the initialization
block is only run the first time. To improve the performance, we want to
have a short frame at the entry and exit.

We explicitly handle most of the CSRs via copies. Only the CSRs that are not
handled via copies will be in CSR_SaveList.

Frame lowering and prologue/epilogue insertion will generate a short frame
in the entry and exit according to CSR_SaveList. The majority of the CSRs will
be handled by register allcoator. Register allocator will try to spill and
reload them in the initialization block.

We add CSRsViaCopy, it will be explicitly handled during lowering.

1> we first set FunctionLoweringInfo->SplitCSR if conditions are met (the target
   supports it for the given calling convention and the function has only return
   exits). We also call TLI->initializeSplitCSR to perform initialization.
2> we call TLI->insertCopiesSplitCSR to insert copies from CSRsViaCopy to
   virtual registers at beginning of the entry block and copies from virtual
   registers to CSRsViaCopy at beginning of the exit blocks.
3> we also need to make sure the explicit copies will not be eliminated.

rdar://problem/23557469

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

llvm-svn: 255353

8 years agofix typos; NFC
Sanjay Patel [Fri, 11 Dec 2015 18:12:01 +0000 (18:12 +0000)]
fix typos; NFC

llvm-svn: 255352

8 years agoAdd test event marking a test as explicitly eligible for rerun if it is marked flakey.
Todd Fiala [Fri, 11 Dec 2015 18:06:47 +0000 (18:06 +0000)]
Add test event marking a test as explicitly eligible for rerun if it is marked flakey.

This will be used in a future change to support rerunning flakey tests
that hit a test result isue in a low-load, single worker test runner phase.

This is implemented as an additive-style event rather than being
evaluated and added to the start_test event because the decorator code
only runs after the start_test event is created and sent.  i.e.
LLDBTestResult.startTest() runs before the test method decorators run.

llvm-svn: 255351

8 years ago[dsymutil] Ignore absolute symbols in the debug map
Frederic Riss [Fri, 11 Dec 2015 17:50:37 +0000 (17:50 +0000)]
[dsymutil] Ignore absolute symbols in the debug map

Quoting from the comment added to the code:

    // Objective-C on i386 uses artificial absolute symbols to
    // perform some link time checks. Those symbols have a fixed 0
    // address that might conflict with real symbols in the object
    // file. As I cannot see a way for absolute symbols to find
    // their way into the debug information, let's just ignore those.

llvm-svn: 255350

8 years agoELF: Allow -e <entry> with -shared
Ed Maste [Fri, 11 Dec 2015 17:46:46 +0000 (17:46 +0000)]
ELF: Allow -e <entry> with -shared

It is reasonable to specify an entry point for shared objects - for
example, for the FreeBSD rtld ld-elf.so.1.

Unlike GNU ld we leave the entry address as 0 if -shared is specified
without -e.

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

llvm-svn: 255349

8 years agoAlignmentFromAssumptions and SLPVectorizer preserves AA and GlobalsAA
Hal Finkel [Fri, 11 Dec 2015 17:46:01 +0000 (17:46 +0000)]
AlignmentFromAssumptions and SLPVectorizer preserves AA and GlobalsAA

GlobalsAA's assumptions that passes do not escape globals not previously
escaped is not violated by AlignmentFromAssumptions and SLPVectorizer. Marking
them as such allows GlobalsAA to be preserved until GVN in the LTO pipeline.

http://lists.llvm.org/pipermail/llvm-dev/2015-December/092972.html

Patch by Vaivaswatha Nagaraj!

llvm-svn: 255348

8 years agoTest that -e <symbol> works
Ed Maste [Fri, 11 Dec 2015 17:42:38 +0000 (17:42 +0000)]
Test that -e <symbol> works

llvm-svn: 255347

8 years ago[OpenCL 2.0] In OpenCL v2.0 s6.5 all pointers are implicitly in generic
Anastasia Stulova [Fri, 11 Dec 2015 17:41:19 +0000 (17:41 +0000)]
[OpenCL 2.0] In OpenCL v2.0 s6.5 all pointers are implicitly in generic
address space unless address space is explicitly specified.

Correct the behavior of NULL constant detection -
generic AS void pointer should be accepted as a valid NULL constant.

http://reviews.llvm.org/D15293

llvm-svn: 255346

8 years ago[compiler-rt] [safestack] Enable for aarch64
Adhemerval Zanella [Fri, 11 Dec 2015 17:38:38 +0000 (17:38 +0000)]
[compiler-rt] [safestack] Enable for aarch64

This patch enables the safestack for aarch64. The frontend already have
it enabled on all supported architectures and no adjustment is required
in llvm.

The compiler-rt adjustments are basically add on the cmake configuration
to enable the tests and fix the pagesize debug check by getting its
value at runtime (since aarch64 has multiple pagesize depending of
kernel configuration).

llvm-svn: 255345

8 years ago[TableGen] Correct Namespace lookup with AltNames in AsmWriterEmitter
Hal Finkel [Fri, 11 Dec 2015 17:31:27 +0000 (17:31 +0000)]
[TableGen] Correct Namespace lookup with AltNames in AsmWriterEmitter

AsmWriterEmitter will generate a getRegisterName function with an alternate
register name index as its second argument if the target makes use of them. The
enum of these values is generated in RegisterInfoEmitter. The getRegisterName
generator would assume the namespace could always be found by reading index 1
of the list of AltNameIndices, but this will fail if this list is sorted such
that the NoRegAltName is at index 1. Because this list is sorted by record name
(in CodeGenTarget::ReadRegAltNameIndices), you only run in to problems if your
MyTargetRegisterInfo.td defines a single RegAltNameIndex that sorts lexically
before NoRegAltName.

For example, if a target has something like

  def AnAltNameIndex : RegAltNameIndex

and defines RegAltNameIndices for some registers then, prior to this change,
AsmWriterEmitter would generate references to

  ::AnAltNameIndex and ::NoRegAltName

Patch by Alex Bradbury!

llvm-svn: 255344

8 years agoPruneEH pass incorrectly reports that a change was made
Artur Pilipenko [Fri, 11 Dec 2015 16:30:26 +0000 (16:30 +0000)]
PruneEH pass incorrectly reports that a change was made

Reviewed By: reames

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

llvm-svn: 255343

8 years agoCreate test for llvm.org/pr25806
Tamas Berghammer [Fri, 11 Dec 2015 16:24:14 +0000 (16:24 +0000)]
Create test for llvm.org/pr25806

LLDB don't detect the loading of a shared object file linked against the
main executable before the static initializers are executed for the
given module. Because of this it is not possible to get breakpoint hits
in these static initializers and to display proper debug info in case of
a crash in these codes.

llvm-svn: 255342

8 years agoXFAIL TestLoadUnload for Windows->Android
Pavel Labath [Fri, 11 Dec 2015 16:16:51 +0000 (16:16 +0000)]
XFAIL TestLoadUnload for Windows->Android

llvm-svn: 255341

8 years agoChange finishSwigPythonLLDB.py to copy six.py instead of simlink it
Ted Woodward [Fri, 11 Dec 2015 15:43:36 +0000 (15:43 +0000)]
Change finishSwigPythonLLDB.py to copy six.py instead of simlink it

Summary: If six.py is simlink'd, an installation won't be able to find it unless it has access to the source tree that lldb was built from.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 255340

8 years agoReverting r255337 as it seems to kill bots. Needs investigation.
Anastasia Stulova [Fri, 11 Dec 2015 15:23:00 +0000 (15:23 +0000)]
Reverting r255337 as it seems to kill bots. Needs investigation.

llvm-svn: 255339

8 years ago[RenderScript] Support for amd64 RS hooks
Ewan Crawford [Fri, 11 Dec 2015 13:49:21 +0000 (13:49 +0000)]
[RenderScript] Support for amd64 RS hooks

Adds support for reading a maximum of six integer arguments from a renderscript hook on X86_64.
Author: Luke Drummond <luke.drummond@codeplay.com>

llvm-svn: 255338

8 years ago[OpenCL 2.0] In OpenCL v2.0 s6.5 all pointers are implicitly in generic
Anastasia Stulova [Fri, 11 Dec 2015 13:49:15 +0000 (13:49 +0000)]
[OpenCL 2.0] In OpenCL v2.0 s6.5 all pointers are implicitly in generic
address space unless address space is explicitly specified.

Correct the behavior of NULL constant detection -
generic AS void pointer should be accepted as a valid NULL constant.

http://reviews.llvm.org/D15293

llvm-svn: 255337

8 years ago[Mem2Reg] Respect optnone
James Molloy [Fri, 11 Dec 2015 13:36:59 +0000 (13:36 +0000)]
[Mem2Reg] Respect optnone

Mem2Reg shouldn't be optimizing a function that is marked
optnone. There is a test checking this that fails when mem2reg is
explicitly added to the standard pass pipeline.

llvm-svn: 255336

8 years agoRevert "Turn on new test summary results by default."
Pavel Labath [Fri, 11 Dec 2015 11:05:24 +0000 (11:05 +0000)]
Revert "Turn on new test summary results by default."

The new test summary formatter does not honor the "expected timeout" markings, which makes our
buildbots all red. I'm switching it off by default until we figure out a way to make this work.

llvm-svn: 255335

8 years ago[InstCombine] Make MatchBSwap also match bit reversals
James Molloy [Fri, 11 Dec 2015 10:04:51 +0000 (10:04 +0000)]
[InstCombine] Make MatchBSwap also match bit reversals

MatchBSwap has most of the functionality to match bit reversals already. If we switch it from looking at bytes to individual bits and remove a few early exits, we can extend the main recursive function to match any sequence of ORs, ANDs and shifts that assemble a value from different parts of another, base value. Once we have this bit->bit mapping, we can very simply detect if it is appropriate for a bswap or bitreverse.

llvm-svn: 255334

8 years ago[ELF] - R_X86_64_SIZE64/R_X86_64_SIZE32 relocations implemented.
George Rimar [Fri, 11 Dec 2015 08:59:37 +0000 (08:59 +0000)]
[ELF] - R_X86_64_SIZE64/R_X86_64_SIZE32 relocations implemented.

R_X86_64_SIZE64/R_X86_64_SIZE32 relocations were introduced in 0.98v of "System V Application Binary Interface x86-64" (http://www.x86-64.org/documentation/abi.pdf).

Calculation for them is Z + A, where:
Z - Represents the size of the symbol whose index resides in the relocation entry.
A - Represents the addend used to compute the value of the relocatable field.

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

llvm-svn: 255332

8 years agoRevert previous test commit.
Maxim Ostapenko [Fri, 11 Dec 2015 07:40:25 +0000 (07:40 +0000)]
Revert previous test commit.

llvm-svn: 255331

8 years agoThis is a test commit to check my commit access works.
Maxim Ostapenko [Fri, 11 Dec 2015 07:31:29 +0000 (07:31 +0000)]
This is a test commit to check my commit access works.

llvm-svn: 255330

8 years ago[PGO] Read VP raw data without depending on the Value field
Xinliang David Li [Fri, 11 Dec 2015 06:53:53 +0000 (06:53 +0000)]
[PGO] Read VP raw data without depending on the Value field

Before this patch, each function's on-disk VP data is 'pointed'
to by the Value field of per-function ProfileData structue, and
read relies on this field (relocated with ValueDataDelta field)
to read the value data. However this means the Value field needs
to be updated during runtime before dumping, which creates undesirable
data races.

With this patch, the reading of VP data no longer depends on Value
field. There is no format change. ValueDataDelta header field becomes
obsolute but will be kept for compatibility reason (will be removed
next time the raw format change is needed).

llvm-svn: 255329

8 years agoDriver: add multilibs for ARM EB
Saleem Abdulrasool [Fri, 11 Dec 2015 06:20:59 +0000 (06:20 +0000)]
Driver: add multilibs for ARM EB

This improves the coverage for the multilib directories used for ARM.  Also add
tests covering the internal triple (thumbv7-*).  The Juno board can be run in
this configuration.

llvm-svn: 255328

8 years ago[PGO] add a test case in profiler runtime
Xinliang David Li [Fri, 11 Dec 2015 05:43:55 +0000 (05:43 +0000)]
[PGO] add a test case in profiler runtime

Add a test case to cover profile dumping of functions with no
value sites, functions with value sites but no dynamic VP data,
and functions with runtime VP data.

llvm-svn: 255327

8 years ago[PGO] Add a test case to cover version-3 format
Xinliang David Li [Fri, 11 Dec 2015 04:02:57 +0000 (04:02 +0000)]
[PGO] Add a test case to cover version-3 format

llvm-svn: 255326

8 years agoCorrectly type-check the default arguments of local functions
John McCall [Fri, 11 Dec 2015 01:56:36 +0000 (01:56 +0000)]
Correctly type-check the default arguments of local functions
when eagerly instantiating them.

rdar://23721638

llvm-svn: 255325

8 years agoRevert "[Modules] Fix regression when an elaborated-type-specifier mentions a hidden...
Ben Langmuir [Fri, 11 Dec 2015 01:44:43 +0000 (01:44 +0000)]
Revert "[Modules] Fix regression when an elaborated-type-specifier mentions a hidden tag"

This is causing assertion failures; reverting until I can fix.

This reverts commit r255267

llvm-svn: 255324

8 years agoAdd some more tests for initializer lists related to CWG1591
Faisal Vali [Fri, 11 Dec 2015 01:04:30 +0000 (01:04 +0000)]
Add some more tests for initializer lists related to CWG1591

llvm-svn: 255323

8 years agoFix build after r255319.
Hans Wennborg [Fri, 11 Dec 2015 00:58:32 +0000 (00:58 +0000)]
Fix build after r255319.

llvm-svn: 255322

8 years agoFix a spurious if.
Eric Christopher [Fri, 11 Dec 2015 00:51:59 +0000 (00:51 +0000)]
Fix a spurious if.

llvm-svn: 255321

8 years ago[LazyValueInfo] Stop inserting overdefined values into ValueCache to
Akira Hatanaka [Fri, 11 Dec 2015 00:49:47 +0000 (00:49 +0000)]
[LazyValueInfo] Stop inserting overdefined values into ValueCache to
reduce memory usage.

Previously, LazyValueInfoCache inserted overdefined lattice values into
both ValueCache and OverDefinedCache. This wasn't necessary and was
causing LazyValueInfo to use an excessive amount of memory in some cases.

This patch changes LazyValueInfoCache to insert overdefined values only
into OverDefinedCache. The memory usage decreases by 70 to 75% when one
of the files in llvm is compiled.

rdar://problem/11388615

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

llvm-svn: 255320

8 years ago[PPC]: Peephole optimize small accesss to aligned globals.
Kyle Butt [Fri, 11 Dec 2015 00:47:36 +0000 (00:47 +0000)]
[PPC]: Peephole optimize small accesss to aligned globals.

Access to aligned globals gives us a chance to peephole optimize nonzero
offsets. If a struct is 4 byte aligned, then accesses to bytes 0-3 won't
overflow the available displacement. For example:
        addis 3, 2, b4v@toc@ha
        addi 4, 3, b4v@toc@l
        lbz 5, b4v@toc@l(3) ; This is the result of the current peephole
        lbz 6, 1(4)         ; optimizer
        lbz 7, 2(4)
        lbz 8, 3(4)
If b4v is 4-byte aligned, we can skip using register 4 because we know
that b4v@toc@l+{1,2,3} won't overflow 32K, and instead generate:
        addis 3, 2, b4v@toc@ha
        lbz 4, b4v@toc@l(3)
        lbz 5, b4v@toc@l+1(3)
        lbz 6, b4v@toc@l+2(3)
        lbz 7, b4v@toc@l+3(3)
Saving a register and an addition.
Larger alignments allow larger structures/arrays to be optimized.

llvm-svn: 255319

8 years agoCheck in the script for building Win snapshots
Hans Wennborg [Fri, 11 Dec 2015 00:43:42 +0000 (00:43 +0000)]
Check in the script for building Win snapshots

llvm-svn: 255318

8 years ago[ProfileData] clang-format TextInstrProfReader::hasFormat. NFC.
Vedant Kumar [Fri, 11 Dec 2015 00:40:05 +0000 (00:40 +0000)]
[ProfileData] clang-format TextInstrProfReader::hasFormat. NFC.

llvm-svn: 255317

8 years ago[X86][SSE] Update the cost table for integer-integer conversions on SSE2/SSE4.1.
Cong Hou [Fri, 11 Dec 2015 00:31:39 +0000 (00:31 +0000)]
[X86][SSE] Update the cost table for integer-integer conversions on SSE2/SSE4.1.

Previously in the conversion cost table there are no entries for integer-integer
conversions on SSE2. This will result in imprecise costs for certain vectorized
operations. This patch adds those entries for SSE2 and SSE4.1. The cost numbers
are counted from the result of running llc on the new test case in this patch.

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

llvm-svn: 255315

8 years agoClean ExprConstant/CGExprConstant up a bit. NFC.
George Burgess IV [Fri, 11 Dec 2015 00:23:35 +0000 (00:23 +0000)]
Clean ExprConstant/CGExprConstant up a bit. NFC.

llvm-svn: 255314

8 years agoFormat fix (NFC)
Xinliang David Li [Thu, 10 Dec 2015 23:48:05 +0000 (23:48 +0000)]
Format fix (NFC)

llvm-svn: 255313

8 years ago[VFS] Fix status() of opened redirected file
Ben Langmuir [Thu, 10 Dec 2015 23:41:39 +0000 (23:41 +0000)]
[VFS] Fix status() of opened redirected file

Make RedirectedFileSystem::openFilForRead(path)->status() the same as
RedirectedFileSystem::status(path). Previously we would just get the
status of the underlying real file, which would not have the IsVFSMapped
bit set.

This fixes rebuilding a module that has an include that is relative to
the includer where we will lookup the real path of that file before we
lookup the VFS location.

rdar://problem/23640339

llvm-svn: 255312

8 years agoIn Objective-C, ignore attempts to redefine the ARC/GC qualifier macros.
John McCall [Thu, 10 Dec 2015 23:31:01 +0000 (23:31 +0000)]
In Objective-C, ignore attempts to redefine the ARC/GC qualifier macros.

This works around existing system headers which unconditionally
redefine these macros.

This is reasonably safe to do because we used to warn about it anyway
(outside of system headers).  Continue to warn if the redefinition
would have changed the expansion.  Still permit redefinition if the
macro is explicitly #undef'ed first.

rdar://23788307

llvm-svn: 255311

8 years agotest result details now print module.class.test_name in verbose mode.
Todd Fiala [Thu, 10 Dec 2015 23:14:24 +0000 (23:14 +0000)]
test result details now print module.class.test_name in verbose mode.

And, turns off verbose mode by default.  This must have been switched
on as the default when somebody was testing.

llvm-svn: 255310

8 years agoObjective-C properties: merge attributes when redeclaring 'readonly' as 'readwrite...
Douglas Gregor [Thu, 10 Dec 2015 23:02:09 +0000 (23:02 +0000)]
Objective-C properties: merge attributes when redeclaring 'readonly' as 'readwrite' in an extension.

r251874 stopped back-patching the AST when an Objective-C 'readonly'
property is redeclared in a class extension as 'readwrite'. However,
it did not properly handle merging of Objective-C property attributes
(e.g., getter name, ownership, atomicity) to the redeclaration,
leading to bad metadata. Merge (and check!) those property attributes
so we get the right metadata and reasonable ASTs. Fixes
rdar://problem/23823989.

llvm-svn: 255309

8 years agoAdd NetBSD support in the buildDriver and buildLibrary routines
Kamil Rytarowski [Thu, 10 Dec 2015 22:56:56 +0000 (22:56 +0000)]
Add NetBSD support in the buildDriver and buildLibrary routines

Summary: NetBSD is like FreeBSD and Linux in these routines.

Reviewers: clay.chang, tfiala, emaste, joerg

Subscribers: lldb-commits, emaste

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

llvm-svn: 255308

8 years agoFix alignment computation for copy relocs.
Rafael Espindola [Thu, 10 Dec 2015 22:53:24 +0000 (22:53 +0000)]
Fix alignment computation for copy relocs.

Fixes PR25798.

Thanks to Ed Maste for the bug report and suggested fix.

llvm-svn: 255307

8 years agos/need/needs
Eric Christopher [Thu, 10 Dec 2015 22:29:26 +0000 (22:29 +0000)]
s/need/needs

llvm-svn: 255306

8 years agoFix (bitcast (fabs x)), (bitcast (fneg x)) and (bitcast (fcopysign cst,
Eric Christopher [Thu, 10 Dec 2015 22:09:06 +0000 (22:09 +0000)]
Fix (bitcast (fabs x)), (bitcast (fneg x)) and (bitcast (fcopysign cst,
x)) combines for ppc_fp128, since signbit computation is more
complicated.

Discussion thread:
http://lists.llvm.org/pipermail/llvm-dev/2015-November/092863.html

Patch by Tim Shen!

llvm-svn: 255305

8 years agoAttempt to fix the ReST compilation to html of the C API docs.
Eric Christopher [Thu, 10 Dec 2015 22:04:11 +0000 (22:04 +0000)]
Attempt to fix the ReST compilation to html of the C API docs.

llvm-svn: 255304

8 years agoMore non-ascii quote characters.
Eric Christopher [Thu, 10 Dec 2015 21:47:38 +0000 (21:47 +0000)]
More non-ascii quote characters.

llvm-svn: 255303

8 years agoClarify some of the wording on adding a new subcomponent to the
Eric Christopher [Thu, 10 Dec 2015 21:46:24 +0000 (21:46 +0000)]
Clarify some of the wording on adding a new subcomponent to the
C API.

llvm-svn: 255302

8 years agoFix non-ascii quotes.
Eric Christopher [Thu, 10 Dec 2015 21:38:56 +0000 (21:38 +0000)]
Fix non-ascii quotes.

llvm-svn: 255301

8 years agoAdd C API guidelines to the developer policy to match discussions
Eric Christopher [Thu, 10 Dec 2015 21:33:53 +0000 (21:33 +0000)]
Add C API guidelines to the developer policy to match discussions
on the llvm mailing lists.

llvm-svn: 255300

8 years agoPPC: Teach FMA mutate to respect register classes.
Kyle Butt [Thu, 10 Dec 2015 21:28:40 +0000 (21:28 +0000)]
PPC: Teach FMA mutate to respect register classes.

This was causing bad code gen and assembly that won't assemble, as
mixed altivec and vsx code would end up with a vsx high register
assigned to an altivec instruction, which won't work. Constraining the
classes allows the optimization to proceed.

llvm-svn: 255299

8 years ago[CMake] Add LLVM_BUILD_INSTRUMENTED option to enable building with -fprofile-instr...
Chris Bieneman [Thu, 10 Dec 2015 21:19:07 +0000 (21:19 +0000)]
[CMake] Add LLVM_BUILD_INSTRUMENTED option to enable building with -fprofile-instr-generate

This is the first step in supporting PGO data generation via CMake. I've marked the option as advanced and experimental until it is fleshed out further.

llvm-svn: 255298

8 years agowww: Mention -DGCC_INSTALL_PREFIX instead of --with-gcc-toolchain
Justin Bogner [Thu, 10 Dec 2015 20:52:59 +0000 (20:52 +0000)]
www: Mention -DGCC_INSTALL_PREFIX instead of --with-gcc-toolchain

Since the instructions use cmake, we should probably refer to the
cmake flags and not the configure ones.

llvm-svn: 255297

8 years ago[LibFuzzer] Introducing FUZZER_FLAG_UNSIGNED and using it for seeding.
Mike Aizatsky [Thu, 10 Dec 2015 20:41:53 +0000 (20:41 +0000)]
[LibFuzzer] Introducing FUZZER_FLAG_UNSIGNED and using it for seeding.

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

done

llvm-svn: 255296

8 years agoEarlyCSE: add tests
JF Bastien [Thu, 10 Dec 2015 20:24:34 +0000 (20:24 +0000)]
EarlyCSE: add tests

Summary: As a follow-up to rL255054 I wasn't able to convince myself that the code did what I thought, so I wrote more tests.

Reviewers: reames

Subscribers: llvm-commits

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

llvm-svn: 255295

8 years ago[PGO] Split value profiling runtime into its own file
Xinliang David Li [Thu, 10 Dec 2015 20:24:09 +0000 (20:24 +0000)]
[PGO] Split value profiling runtime into its own file

Value profile runtime depends on libc which breaks
buffer API implemenation with current file organization.

Test case is also updated to check more symbols.

llvm-svn: 255294

8 years agoSync up with master
Xinliang David Li [Thu, 10 Dec 2015 20:14:13 +0000 (20:14 +0000)]
Sync up with master

llvm-svn: 255293

8 years agoAdd a forward declaration (NFC)
Xinliang David Li [Thu, 10 Dec 2015 20:13:41 +0000 (20:13 +0000)]
Add a forward declaration (NFC)

llvm-svn: 255292

8 years agoDelete a duplicate branch in IfConversion.cpp. NFC.
Cong Hou [Thu, 10 Dec 2015 19:57:22 +0000 (19:57 +0000)]
Delete a duplicate branch in IfConversion.cpp. NFC.

llvm-svn: 255291

8 years ago[PGO] Move impl specific decl to InstrProfilingInternal.h (NFC)
Xinliang David Li [Thu, 10 Dec 2015 19:50:04 +0000 (19:50 +0000)]
[PGO] Move impl specific decl to InstrProfilingInternal.h (NFC)

llvm-svn: 255290

8 years ago[DAGCombiner] Fix PR25763 - vector comparison constant folding + sign-extension
Simon Pilgrim [Thu, 10 Dec 2015 19:47:06 +0000 (19:47 +0000)]
[DAGCombiner] Fix PR25763 - vector comparison constant folding + sign-extension

PR25763 demonstrated an issue with D14683 - vector comparison constant folding only works for i1 results, so we need to split off the sign-extension of the result to the required type. Luckily this can be done with the existing type legalization code.

llvm-svn: 255289

8 years ago[Sema] Replace pointer-to-map with a map. NFC.
George Burgess IV [Thu, 10 Dec 2015 19:25:21 +0000 (19:25 +0000)]
[Sema] Replace pointer-to-map with a map. NFC.

llvm-svn: 255288

8 years ago[TSan] Try harder to avoid compiler-generated memcpy calls.
Alexey Samsonov [Thu, 10 Dec 2015 19:24:27 +0000 (19:24 +0000)]
[TSan] Try harder to avoid compiler-generated memcpy calls.

check_memcpy test added in r254959 fails on some configurations due to
memcpy() calls inserted by Clang. Try harder to avoid them by using
internal_memcpy() where applicable.

llvm-svn: 255287

8 years ago[DSE] Disable non-local DSE to see if the bots go green.
Chad Rosier [Thu, 10 Dec 2015 19:23:02 +0000 (19:23 +0000)]
[DSE] Disable non-local DSE to see if the bots go green.

I see a few bots timing out, so I'm speculatively disabling r255247.

llvm-svn: 255286

8 years ago[PGO] Move target-dependent macro to InstrProfilingPort.h (NFC)
Xinliang David Li [Thu, 10 Dec 2015 19:20:25 +0000 (19:20 +0000)]
[PGO] Move target-dependent macro to InstrProfilingPort.h (NFC)

llvm-svn: 255285

8 years agoSimplify. NFC.
Rui Ueyama [Thu, 10 Dec 2015 19:19:04 +0000 (19:19 +0000)]
Simplify. NFC.

llvm-svn: 255284

8 years agoMake commands printed by llvm-lit include the build path in lit.cfg.
Pete Cooper [Thu, 10 Dec 2015 19:17:35 +0000 (19:17 +0000)]
Make commands printed by llvm-lit include the build path in lit.cfg.

When llvm-lit prints a failure, you'll see something like 'lld *command*' However, you can't then take this, paste it in to a terminal and run it, because it's not got the absolute path of lld.

llvm and clang's lit.cfg files contain lists of commands to look for which are substituted by their full paths. So now you'd see something like '*build dir*/bin/lld *command*'.

This patch adds the same capability to lld's lit.cfg

Reviewed by Rafael EspĂ­ndola

llvm-svn: 255283

8 years agoSimplify an expression. NFC.
Rui Ueyama [Thu, 10 Dec 2015 19:13:08 +0000 (19:13 +0000)]
Simplify an expression. NFC.

llvm-svn: 255282

8 years agoDo not generate DW_TAG_imported_module for anonymous namespaces (even nested) for...
Ekaterina Romanova [Thu, 10 Dec 2015 18:52:50 +0000 (18:52 +0000)]
Do not generate DW_TAG_imported_module for anonymous namespaces (even nested) for all the platforms except PS4.
For PS4, generate explicit import for anonymous namespaces and mark it by DW_AT_artificial attribute.

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

llvm-svn: 255281

8 years agoRemove the -y option from dotest.py.
Zachary Turner [Thu, 10 Dec 2015 18:52:09 +0000 (18:52 +0000)]
Remove the -y option from dotest.py.

llvm-svn: 255280

8 years agoRemove the -x option from dotest.py.
Zachary Turner [Thu, 10 Dec 2015 18:51:40 +0000 (18:51 +0000)]
Remove the -x option from dotest.py.

llvm-svn: 255279

8 years agoRemove deprecated command line options from dotest.py
Zachary Turner [Thu, 10 Dec 2015 18:51:21 +0000 (18:51 +0000)]
Remove deprecated command line options from dotest.py

llvm-svn: 255278

8 years agoRemove the --output-on-success command line argument from dotest.
Zachary Turner [Thu, 10 Dec 2015 18:51:02 +0000 (18:51 +0000)]
Remove the --output-on-success command line argument from dotest.

llvm-svn: 255277

8 years agoRemove the -T option from dotest.py.
Zachary Turner [Thu, 10 Dec 2015 18:50:49 +0000 (18:50 +0000)]
Remove the -T option from dotest.py.

llvm-svn: 255276

8 years agoRemove -w option from dotest.py.
Zachary Turner [Thu, 10 Dec 2015 18:50:32 +0000 (18:50 +0000)]
Remove -w option from dotest.py.

llvm-svn: 255275