Commit Graph

194253 Commits

Author SHA1 Message Date
Shankar Easwaran 9e07346679 [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
2015-02-23 00:30:00 +00:00
Shankar Easwaran de4a31909f [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
2015-02-23 00:04:49 +00:00
David Majnemer 8d22abdd59 AsmParser: Call instructions can't have an alignment
llvm-svn: 230193
2015-02-23 00:01:32 +00:00
Shankar Easwaran a1d3637f3d [Core,MachO,Test] Remove trailing whitespace.
llvm-svn: 230192
2015-02-22 23:54:38 +00:00
Shankar Easwaran 784b56caac [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
2015-02-22 23:46:21 +00:00
Shankar Easwaran e44fc87cde [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
2015-02-22 23:40:58 +00:00
Shankar Easwaran 45b392d6cf [ELF][X86_64] R_X86_64_16 relocation support
llvm-svn: 230189
2015-02-22 23:32:34 +00:00
David Majnemer 00303b6861 AsmParser: Check ConstantExpr GEP operands for validity
llvm-svn: 230188
2015-02-22 23:14:52 +00:00
David Majnemer 3f45d40663 llvm-pdbdump: Fix gcc/clang build
llvm-svn: 230187
2015-02-22 22:33:57 +00:00
Zachary Turner aea59921ac [llvm-pdbdump] Fix a few compilation failures.
llvm-svn: 230186
2015-02-22 22:20:26 +00:00
David Blaikie 1c750818a0 Add missing header
llvm-svn: 230185
2015-02-22 22:18:55 +00:00
Zachary Turner 9a818ad193 [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
2015-02-22 22:03:38 +00:00
Ismail Pazarbasi 87f4c90a5c 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
2015-02-22 22:01:09 +00:00
Zachary Turner fc4ecedb75 [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
2015-02-22 21:45:38 +00:00
David Blaikie 5e5d7840fb 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
2015-02-22 20:58:38 +00:00
JF Bastien 30bf96bfe7 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
2015-02-22 19:32:03 +00:00
Renato Golin 4b1482e75c 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
2015-02-22 18:58:18 +00:00
Hal Finkel 3d4269ab05 [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
2015-02-22 18:35:32 +00:00
Simon Pilgrim 4e30d9b6d8 [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
2015-02-22 18:17:28 +00:00
Hal Finkel e2dd84e42f [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
2015-02-22 16:10:22 +00:00
Hal Finkel f5b957060b [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
2015-02-22 15:58:04 +00:00
Dmitri Gribenko 9cbc6f42aa Revert r230171 "TSan runtime: unbreak the build with ccache"
It broke a buildbot with a non-clang (?) compiler.

llvm-svn: 230174
2015-02-22 12:20:05 +00:00
Kuba Brecka 3280dc7081 Whitespace fix for r230172.
llvm-svn: 230173
2015-02-22 11:49:21 +00:00
Kuba Brecka 11bb33c78b 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
2015-02-22 11:12:17 +00:00
Dmitri Gribenko bc4c42c345 TSan runtime: unbreak the build with ccache
llvm-svn: 230171
2015-02-22 11:04:59 +00:00
NAKAMURA Takumi 3d61760bd6 Fix a warning on HexagonMCCodeEmitter::MCII. [-Wunused-private-field]
llvm-svn: 230170
2015-02-22 09:58:29 +00:00
NAKAMURA Takumi f7d08f6dcc RewriteStatepointsForGC.cpp: Fix for -Asserts to mark isNullConstant() as LLVM_ATTRIBUTE_UNUSED. [-Wunused-function]
llvm-svn: 230169
2015-02-22 09:58:19 +00:00
NAKAMURA Takumi 02aa295a00 RewriteStatepointsForGC.cpp: Fix for -Asserts. [-Wunused-variable]
llvm-svn: 230168
2015-02-22 09:58:13 +00:00
NAKAMURA Takumi 6c24684c95 LowerBitSets.cpp: Prune incorrect \param(s). [-Wdocumentation]
\param should be used as itemized.

llvm-svn: 230167
2015-02-22 09:51:42 +00:00
Chandler Carruth b9aa3a61c9 Switch to use override, fixes -Winconsistent-missing-override on LLD.
llvm-svn: 230166
2015-02-22 08:34:47 +00:00
Craig Topper 8659344d93 [X86] Add some missing redundant MMX and SSE encodings for disassembler.
llvm-svn: 230165
2015-02-22 07:50:41 +00:00
Zachary Turner 6b3b4e4086 Remove log statements from config scripts.
The bots seem to be happy now.

llvm-svn: 230164
2015-02-22 07:31:42 +00:00
Zachary Turner 3ddf94ef6b 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
2015-02-22 07:13:52 +00:00
Zachary Turner ba229eb5ef 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
2015-02-22 07:01:41 +00:00
Zachary Turner a54b7ddb25 [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
2015-02-22 06:47:32 +00:00
Larisse Voufo a65298af65 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
2015-02-22 06:36:53 +00:00
Larisse Voufo 01c97c0860 Fix typo.
llvm-svn: 230159
2015-02-22 06:36:49 +00:00
Larisse Voufo 0d0237f6cb Move -fdefine-sized-deallocation and -fno-sized-deallocation options from driver into CC1 for now.
llvm-svn: 230158
2015-02-22 06:36:46 +00:00
Davide Italiano 9483dc21be [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
2015-02-22 03:12:21 +00:00
David Majnemer 429fa1220d 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
2015-02-22 02:35:27 +00:00
David Majnemer 8c8b6d6b39 COFF: Consistently format the DWARF sections
llvm-svn: 230155
2015-02-22 02:35:22 +00:00
Lang Hames d1c2082c39 [Orc] Remove redundant using directive.
llvm-svn: 230154
2015-02-22 01:48:23 +00:00
Lang Hames 53ccf88893 [Orc] Add header comment to IndirectionUtils.cpp.
llvm-svn: 230153
2015-02-22 01:45:31 +00:00
Nico Weber 805747956b Remove two unused methods. No behavior change.
llvm-svn: 230152
2015-02-22 00:27:32 +00:00
Sanjoy Das 95c476db94 IRCE: generalize InductiveRangeCheck::computeSafeIterationSpace to
work with a non-canonical induction variable.

This is currently a non-functional change because we only ever call
computeSafeIterationSpace on a canonical induction variable; but the
generalization will be useful in a later commit.

llvm-svn: 230151
2015-02-21 22:20:22 +00:00
Sanjoy Das 7fc60da2f5 IRCE: use SCEVs instead of llvm::Value's for intermediate
calculations.  Semantically non-functional change.

This gets rid of some of the SCEV -> Value -> SCEV round tripping and
the Construct(SMin|SMax)Of and MaybeSimplify helper routines.

llvm-svn: 230150
2015-02-21 22:07:32 +00:00
Matt Arsenault f07833057c R600/SI: Use v_madmk_f32
llvm-svn: 230149
2015-02-21 21:29:10 +00:00
Matt Arsenault 0325d3d27f R600/SI: Try to use v_madak_f32
This is a code size optimization when the constant
only has one use.

llvm-svn: 230148
2015-02-21 21:29:07 +00:00
Matt Arsenault 657b1cb739 R600/SI: Don't crash when getting immediate operand size
llvm-svn: 230147
2015-02-21 21:29:04 +00:00
Matt Arsenault 70120fa813 R600/SI: Fix mad*k definitions
llvm-svn: 230146
2015-02-21 21:29:00 +00:00