Commit Graph

141925 Commits

Author SHA1 Message Date
Simon Pilgrim
9767640329 Wdocumentation fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289037 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 10:31:32 +00:00
Oliver Stannard
c7bb88e832 Add a comment consumer mechanism to MCAsmLexer
This allows clients to register an AsmCommentConsumer with the MCAsmLexer,
which receives a callback each time a comment is parsed.

Differential Revision: https://reviews.llvm.org/D27511



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289036 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 10:31:21 +00:00
Simon Pilgrim
4f38f405fc [X86][SSE] Add vector test for (shl (or x, c1), c2) -> (or (shl x, c2), c1 << c2) detailed in D19325
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289035 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 10:17:25 +00:00
Dylan McKay
119507f5af [AVR] Add MIR tests for a few pseudo instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289031 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 08:54:41 +00:00
Dylan McKay
d9bd6dd333 [AVR] Add an assertion to ensure we don't emit LPM when it's unsupported
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289030 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 08:34:13 +00:00
Peter Collingbourne
8bb25c4bc6 LTO: Hash the parts of the LTO configuration that affect code generation.
Most importantly, we need to hash the relocation model, otherwise we can
end up trying to link non-PIC object files into PIEs or DSOs.

Differential Revision: https://reviews.llvm.org/D27556

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289024 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 05:28:30 +00:00
Greg Clayton
8d15f863bd Unbreak buildbots where the debug info test was crashing due to unchecked error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 02:11:03 +00:00
Keno Fischer
3f98c183ca Revert "[CodeGen] Fix invalid DWARF info on Win64"
Appears to break on build bots. Reverting pending investigation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289014 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 01:56:23 +00:00
Keno Fischer
94c20c0a62 [CodeGen] Fix invalid DWARF info on Win64
The relocations for `DIEEntry::EmitValue` were wrong for Win64
(emitting FK_Data_4 instead of FK_SecRel_4). This corrects that
oversight so that the DWARF data is correct in Win64 COFF files.

Fixes PR15393.

Patch by Jameson Nash <jameson@juliacomputing.com> based on a patch
by David Majnemer.

Differential Revision: https://reviews.llvm.org/D21731

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289013 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 01:40:21 +00:00
Greg Clayton
777b5c3c69 Make a DWARF generator so we can unit test DWARF APIs with gtest.
The only tests we have for the DWARF parser are the tests that use llvm-dwarfdump and expect output from textual dumps.

More DWARF parser modification are coming in the next few weeks and I wanted to add tests that can verify that we can encode and decode all form types, as well as test some other basic DWARF APIs where we ask DIE objects for their children and siblings.

DwarfGenerator.cpp was added in the lib/CodeGen directory. This file contains the code necessary to easily create DWARF for tests:

dwarfgen::Generator DG;
Triple Triple("x86_64--");
bool success = DG.init(Triple, Version);
if (!success)
  return;
dwarfgen::CompileUnit &CU = DG.addCompileUnit();
dwarfgen::DIE CUDie = CU.getUnitDIE();

CUDie.addAttribute(DW_AT_name, DW_FORM_strp, "/tmp/main.c");
CUDie.addAttribute(DW_AT_language, DW_FORM_data2, DW_LANG_C);

dwarfgen::DIE SubprogramDie = CUDie.addChild(DW_TAG_subprogram);
SubprogramDie.addAttribute(DW_AT_name, DW_FORM_strp, "main");
SubprogramDie.addAttribute(DW_AT_low_pc, DW_FORM_addr, 0x1000U);
SubprogramDie.addAttribute(DW_AT_high_pc, DW_FORM_addr, 0x2000U);

dwarfgen::DIE IntDie = CUDie.addChild(DW_TAG_base_type);
IntDie.addAttribute(DW_AT_name, DW_FORM_strp, "int");
IntDie.addAttribute(DW_AT_encoding, DW_FORM_data1, DW_ATE_signed);
IntDie.addAttribute(DW_AT_byte_size, DW_FORM_data1, 4);

dwarfgen::DIE ArgcDie = SubprogramDie.addChild(DW_TAG_formal_parameter);
ArgcDie.addAttribute(DW_AT_name, DW_FORM_strp, "argc");
// ArgcDie.addAttribute(DW_AT_type, DW_FORM_ref4, IntDie);
ArgcDie.addAttribute(DW_AT_type, DW_FORM_ref_addr, IntDie);

StringRef FileBytes = DG.generate();
MemoryBufferRef FileBuffer(FileBytes, "dwarf");
auto Obj = object::ObjectFile::createObjectFile(FileBuffer);
EXPECT_TRUE((bool)Obj);
DWARFContextInMemory DwarfContext(*Obj.get());
This code is backed by the AsmPrinter code that emits DWARF for the actual compiler.

While adding unit tests it was discovered that DIEValue that used DIEEntry as their values had bugs where DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref8, and DW_FORM_ref_udata forms were not supported. These are all now supported. Added support for DW_FORM_string so we can emit inlined C strings.

Centralized the code to unique abbreviations into a new DIEAbbrevSet class and made both the dwarfgen::Generator and the llvm::DwarfFile classes use the new class.

Fixed comments in the llvm::DIE class so that the Offset is known to be the compile/type unit offset.

DIEInteger now supports more DW_FORM values.

There are also unit tests that cover:

Encoding and decoding all form types and values
Encoding and decoding all reference types (DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref8, DW_FORM_ref_udata, DW_FORM_ref_addr) including cross compile unit references with that go forward one compile unit and backward on compile unit.

Differential Revision: https://reviews.llvm.org/D27326


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289010 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 01:03:48 +00:00
Evgeniy Stepanov
d7bfb58bc1 CFI-icall on Thumb
Replace @progbits in the section directive with %progbits, because "@" starts a comment on arm/thumb.
Use b.w branch instruction.
Use .thumb_function and .thumb_set for proper arm/thumb interwork. This way jumptable entry addresses on thumb have bit 0 set (correctly). This does not affect CFI check math, because the address of the jumptable start also has that bit set.

This does not work on thumbv5, because it does not support b.w, and the linker would not insert a veneer (trampoline?) to extend the range of b.n. We may need to do full-range plt-style jumptables on thumbv54, which are 12 bytes per entry. Another option is "push lr; bl; pop pc" (4 bytes) but that needs unwinding instructions, etc.

Differential Revision: https://reviews.llvm.org/D27499

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289008 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 00:32:26 +00:00
Peter Collingbourne
43b343e844 LTO: Remove the unused Config::Features field.
We are currently initializing Features via MAttrs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 00:27:37 +00:00
Matthias Braun
94e65047a3 The few days mentioned in r267095 are over
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289004 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 00:16:42 +00:00
Matthias Braun
bcfa1f7a75 TargetPassConfig: Rename DisablePostRA -> DisablePostRASched; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289003 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 00:16:08 +00:00
Matthias Braun
f3e629e3ec LivePhysReg: Use reference instead of pointer in init(); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289002 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 00:15:51 +00:00
Quentin Colombet
aff0caeac1 [InlineSpiller] Don't call TargetInstrInfo::foldMemoryOperand with an empty list.
Since r287792 if we try to do that we will hit an assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289001 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 00:06:51 +00:00
Filipe Cabecinhas
8302e1c946 [asan] Split load and store checks in test. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288991 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 22:37:11 +00:00
Chris Bieneman
581f04c40e [yaml2obj] Refactor and abstract yaml2dwarf functions
This abstracts the code for emitting DWARF binary from the DWARFYAML types into reusable interfaces that could be used by ELF and COFF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288990 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 22:30:15 +00:00
Eugene Zelenko
553d8c8203 [ADT, IR] Fix some Clang-tidy modernize-use-equals-delete and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288989 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 22:06:02 +00:00
Davide Italiano
4e51983ffa [BDCE] Skip metadata while replacing uses.
The fix committed in r288851 doesn't cover all the cases.
In particular, if we have an instruction with side effects
which has a no non-dbg use not depending on the bits, we still
perform RAUW destroying the dbg.value's first argument.
Prevent metadata from being replaced here to avoid the issue.

Differential Revision:  https://reviews.llvm.org/D27534

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288987 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 21:47:32 +00:00
Chris Bieneman
1523505168 [obj2yaml] Refactor and abstract dwarf2yaml
This makes the dwarf2yaml code separated and reusable allowing ELF and COFF to share implementations with MachO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288986 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 21:47:28 +00:00
Tim Northover
4f7586098b GlobalISel: use correct builder for ConstantExprs.
ConstantExpr instances were emitting code into the current block rather than
the entry block. This meant they didn't necessarily dominate all uses, which is
clearly wrong.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288985 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 21:29:15 +00:00
Chris Bieneman
31adbb659a [ObjectYAML] Pull DWARF support into DWARFYAML namespace
Since DWARF formatting is agnostic to the object file it is stored in, it doesn't make sense for this to be in the MachOYAML implementation. Pulling it into its own namespace means we could modify the ELF and COFF YAML tools to emit DWARF as well.

In a follow-up patch I will better abstract this in obj2yaml and yaml2obj so that the DWARF bits in the tools can be re-used too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288984 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 21:26:32 +00:00
Tim Northover
66746a7ae1 GlobalISel: store the current MachineFunction as direct state. NFC.
Having to ask the MIRBuilder for the current function is a little awkward, and
I'm intending to improve how that's threaded through anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288983 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 21:17:47 +00:00
Chris Bieneman
c19200ceed [ObjectYAML] Rename DWARF entries to match section names
This change makes the yaml tags for the members of the DWARF data match the names of the DWARF sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288981 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 21:09:37 +00:00
Tim Northover
06bfcf3df9 GlobalISel: simplify MachineIRBuilder interface.
MachineIRBuilder had weird before/after and beginning/end flags for the insert
point. Unfortunately the non-default means that instructions will be inserted
in reverse order which is almost never what anyone wants.

Really, I think we just want (like IRBuilder has) the ability to insert at any
C++ iterator-style point (i.e. before any instruction or before MBB.end()). So
this fixes MIRBuilders to behave like IRBuilders in this respect.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288980 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 21:05:38 +00:00
Kostya Serebryany
152208fcde [libFuzzer] include FuzzerIO.h and hopefully fix the Mac build. reported by Dejan Mircevski
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288979 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 21:02:48 +00:00
Matt Arsenault
98b1edd6bb InstCombine: Fold bitcast of vector to FP scalar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288978 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 20:56:11 +00:00
Chris Bieneman
c14b21af97 [CMake] Add check for HAVE_CRASHREPORTER_INFO
This was also explicitly undef in CMake for some unknown reason.

Hopefully this one won't kill all the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288977 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 20:55:38 +00:00
Eli Friedman
b60c7b1f61 [GVNHoist] Invalidate MemDep when an instruction is moved.
See also r279907.

Fixes https://llvm.org/bugs/show_bug.cgi?id=30991 .

Differential Revision: https://reviews.llvm.org/D27493



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288968 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 19:55:59 +00:00
Michael Kuperstein
30fb413876 [X86] Skip over DEBUG_VALUE while looking for start of call sequence
If we don't skip over DEBUG_VALUEs, we get differences between -g and non-g
code.

This fixes PR31242.

Differential Revision: https://reviews.llvm.org/D27485


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288965 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 19:31:08 +00:00
Michael Kuperstein
3ffda498ec [X86] Do not assume "ri" instructions always have an immediate operand
The second operand of an "ri" instruction may be an immediate, but it may
also be a globalvariable, so we should make any assumptions.

This fixes PR31271.

Differential Revision: https://reviews.llvm.org/D27481


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288964 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 19:29:18 +00:00
Chris Bieneman
746d96524f Fix the apple build issue caused by r288956
Should be checking if HAVE_CRASHREPORTERCLIENT_H is defined not relying on it having a value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288963 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 19:28:22 +00:00
Chris Bieneman
1b5c4be5f4 Revert "[CMake] Use cmakedefine01 instead of cmakedefine"
This reverts commit r288959.

Apparently using cmakedefine01 explodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288961 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 19:25:38 +00:00
Chris Bieneman
5472e8e69f [CMake] Use cmakedefine01 instead of cmakedefine
Looks like we need a 01 value for HAVE_CRASHREPORTERCLIENT_H.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 19:13:32 +00:00
Sanjay Patel
8b90b13aa1 [InstCombine] add tests for smin+icmp; NFC
The tests that already work are folded in InstSimplify, so those
tests should be redundant and we can remove them if they don't
seem worthwhile for completeness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288957 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 18:56:55 +00:00
Chris Bieneman
b7e5e7db85 [CMake] Add a check for HAVE_CRASHREPORTERCLIENT_H
The CMake build has been hardcoding this to undef forever, we shouldn't have been doing that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288956 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 18:53:04 +00:00
Chris Bieneman
cf24fcb20a [ObjectYAML] Support for DWARF __debug_abbrev section
This patch adds support for round-tripping DWARF debug abbreviations through the obj<->yaml tools.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288955 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 18:52:59 +00:00
Simon Pilgrim
aee7c6e2f5 [SelectionDAG] Add knownbits support for vector demandedelts in SMAX/SMIN/UMAX/UMIN opcodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288926 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 17:54:00 +00:00
Simon Pilgrim
7b24dd44c8 [X86] Add knownbits vector UMAX test
In preparation for demandedelts support

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288920 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 17:21:13 +00:00
Simon Pilgrim
3b9d4a0970 [X86][SSE] Remove AND -> VZEXT combine
This is now performed more generally by the target shuffle combine code.

Already covered by tests that were originally added in D7666/rL229480 to support combineVectorZext (or VectorZextCombine as it was known then....).

Differential Revision: https://reviews.llvm.org/D27510

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 17:02:41 +00:00
Simon Pilgrim
def95b9c34 [SelectionDAG] Add knownbits support for EXTRACT_VECTOR_ELT opcodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 16:28:21 +00:00
Simon Pilgrim
9b37990fd7 [SelectionDAG] Removed old knownbits TODO comment. NFCI.
EXTRACT_VECTOR_ELT does support demanded elts if the element index is known and in range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 15:31:12 +00:00
Simon Pilgrim
b23f6fe812 [X86] Add test to show missed opportunities to calculate knownbits in INSERT_VECTOR_ELT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288912 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 15:27:18 +00:00
Simon Pilgrim
5ab68dcc0b [X86][SSE] Fix vpextrd/vpextrq checks
They were testing for the pre-vex versions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 15:10:05 +00:00
Simon Pilgrim
c57b7e50fc [X86][SSE] Force execution domain of 32-bit extractps/pextrd in the stack folding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288910 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 15:06:14 +00:00
Matthew Simpson
b6b20e1aa2 [LV] Scalarize operands of predicated instructions
This patch attempts to scalarize the operand expressions of predicated
instructions if they were conditionally executed in the original loop. After
scalarization, the expressions will be sunk inside the blocks created for the
predicated instructions. The transformation essentially performs
un-if-conversion on the operands.

The cost model has been updated to determine if scalarization is profitable. It
compares the cost of a vectorized instruction, assuming it will be
if-converted, to the cost of the scalarized instruction, assuming that the
instructions corresponding to each vector lane will be sunk inside a predicated
block, possibly avoiding execution. If it's more profitable to scalarize the
entire expression tree feeding the predicated instruction, the expression will
be scalarized; otherwise, it will be vectorized. We only consider the cost of
the entire expression to accurately estimate the cost of the required
insertelement and extractelement instructions.

Differential Revision: https://reviews.llvm.org/D26083

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288909 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 15:03:32 +00:00
Benjamin Kramer
1517e2ed72 Try unbreaking the MSVC build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 13:35:11 +00:00
Simon Pilgrim
03f619110f [X86][SSE] Regenerate test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288906 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 13:05:04 +00:00
Dylan McKay
038449d896 [AVR] Expand 'SELECT_CC' nodes whereever possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288905 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 12:34:47 +00:00