platform/upstream/llvm.git
9 years ago[asan] when registering globals, use the same unwinder as we use for malloc, instead...
Kostya Serebryany [Mon, 23 Feb 2015 20:40:53 +0000 (20:40 +0000)]
[asan] when registering globals, use the same unwinder as we use for malloc, instead of the one used for FATAL crash (which may be too slow)

llvm-svn: 230256

9 years agoOnly lower __builtin_setjmp / __builtin_longjmp to
Joerg Sonnenberger [Mon, 23 Feb 2015 20:23:47 +0000 (20:23 +0000)]
Only lower __builtin_setjmp / __builtin_longjmp to
llvm.eh.sjlj.setjmp / llvm.eh.sjlj.longjmp, if the backend is known to
support them outside the Exception Handling context. The default
handling in LLVM codegen doesn't work and will create incorrect code.
The ARM backend on the other hand will assert if the intrinsics are
used.

llvm-svn: 230255

9 years agoCFI: Improve design doc with larger virtual tables and asm examples.
Peter Collingbourne [Mon, 23 Feb 2015 20:22:17 +0000 (20:22 +0000)]
CFI: Improve design doc with larger virtual tables and asm examples.

llvm-svn: 230254

9 years agoFixed typo.
Zoran Jovanovic [Mon, 23 Feb 2015 20:20:49 +0000 (20:20 +0000)]
Fixed typo.

llvm-svn: 230253

9 years agoAttempting to fix WinEHCatchDirector destructor related build failures.
Andrew Kaylor [Mon, 23 Feb 2015 20:19:15 +0000 (20:19 +0000)]
Attempting to fix WinEHCatchDirector destructor related build failures.

llvm-svn: 230252

9 years agoRemove EOL whitespace from PlatformLinux
Ed Maste [Mon, 23 Feb 2015 20:18:37 +0000 (20:18 +0000)]
Remove EOL whitespace from PlatformLinux

This reduces the noise when diffing PlatformFreeBSD and PlatformLinux.

llvm-svn: 230251

9 years agoAdding test for Windows EH frame variable remapping.
Andrew Kaylor [Mon, 23 Feb 2015 20:04:51 +0000 (20:04 +0000)]
Adding test for Windows EH frame variable remapping.

llvm-svn: 230250

9 years agoRemap frame variables for native Windows exception handling.
Andrew Kaylor [Mon, 23 Feb 2015 20:01:56 +0000 (20:01 +0000)]
Remap frame variables for native Windows exception handling.

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

llvm-svn: 230249

9 years agoRevert "[X86][MMX] Add MMX instructions to foldable tables"
Bruno Cardoso Lopes [Mon, 23 Feb 2015 19:53:37 +0000 (19:53 +0000)]
Revert "[X86][MMX] Add MMX instructions to foldable tables"

This reverts commit r230226 since it breaks win buildbots.

llvm-svn: 230248

9 years agoRe-land part of r230171: fix GoTsanRuntimeCheck with ccache.
Alexey Samsonov [Mon, 23 Feb 2015 19:35:42 +0000 (19:35 +0000)]
Re-land part of r230171: fix GoTsanRuntimeCheck with ccache.

llvm-svn: 230247

9 years agoRevert "Revert "Raising minimum required CMake version to 2.8.12.2.""
Chad Rosier [Mon, 23 Feb 2015 19:34:04 +0000 (19:34 +0000)]
Revert "Revert "Raising minimum required CMake version to 2.8.12.2.""

This reverts commit r230240, which was an accidental commit.

llvm-svn: 230246

9 years agoRewrite the global merge pass to be subprogram agnostic for now.
Eric Christopher [Mon, 23 Feb 2015 19:28:45 +0000 (19:28 +0000)]
Rewrite the global merge pass to be subprogram agnostic for now.
It was previously using the subtarget to get values for the global
offset without actually checking each function as it was generating
code. Go ahead and solidify the current behavior and make the
existing FIXMEs more prominent.

As a note the ARM backend previously had a thumb1 and non-thumb1
set of defaults. Only the former was tested so I've changed the
behavior to only use that for now.

llvm-svn: 230245

9 years agoInstrProf: Run clang-format to fix some strange indentation (NFC)
Justin Bogner [Mon, 23 Feb 2015 19:27:00 +0000 (19:27 +0000)]
InstrProf: Run clang-format to fix some strange indentation (NFC)

Somehow this file ended up with a strange hybrid of the old "indent
inside a namespace" style and the new "don't", giving us a wonderful
two-space indent starting halfway through a namespace. Fix it.

llvm-svn: 230244

9 years ago-fms-extensions: Bump the default _MSC_VER from 1700 to 1800, aka VS2013
Reid Kleckner [Mon, 23 Feb 2015 19:25:48 +0000 (19:25 +0000)]
-fms-extensions: Bump the default _MSC_VER from 1700 to 1800, aka VS2013

VS 2013 is the minimum supported version, so it's reasonable for Clang
to simulate this by default. This also simplifies the clang-cl
self-host, since we have the 18.00 version check.

llvm-svn: 230243

9 years agoAdd -fdefine-sized-deallocation to ASan test case.
Alexey Samsonov [Mon, 23 Feb 2015 19:18:31 +0000 (19:18 +0000)]
Add -fdefine-sized-deallocation to ASan test case.

This flag is now needed to force Clang emit the weak definition
of sized delete if it's not present in the header.

llvm-svn: 230242

9 years agoPrevent hoisting fmul from THEN/ELSE to IF if there is fmsub/fmadd opportunity.
Chad Rosier [Mon, 23 Feb 2015 19:15:16 +0000 (19:15 +0000)]
Prevent hoisting fmul from THEN/ELSE to IF if there is fmsub/fmadd opportunity.

This patch adds the isProfitableToHoist API.  For AArch64, we want to prevent a
fmul from being hoisted in cases where it is more profitable to form a
fmsub/fmadd.

Phabricator Review: http://reviews.llvm.org/D7299
Patch by Lawrence Hu <lawrence@codeaurora.org>

llvm-svn: 230241

9 years agoRevert "Raising minimum required CMake version to 2.8.12.2."
Chad Rosier [Mon, 23 Feb 2015 19:15:08 +0000 (19:15 +0000)]
Revert "Raising minimum required CMake version to 2.8.12.2."

This reverts commit 247aed4710e8befde76da42b27313661dea7cf66.

llvm-svn: 230240

9 years agocmake: Don't do the libstdc++ version check when clang simulates MSVC
Reid Kleckner [Mon, 23 Feb 2015 19:07:25 +0000 (19:07 +0000)]
cmake: Don't do the libstdc++ version check when clang simulates MSVC

If we're using clang-cl, that's a pretty good indication that we're
going to use MSVC's STL.

This simplifies the clang-cl ninja self-host configuration down to:
CC=clang-cl CXX=clang-cl cmake .. -GNinja

Modified version of zturner's patch:
Differential Revision: http://reviews.llvm.org/D7824

llvm-svn: 230239

9 years agoInstSimplify: simplify 0 / X if nnan and nsz
Mehdi Amini [Mon, 23 Feb 2015 18:30:25 +0000 (18:30 +0000)]
InstSimplify: simplify 0 / X if nnan and nsz

From: Fiona Glaser <fglaser@apple.com>
llvm-svn: 230238

9 years agoFix a problem where lldb-mi would not stop the debuggee after -exec-interrupt command.
Hafiz Abid Qadeer [Mon, 23 Feb 2015 18:27:17 +0000 (18:27 +0000)]
Fix a problem where lldb-mi would not stop the debuggee after -exec-interrupt command.

Summary:
This revision fixes a problem where lldb-mi would not stop the execution after exec-interrupt call.
On Linux, SIGSTOP is used to stop the debuggee process. LLDB stopped the debuggee alright. But when
lldb-mi received the notification of stopping with reason as SIGSTOP, it would resume the process.
This was heppening in CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopSignal. This function aslo
used hard coded numbers for signal istead of symbolic names.

This revision changes code to treat SIGSTOP reason as SIGINT. Also used symbolic names for signals
instead of numbers.

Reviewers: ki.stfu, clayborg

Reviewed By: ki.stfu, clayborg

Subscribers: zturner, lldb-commits

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

llvm-svn: 230237

9 years agoAdd null RegisterContext assertions
Ed Maste [Mon, 23 Feb 2015 18:12:20 +0000 (18:12 +0000)]
Add null RegisterContext assertions

This makes these failures slightly more obvious, avoiding the need to
run LLDB under a debugger or rely on a LLDB core.  I encountered these
while bringing up a new OS/arch combination.

llvm-svn: 230236

9 years ago[mips] Honour -mno-odd-spreg for vector insert/extract when MSA is enabled.
Daniel Sanders [Mon, 23 Feb 2015 17:22:16 +0000 (17:22 +0000)]
[mips] Honour -mno-odd-spreg for vector insert/extract when MSA is enabled.

Summary:
-mno-odd-spreg prohibits the use of odd-numbered single-precision floating
point registers. However, vector insert/extract was still using them when
manipulating the subregisters of an MSA register. Fixed this by ensuring
that insertion/extraction is only performed on even-numbered vector
registers when -mno-odd-spreg is given.

Reviewers: vmedic, sstankovic

Reviewed By: sstankovic

Subscribers: llvm-commits

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

llvm-svn: 230235

9 years agoFix incorrect immediate size for AddrModeT2_i8s4 in rewriteT2FrameIndex.
Bob Wilson [Mon, 23 Feb 2015 16:57:19 +0000 (16:57 +0000)]
Fix incorrect immediate size for AddrModeT2_i8s4 in rewriteT2FrameIndex.

The natural way to handle this addressing mode would be to say that it has
8 bits and gets scaled by 4, but since the MC layer is expecting the scaling
to be already reflected in the immediate value, we have been setting the
Scale to 1. That's fine, but then NumBits needs to be adjusted to reflect
the effective increase in the range of the immediate. That adjustment was
missing.

The consequence is that the register scavenger can fail.
The estimateRSStackSizeLimit() function in ARMFrameLowering.cpp correctly
assumes that the AddrModeT2_i8s4 address mode can handle scaled offsets up to
1020. Under just the right circumstances, we fail to reserve space for the
scavenger because it thinks that nothing will be needed. However, the overly
pessimistic behavior in rewriteT2FrameIndex causes some frame indexes to be
out of range and require scavenged registers, and so the scavenger asserts.

Unfortunately I have not been able to come up with a testcase for this. I
can only reproduce it on an internal branch where the frame layout and
register allocation is slightly different than trunk. We really need a
way to serialize MachineInstr-level IR to write reasonable tests for things
like this.

rdar://problem/19909005

llvm-svn: 230233

9 years agoSync the __builtin_expects for our 3 quadratically probed hash table implementations.
Benjamin Kramer [Mon, 23 Feb 2015 16:41:36 +0000 (16:41 +0000)]
Sync the __builtin_expects for our 3 quadratically probed hash table implementations.

This assumes that
  a) finding the bucket containing the value is LIKELY
  b) finding an empty bucket is LIKELY
  c) growing the table is UNLIKELY

I also switched the a) and b) cases for SmallPtrSet as we seem to use
the set mostly more for insertion than for checking existence.

In a simple benchmark consisting of 2^21 insertions of 2^20 unique
pointers into a DenseMap or SmallPtrSet a few percent speedup on average,
but nothing statistically significant.

llvm-svn: 230232

9 years ago[FIX] 2 broken tests
Johannes Doerfert [Mon, 23 Feb 2015 16:34:20 +0000 (16:34 +0000)]
[FIX] 2 broken tests

llvm-svn: 230231

9 years agoUse ScalarEvolution to create tight bounds on the parameters
Johannes Doerfert [Mon, 23 Feb 2015 16:15:51 +0000 (16:15 +0000)]
Use ScalarEvolution to create tight bounds on the parameters

llvm-svn: 230230

9 years ago[X86] Add specific mtriple in order to appease builbots
Bruno Cardoso Lopes [Mon, 23 Feb 2015 15:33:40 +0000 (15:33 +0000)]
[X86] Add specific mtriple in order to appease builbots

llvm-svn: 230229

9 years agoExit early from DumpELFProgramHeaders if parse fails
Ed Maste [Mon, 23 Feb 2015 15:33:11 +0000 (15:33 +0000)]
Exit early from DumpELFProgramHeaders if parse fails

This matches the way DumpELFSectionHeaders is implemented and is
recommended by the LLVM coding conventions.

llvm-svn: 230228

9 years agoelf-core: correct "no sections" to "no segments."
Ed Maste [Mon, 23 Feb 2015 15:28:42 +0000 (15:28 +0000)]
elf-core: correct "no sections" to "no segments."

The error reported here is that there are no phdr entries, so it's
referring to segments, not sections.

llvm-svn: 230227

9 years ago[X86][MMX] Add MMX instructions to foldable tables
Bruno Cardoso Lopes [Mon, 23 Feb 2015 15:23:22 +0000 (15:23 +0000)]
[X86][MMX] Add MMX instructions to foldable tables

Teach the peephole optimizer to work with MMX instructions by adding
entries into the foldable tables. This covers folding opportunities not
handled during isel.

llvm-svn: 230226

9 years ago[X86][MMX] Support folding loads in psll, psrl and psra intrinsics
Bruno Cardoso Lopes [Mon, 23 Feb 2015 15:23:14 +0000 (15:23 +0000)]
[X86][MMX] Support folding loads in psll, psrl and psra intrinsics

llvm-svn: 230225

9 years ago[X86][MMX] Add tests for pslli, psrli and psrai intrinsics
Bruno Cardoso Lopes [Mon, 23 Feb 2015 15:23:06 +0000 (15:23 +0000)]
[X86][MMX] Add tests for pslli, psrli and psrai intrinsics

Add tests to cover the RR form of the pslli, psrli and psrai intrinsics.
In the next commit, the loads are going to be folded and the
instructions use the RM form.

llvm-svn: 230224

9 years agoAVX-512: recommitted 229837 + bugfix + test
Elena Demikhovsky [Mon, 23 Feb 2015 15:12:31 +0000 (15:12 +0000)]
AVX-512: recommitted 229837 + bugfix + test

llvm-svn: 230223

9 years ago[NFC] Unify the use of Context.CurRegion
Johannes Doerfert [Mon, 23 Feb 2015 14:18:28 +0000 (14:18 +0000)]
[NFC] Unify the use of Context.CurRegion

llvm-svn: 230222

9 years agorestructured X86 scalar unary operation templates
Elena Demikhovsky [Mon, 23 Feb 2015 14:14:02 +0000 (14:14 +0000)]
restructured X86 scalar unary operation templates

I made the templates general, no need to define pattern separately for each instruction/intrinsic.
Now only need to add r_Int pattern for AVX.

llvm-svn: 230221

9 years ago[REFACTOR] Replace Pass* from BlockGen by the DomTree
Johannes Doerfert [Mon, 23 Feb 2015 13:51:35 +0000 (13:51 +0000)]
[REFACTOR] Replace Pass* from BlockGen by the DomTree

llvm-svn: 230220

9 years ago[ELF][Writer] Use llvm::StringMap instead
Shankar Easwaran [Mon, 23 Feb 2015 13:50:23 +0000 (13:50 +0000)]
[ELF][Writer] Use llvm::StringMap instead

Cleanup.

llvm-svn: 230219

9 years ago[ELF] Add comments in the ELF reader
Shankar Easwaran [Mon, 23 Feb 2015 13:25:44 +0000 (13:25 +0000)]
[ELF] Add comments in the ELF reader

Address review comments from Ruiu, and add some more TODO's.

llvm-svn: 230218

9 years ago[llvm-pdbdump] Remove unused variables.
Benjamin Kramer [Mon, 23 Feb 2015 11:33:54 +0000 (11:33 +0000)]
[llvm-pdbdump] Remove unused variables.

llvm-svn: 230216

9 years agoDisable file descriptor leak tests on python >=2.7.8
Pavel Labath [Mon, 23 Feb 2015 11:14:28 +0000 (11:14 +0000)]
Disable file descriptor leak tests on python >=2.7.8

this version introduced an internal leak, which we cannot reasonably fix.

llvm-svn: 230215

9 years agoOrc/JITSymbol.h requires not "Compiler.h" but "DataTypes.h" due to uint64_t.
NAKAMURA Takumi [Mon, 23 Feb 2015 11:12:52 +0000 (11:12 +0000)]
Orc/JITSymbol.h requires not "Compiler.h" but "DataTypes.h" due to uint64_t.

llvm-svn: 230214

9 years agoFix the communication in qPlatform_[mkdir,chmod]
Tamas Berghammer [Mon, 23 Feb 2015 11:03:08 +0000 (11:03 +0000)]
Fix the communication in qPlatform_[mkdir,chmod]

With the previous implementation the protocol used by the client and the
server for the response was different and worked only by an accident.
With this change the communication is fixed and the return code from
mkdir and chmod correctly captured by lldb. The change also add
documentation for the qPlatform__[mkdir,chmod] packages.

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

llvm-svn: 230213

9 years agoSet error status when failed to catch stop after launch
Tamas Berghammer [Mon, 23 Feb 2015 10:59:54 +0000 (10:59 +0000)]
Set error status when failed to catch stop after launch

Process::Launch try to catch a stop signal after launching a process. If
it is unsuccessful it destroy the process but previously still reported
that the process launched successfully. This behavior caused a
deadlock. With thic change the process launch error reported correctly.

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

llvm-svn: 230212

9 years agoSupport evaluation of DWARF expressions setting CFA
Pavel Labath [Mon, 23 Feb 2015 10:29:01 +0000 (10:29 +0000)]
Support evaluation of DWARF expressions setting CFA

Summary:
This patch enables evaluation of DWARF expressions setting the CFA during stack unwinding.

This makes TestSigtrampUnwind "almost" pass on linux. I am not enabling the test yet since the
symbol name for the signal trampoline does not get resolved properly due to a different bug, but
apart from that, the backtrace is sane.

I am unsure how this change affects Mac. I think it makes the unwinder prefer the DWARF unwind
plan instead of some custom platform-dependant plan. However, it does not affect the end result
- the stack unwinding works as expected.

Reviewers: jasonmolenda

Subscribers: lldb-commits

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

llvm-svn: 230211

9 years agoUnwindPlan::Row refactor -- add support for CFA set by a DWARF expression
Pavel Labath [Mon, 23 Feb 2015 10:19:16 +0000 (10:19 +0000)]
UnwindPlan::Row refactor -- add support for CFA set by a DWARF expression

Summary:
This change refactors UnwindPlan::Row to be able to store the fact that the CFA is value is set
by evaluating a dwarf expression (DW_CFA_def_cfa_expression). This is achieved by creating a new
class CFAValue and moving all CFA setting/getting code there. Note that code using the new
CFAValue::isDWARFExpression is not yet present and will be added in a follow-up patch. Therefore,
this patch should not change the functionality in any way.

Test Plan: Ran tests on Mac and Linux. No regressions detected.

Reviewers: jasonmolenda, clayborg

Subscribers: lldb-commits

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

llvm-svn: 230210

9 years ago[TSan][Clang][MIPS] Enabled thread option for MIPS64 platform
Mohit K. Bhakkad [Mon, 23 Feb 2015 09:32:35 +0000 (09:32 +0000)]
[TSan][Clang][MIPS] Enabled thread option for MIPS64 platform

Reviewers: kcc, samsonov, petarj, eugenis

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

llvm-svn: 230209

9 years agoUse compiler provided endianness definitions if available.
Ed Schouten [Mon, 23 Feb 2015 09:27:49 +0000 (09:27 +0000)]
Use compiler provided endianness definitions if available.

This makes int_endianness.h work on operating systems for which we
haven't written explicit constructs, as long as GCC or Clang are being
used.

llvm-svn: 230208

9 years agoAdd C11 *_DECIMAL_DIG.
Ed Schouten [Mon, 23 Feb 2015 09:12:31 +0000 (09:12 +0000)]
Add C11 *_DECIMAL_DIG.

Before C11 there was only the DECIMAL_DIG definition. As of C11, we now
have one definition per floating point type (e.g. DBL_DECIMAL_DIG).
Change the existing code to define the new versions. To remain backward
compatible, define __DECIMAL_DIG__ as __LDBL_DECIMAL_DIG__.

Also update the tests. It seems that some of the existing test vectors
were incorrect. Change all tests for __DECIMAL_DIG__ to expect
__LDBL_DECIMAL_DIG__. Add tests for *_DECIMAL_DIG for FreeBSD/amd64, as
I happen to have such a system laying around. I've validated that the
values are in sync with <float.h>.

llvm-svn: 230207

9 years agoAsmParser: Check ConstantExpr insertvalue operands for type correctness
David Majnemer [Mon, 23 Feb 2015 07:13:52 +0000 (07:13 +0000)]
AsmParser: Check ConstantExpr insertvalue operands for type correctness

llvm-svn: 230206

9 years ago[llvm-pdbdump] Fix builders again.
Zachary Turner [Mon, 23 Feb 2015 06:13:27 +0000 (06:13 +0000)]
[llvm-pdbdump] Fix builders again.

llvm-svn: 230205

9 years ago[llvm-pdbdump] Very minor code cleanup.
Zachary Turner [Mon, 23 Feb 2015 05:59:14 +0000 (05:59 +0000)]
[llvm-pdbdump] Very minor code cleanup.

This just removes some dead enums as well as some debug flushes
of stdout.

llvm-svn: 230204

9 years ago[llvm-pdbdump] Add an option to dump full class definitions.
Zachary Turner [Mon, 23 Feb 2015 05:58:34 +0000 (05:58 +0000)]
[llvm-pdbdump] Add an option to dump full class definitions.

This adds the --class-definitions flag.  If specified, when dumping
types, instead of "class Foo" you will see the full class definition,
with member functions, constructors, access specifiers.

NOTE: Using this option can be very slow, as generating a full class
definition requires accessing many different parts of the PDB.

llvm-svn: 230203

9 years ago[Orc][Kaleidoscope] Tidy up the lazy_irgen tutorial, touch up a couple of
Lang Hames [Mon, 23 Feb 2015 04:45:05 +0000 (04:45 +0000)]
[Orc][Kaleidoscope] Tidy up the lazy_irgen tutorial, touch up a couple of
comments in the fully_lazy tutorial to minimize the diff between the two.

llvm-svn: 230202

9 years ago[Orc][Kaleidoscope] Remove dead AST map in SessionContext.
Lang Hames [Mon, 23 Feb 2015 04:34:43 +0000 (04:34 +0000)]
[Orc][Kaleidoscope] Remove dead AST map in SessionContext.

llvm-svn: 230201

9 years agoTry to fix reST markup for an external link.
Nico Weber [Mon, 23 Feb 2015 03:31:29 +0000 (03:31 +0000)]
Try to fix reST markup for an external link.

llvm-svn: 230200

9 years agoRemove comment addressed by d0k in r229327.
Nico Weber [Mon, 23 Feb 2015 02:23:19 +0000 (02:23 +0000)]
Remove comment addressed by d0k in r229327.

llvm-svn: 230199

9 years agoFixed script name in the clang-tidy documentation.
Alexander Kornienko [Mon, 23 Feb 2015 01:12:41 +0000 (01:12 +0000)]
Fixed script name in the clang-tidy documentation.

llvm-svn: 230198

9 years agoFix Makefile build
David Blaikie [Mon, 23 Feb 2015 00:53:35 +0000 (00:53 +0000)]
Fix Makefile build

llvm-svn: 230197

9 years ago[orc] Add a trivial unit test to get the ball rolling
David Blaikie [Mon, 23 Feb 2015 00:36:25 +0000 (00:36 +0000)]
[orc] Add a trivial unit test to get the ball rolling

I made my best guess at the Makefile, since I don't have a make build.

I'm not sure if it should be valid to add an empty list of things, but
it seemed the sort of degenerate case.

llvm-svn: 230196

9 years ago[ELF] Add section group/COMDAT support.
Shankar Easwaran [Mon, 23 Feb 2015 00:30:00 +0000 (00:30 +0000)]
[ELF] Add section group/COMDAT support.

SHF_GROUP: Group Member Sections
----------------------------------
A section which is part of a group, and is to be retained or discarded with the
group as a whole, is identified by a new section header attribute: SHF_GROUP
This section is a member (perhaps the only one) of a group of sections, and the
linker should retain or discard all or none of the members. This section must be
referenced in a SHT_GROUP section. This attribute flag may be set in any section
header, and no other modification or indication is made in the grouped sections.
All additional information is contained in the associated SHT_GROUP section.

SHT_GROUP: Section Group Definition
-------------------------------------
Represents a group section.

The section group's sh_link field identifies a symbol table section, and its
sh_info field the index of a symbol in that section. The name of that symbol is
treated as the identifier of the section group.

More information: https://mentorembedded.github.io/cxx-abi/abi/prop-72-comdat.html

Added a lot of extensive tests, that tests functionality.

llvm-svn: 230195

9 years ago[ELF] Add .gnu.linkonce support.
Shankar Easwaran [Mon, 23 Feb 2015 00:04:49 +0000 (00:04 +0000)]
[ELF] Add .gnu.linkonce support.

When the GNU linker sees two input sections with the same name, and the name
starts with ".gnu.linkonce.", the linker will only keep one copy and discard the
other. Any section whose name starts with “.gnu.linkonce.” is a COMDAT section.

Some architectures like Hexagon use this section to store floating point constants,
that need be deduped.

This patch adds gnu.linkonce functionality to the ELFReader.

llvm-svn: 230194

9 years agoAsmParser: Call instructions can't have an alignment
David Majnemer [Mon, 23 Feb 2015 00:01:32 +0000 (00:01 +0000)]
AsmParser: Call instructions can't have an alignment

llvm-svn: 230193

9 years ago[Core,MachO,Test] Remove trailing whitespace.
Shankar Easwaran [Sun, 22 Feb 2015 23:54:38 +0000 (23:54 +0000)]
[Core,MachO,Test] Remove trailing whitespace.

llvm-svn: 230192

9 years ago[ELF] Add symbol to ELFReference.
Shankar Easwaran [Sun, 22 Feb 2015 23:46:21 +0000 (23:46 +0000)]
[ELF] Add symbol to ELFReference.

Relocation handling need more information about the Symbol that we are creating
references for.

No change in functionality.

llvm-svn: 230191

9 years ago[Core] Fix handling of Section Groups.
Shankar Easwaran [Sun, 22 Feb 2015 23:40:58 +0000 (23:40 +0000)]
[Core] Fix handling of Section Groups.

There is code(added by me) in the YAMLReader which isn't correct when it handles references
for section groups. The test case was also checking for wrong outputs.

This fixes the bug and the testcase so that they check for proper outputs.

llvm-svn: 230190

9 years ago[ELF][X86_64] R_X86_64_16 relocation support
Shankar Easwaran [Sun, 22 Feb 2015 23:32:34 +0000 (23:32 +0000)]
[ELF][X86_64] R_X86_64_16 relocation support

llvm-svn: 230189

9 years agoAsmParser: Check ConstantExpr GEP operands for validity
David Majnemer [Sun, 22 Feb 2015 23:14:52 +0000 (23:14 +0000)]
AsmParser: Check ConstantExpr GEP operands for validity

llvm-svn: 230188

9 years agollvm-pdbdump: Fix gcc/clang build
David Majnemer [Sun, 22 Feb 2015 22:33:57 +0000 (22:33 +0000)]
llvm-pdbdump: Fix gcc/clang build

llvm-svn: 230187

9 years ago[llvm-pdbdump] Fix a few compilation failures.
Zachary Turner [Sun, 22 Feb 2015 22:20:26 +0000 (22:20 +0000)]
[llvm-pdbdump] Fix a few compilation failures.

llvm-svn: 230186

9 years agoAdd missing header
David Blaikie [Sun, 22 Feb 2015 22:18:55 +0000 (22:18 +0000)]
Add missing header

llvm-svn: 230185

9 years ago[llvm-pdbdump] Rewrite dumper using visitor pattern.
Zachary Turner [Sun, 22 Feb 2015 22:03:38 +0000 (22:03 +0000)]
[llvm-pdbdump] Rewrite dumper using visitor pattern.

This increases the flexibility of how to dump different
symbol types -- necessary for context-sensitive formatting of
symbol types -- and also improves the modularity by allowing
the dumping to be implemented in the actual dumper, as opposed
to in the PDB library.

llvm-svn: 230184

9 years agoUnix/BSD system calls are prefixed with SYS_ on FreeBSD and Mac
Ismail Pazarbasi [Sun, 22 Feb 2015 22:01:09 +0000 (22:01 +0000)]
Unix/BSD system calls are prefixed with SYS_ on FreeBSD and Mac

Also, __syscall form should be used when one or more of the
parameters is a 64-bit argument to ensure that argument alignment
is correct.

llvm-svn: 230183

9 years ago[llvm-pdbdump] Simplify options and output.
Zachary Turner [Sun, 22 Feb 2015 21:45:38 +0000 (21:45 +0000)]
[llvm-pdbdump] Simplify options and output.

This removes a wealth of options, and instead now only provides
three options.  -symbols, -types, and -compilands.  This greatly
simplifies use of the tool, and makes it easier to understand
what you're going to see when you run the tool.

llvm-svn: 230182

9 years agoRoll condition into an assert then wrap it 'ifndef NDEBUG' to protect from the inevit...
David Blaikie [Sun, 22 Feb 2015 20:58:38 +0000 (20:58 +0000)]
Roll condition into an assert then wrap it 'ifndef NDEBUG' to protect from the inevitable "unused variable" warning in a non-asserts build.

llvm-svn: 230181

9 years agoUse common parse routine to read alignment values from bitcode
JF Bastien [Sun, 22 Feb 2015 19:32:03 +0000 (19:32 +0000)]
Use common parse routine to read alignment values from bitcode

While fuzzing LLVM bitcode files, I discovered that (1) the bitcode reader doesn't check that alignments are no larger than 2**29; (2) downstream code doesn't check the range; and (3) for values out of range, corresponding large memory requests (based on alignment size) will fail. This code fixes the bitcode reader to check for valid alignments, fixing this problem.

This CL fixes alignment value on global variables, functions, and instructions: alloca, load, load atomic, store, store atomic.

Patch by Karl Schimpf (kschimpf@google.com).

llvm-svn: 230180

9 years agoRevert "[ASan] Make the argument of '__sanitizer_annotate_contiguous_container' is...
Renato Golin [Sun, 22 Feb 2015 18:58:18 +0000 (18:58 +0000)]
Revert "[ASan] Make the argument of '__sanitizer_annotate_contiguous_container' is not aligned error message easier to understand"

This reverts commit r230019, as it was breaking the ARM sanitizer buildbot
and let other errors be introduced since it wasn't fixed/reverted in
time.

llvm-svn: 230179

9 years ago[LICM] Refactor to expose functionality as utility functions
Hal Finkel [Sun, 22 Feb 2015 18:35:32 +0000 (18:35 +0000)]
[LICM] Refactor to expose functionality as utility functions

This refactors the core functionality of LICM: HoistRegion, SinkRegion and
PromoteAliasSet (renamed to promoteLoopAccessesToScalars) as utility functions
in LoopUtils. This will enable other transformations to make use of them
directly.

Patch by Ashutosh Nema.

llvm-svn: 230178

9 years ago[DagCombiner] Generalized BuildVector Vector Concatenation
Simon Pilgrim [Sun, 22 Feb 2015 18:17:28 +0000 (18:17 +0000)]
[DagCombiner] Generalized BuildVector Vector Concatenation

The CONCAT_VECTORS combiner pass can transform the concat of two BUILD_VECTOR nodes into a single BUILD_VECTOR node.

This patch generalises this to support any number of BUILD_VECTOR nodes, and also permits UNDEF nodes to be included as well.

This was noticed as AVX vec128 -> vec256 canonicalization sometimes creates a CONCAT_VECTOR with a real vec128 lower and an vec128 UNDEF upper.

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

llvm-svn: 230177

9 years ago[DAGCombine] Don't assume integer-type legailty in reduceBuildVecConvertToConvertBuildVec
Hal Finkel [Sun, 22 Feb 2015 16:10:22 +0000 (16:10 +0000)]
[DAGCombine] Don't assume integer-type legailty in reduceBuildVecConvertToConvertBuildVec

DAGCombine will rewrite an BUILD_VECTOR where all non-undef inputs some from
[US]INT_TO_FP, as a BUILD_VECTOR of integers with the conversion applied as a
vector operation. We check operation legality of the conversion, but fail to
check legality of the integer vector type itself. Because targets don't
normally override operation legality defaults for illegal types, we need to
check this also.

This came up in the context of the QPX vector entensions for PowerPC (which can
have legal floating-point vector types without corresponding legal integer
vector types). No in-tree test case for this yes, but one can be added once
the QPX support has been committed.

llvm-svn: 230176

9 years ago[SDAG] Use correct alignments on expanded vector trunc-store/ext-loads
Hal Finkel [Sun, 22 Feb 2015 15:58:04 +0000 (15:58 +0000)]
[SDAG] Use correct alignments on expanded vector trunc-store/ext-loads

When expanding a truncating store or extending load using vector extracts or
inserts and scalar stores and loads, we were giving each of these scalar stores
or loads the same alignment as the original vector operation. While this will
often be right (most vector operations, especially those produced by
autovectorization, have the alignment of the underlying scalar type), the
vector operation could certainly have a larger alignment.

No test case (yet); noticed by inspection.

llvm-svn: 230175

9 years agoRevert r230171 "TSan runtime: unbreak the build with ccache"
Dmitri Gribenko [Sun, 22 Feb 2015 12:20:05 +0000 (12:20 +0000)]
Revert r230171 "TSan runtime: unbreak the build with ccache"

It broke a buildbot with a non-clang (?) compiler.

llvm-svn: 230174

9 years agoWhitespace fix for r230172.
Kuba Brecka [Sun, 22 Feb 2015 11:49:21 +0000 (11:49 +0000)]
Whitespace fix for r230172.

llvm-svn: 230173

9 years agoFix gc-test.cc to work under higher -O levels
Kuba Brecka [Sun, 22 Feb 2015 11:12:17 +0000 (11:12 +0000)]
Fix gc-test.cc to work under higher -O levels

The gc-test.cc tries underflows of a variable up to -32 bytes, but on i386, the left redzone is not 32 bytes, it’s only 16 bytes and therefore the access to var[-32] is completely off. The reason why this test didn’t fail before is that we’ve been lucky and there was another variable before the var array, which was also instrumented. This fix uses “-32” for 64-bit systems and “-16” for 32-bit.

Reviewed at http://reviews.llvm.org/D7809

llvm-svn: 230172

9 years agoTSan runtime: unbreak the build with ccache
Dmitri Gribenko [Sun, 22 Feb 2015 11:04:59 +0000 (11:04 +0000)]
TSan runtime: unbreak the build with ccache

llvm-svn: 230171

9 years agoFix a warning on HexagonMCCodeEmitter::MCII. [-Wunused-private-field]
NAKAMURA Takumi [Sun, 22 Feb 2015 09:58:29 +0000 (09:58 +0000)]
Fix a warning on HexagonMCCodeEmitter::MCII. [-Wunused-private-field]

llvm-svn: 230170

9 years agoRewriteStatepointsForGC.cpp: Fix for -Asserts to mark isNullConstant() as LLVM_ATTRIB...
NAKAMURA Takumi [Sun, 22 Feb 2015 09:58:19 +0000 (09:58 +0000)]
RewriteStatepointsForGC.cpp: Fix for -Asserts to mark isNullConstant() as LLVM_ATTRIBUTE_UNUSED. [-Wunused-function]

llvm-svn: 230169

9 years agoRewriteStatepointsForGC.cpp: Fix for -Asserts. [-Wunused-variable]
NAKAMURA Takumi [Sun, 22 Feb 2015 09:58:13 +0000 (09:58 +0000)]
RewriteStatepointsForGC.cpp: Fix for -Asserts. [-Wunused-variable]

llvm-svn: 230168

9 years agoLowerBitSets.cpp: Prune incorrect \param(s). [-Wdocumentation]
NAKAMURA Takumi [Sun, 22 Feb 2015 09:51:42 +0000 (09:51 +0000)]
LowerBitSets.cpp: Prune incorrect \param(s). [-Wdocumentation]

\param should be used as itemized.

llvm-svn: 230167

9 years agoSwitch to use override, fixes -Winconsistent-missing-override on LLD.
Chandler Carruth [Sun, 22 Feb 2015 08:34:47 +0000 (08:34 +0000)]
Switch to use override, fixes -Winconsistent-missing-override on LLD.

llvm-svn: 230166

9 years ago[X86] Add some missing redundant MMX and SSE encodings for disassembler.
Craig Topper [Sun, 22 Feb 2015 07:50:41 +0000 (07:50 +0000)]
[X86] Add some missing redundant MMX and SSE encodings for disassembler.

llvm-svn: 230165

9 years agoRemove log statements from config scripts.
Zachary Turner [Sun, 22 Feb 2015 07:31:42 +0000 (07:31 +0000)]
Remove log statements from config scripts.

The bots seem to be happy now.

llvm-svn: 230164

9 years agoReally fix the build this time.
Zachary Turner [Sun, 22 Feb 2015 07:13:52 +0000 (07:13 +0000)]
Really fix the build this time.

I was setting the python variable to "@HAVE_DIA_SDK@", which will
always be a string, and will always evaluate to True.

llvm-svn: 230163

9 years agoAttempt to fix the builders.
Zachary Turner [Sun, 22 Feb 2015 07:01:41 +0000 (07:01 +0000)]
Attempt to fix the builders.

The issue was that the test Makefile had not been updated to
provide a value for HAVE_DIA_SDK, so it was being initialized
incorrectly.  Hopefully this brings everything back to green.

llvm-svn: 230162

9 years ago[llvm-pdbdump] Resubmit "Add some tests for llvm-pdbdump".
Zachary Turner [Sun, 22 Feb 2015 06:47:32 +0000 (06:47 +0000)]
[llvm-pdbdump] Resubmit "Add some tests for llvm-pdbdump".

NOTE: This patch intentionally breaks the build.  It attempts
to resubmit r230083, but with some debug logging in the CMake
and lit config files to determine why certain bots do not
correctly disable the DIA tests when DIA is not available.

After a sufficient number of bots fail, this patch will either
be reverted or, if the cause of the failure becomes obvious,
a fix submitted with the log statements removed.

llvm-svn: 230161

9 years agoRelax the requirement on sized deallocation a bit: Default on unsized delete if sized...
Larisse Voufo [Sun, 22 Feb 2015 06:36:53 +0000 (06:36 +0000)]
Relax the requirement on sized deallocation a bit: Default on unsized delete if sized delete is not provided in global scope, and -fdefine-sized-deallocation option is disabled.

llvm-svn: 230160

9 years agoFix typo.
Larisse Voufo [Sun, 22 Feb 2015 06:36:49 +0000 (06:36 +0000)]
Fix typo.

llvm-svn: 230159

9 years agoMove -fdefine-sized-deallocation and -fno-sized-deallocation options from driver...
Larisse Voufo [Sun, 22 Feb 2015 06:36:46 +0000 (06:36 +0000)]
Move -fdefine-sized-deallocation and -fno-sized-deallocation options from driver into CC1 for now.

llvm-svn: 230158

9 years ago[ELF] Teach GNU Driver about --stats.
Davide Italiano [Sun, 22 Feb 2015 03:12:21 +0000 (03:12 +0000)]
[ELF] Teach GNU Driver about --stats.

This is mainly for back-compatibility with GNU ld.
Ideally --stats should be a general option in LinkingContext, providing
individual stats for every pass in the linking process.
In the GNU driver, a better wording could be used, but there's no need
to change it for now.

Differential Revision: D7657
Reviewed by: ruiu

llvm-svn: 230157

9 years agoCOFF: Add 'IMAGE_SCN_CNT_INITIALIZED_DATA' to all DWARF sections
David Majnemer [Sun, 22 Feb 2015 02:35:27 +0000 (02:35 +0000)]
COFF: Add 'IMAGE_SCN_CNT_INITIALIZED_DATA' to all DWARF sections

The CodeView debug info section, .debug$S, also has this set.  MinGW
sets this bit for their DWARF sections as well.

llvm-svn: 230156

9 years agoCOFF: Consistently format the DWARF sections
David Majnemer [Sun, 22 Feb 2015 02:35:22 +0000 (02:35 +0000)]
COFF: Consistently format the DWARF sections

llvm-svn: 230155