Commit Graph

154695 Commits

Author SHA1 Message Date
Jonas Devlieghere
45b741c841 [dwarfdump] Add verbose output for .debug-line section
This patch adds dumping of line table instructions as well as the final
state at each specified pc value in verbose mode. This is essentially
the same as the default in Darwin's dwarfdump. Dumping the actual line
table opcodes can be particularly useful for something like debugging a
bad `.debug_line` section.

Differential revision: https://reviews.llvm.org/D37971

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313910 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 20:15:30 +00:00
Craig Topper
5586629f29 [DAGCombiner] Slightly simplify some code by using APInt::isMask() and countTrailingOnes instead of getting active bits and checking if all the bits below that make a mask.
At least for the 64-bit and less case, we should be able to determine if we even have a mask without counting any bits. This also removes the need to explicitly check for 0 active bits, isMask will return false for 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313908 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 20:12:19 +00:00
Reid Kleckner
0e1ce27157 Re-land r313825: "[IR] Add llvm.dbg.addr, a control-dependent version of llvm.dbg.declare"
The fix is to avoid invalidating our insertion point in
replaceDbgDeclare:
     Builder.insertDeclare(NewAddress, DIVar, DIExpr, Loc, InsertBefore);
+    if (DII == InsertBefore)
+      InsertBefore = &*std::next(InsertBefore->getIterator());
     DII->eraseFromParent();

I had to write a unit tests for this instead of a lit test because the
use list order matters in order to trigger the bug.

The reduced C test case for this was:
  void useit(int*);
  static inline void inlineme() {
    int x[2];
    useit(x);
  }
  void f() {
    inlineme();
    inlineme();
  }

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313905 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 19:52:03 +00:00
Bjorn Pettersson
1efe4ef310 [SelectionDAG] Pick correct frame index in LowerArguments
Summary:
SelectionDAGISel::LowerArguments is associating arguments
with frame indices (FuncInfo->setArgumentFrameIndex). That
information is later on used by EmitFuncArgumentDbgValue to
create DBG_VALUE instructions that denotes that a variable
can be found on the stack.

I discovered that for our (big endian) out-of-tree target
the association created by SelectionDAGISel::LowerArguments
sometimes is wrong. I've seen this happen when a 64-bit value
is passed on the stack. The argument will occupy two stack
slots (frame index X, and frame index X+1). The fault is
that a call to setArgumentFrameIndex is associating the
64-bit argument with frame index X+1. The effect is that the
debug information (DBG_VALUE) will point at the least significant
part of the arguement on the stack. When printing the
argument in a debugger I will get the wrong value.

I managed to create a test case for PowerPC that seems to
show the same kind of problem.

The bugfix will look at the datalayout, taking endianness into
account when examining a BUILD_PAIR node, assuming that the
least significant part is in the first operand of the BUILD_PAIR.
For big endian targets we should use the frame index from
the second operand, as the most significant part will be stored
at the lower address (using the highest frame index).

Reviewers: bogner, rnk, hfinkel, sdardis, aprantl

Reviewed By: aprantl

Subscribers: nemanjai, aprantl, llvm-commits, igorb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313901 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 18:52:08 +00:00
Adrian Prantl
67be5f5362 llvm-dwarfdump support --debug-frame=<offset> and --eh-frame=<offset>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313900 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 18:52:03 +00:00
Artem Belevich
c02a4f5a57 [NVPTX] Implemented bar.warp.sync, barrier.sync, and vote{.sync} instructions/intrinsics/builtins.
Differential Revision: https://reviews.llvm.org/D38148

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313898 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 18:44:49 +00:00
Rafael Espindola
84148478f0 Use ArrayRef. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313895 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 17:51:07 +00:00
Sanjay Patel
329d53a060 [x86] add more tests for node-level FMF; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313893 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 17:40:58 +00:00
Craig Topper
20a3d67d3a [DAGCombiner] Remove duplicate code from visitZERO_EXTEND
This exact block of code exists right below.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313891 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 17:30:02 +00:00
Zaara Syeda
dcafc63419 Fix buildbot failures, add mtriple to gpr-vsr-spill.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313890 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 17:05:47 +00:00
Zachary Turner
6b798196cb [lit] Don't norm case when inserting into the config map.
This makes all paths lowercase on Windows, which seemed like a
good idea at the time, but it means that tests can't properly
use FileCheck to match expected path names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313889 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 17:02:08 +00:00
Adrian Prantl
ab669421b2 llvm-dwarfdump: Add support for the --arch command line option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313888 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 16:26:18 +00:00
Zachary Turner
2462b0299b [lit] Add a test for the builtin config map.
Config map is not exposed through the command line, so testing this
is somewhat tricky.  But basically we need a test that if a custom
driver builds a config map and passes it to main, it gets respected.

A config map allows config files in the source tree to be mapped
to alternate config files in the build tree.  This particular test
works by having two config files in separate directories, and
setting up a config map to have that redirects A/lit.site.cfg
to B/altconfig.  Then, we print a message in A/lit.site.cfg
and B/altconfig and check that we do see the output from B
but don't see the output from A.  Additionally we test that
the test suite specified by A's config map is properly discovered.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313887 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 16:18:28 +00:00
Zaara Syeda
5185caa70d [Power9] Spill gprs to vector registers rather than stack
This patch updates register allocation to enable spilling gprs to
volatile vector registers rather than the stack. It can be enabled
 for Power9 with option -ppc-enable-gpr-to-vsr-spills.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313886 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 16:12:33 +00:00
Benjamin Kramer
3ef466f15f Add missing file from r313884.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313885 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 15:32:05 +00:00
Benjamin Kramer
93b713bb17 [DWARF] Shrink AttributeSpec from 24 to 16 bytes.
This is a bit ugly because we can't put Optional into a union. Hide all
of that behind a set of accessors and make accesses safer using asserts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 15:27:45 +00:00
Simon Pilgrim
4ea0368021 [X86][SSE] Add PSHUFLW/PSHUFHW tests inspired by PR34686
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313883 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 15:11:51 +00:00
Simon Atanasyan
cff5a9f329 [mips] Implement generation of relocations "chains" used by N32 ABI
In case of using a "nested" relocation expressions like this
`%hi(%neg(%gp_rel()))`, N32 ABI requires generation of three consecutive
relocations. That differs from the N64 ABI case where all relocations
are packed into the single relocation record.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313879 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 14:04:53 +00:00
Simon Atanasyan
fdc1645b20 [mips] Do not pass redundant IsN64 flag to MCELFObjectTargetWriter. NFC
Now we pass the 'Is64_' flag to the MCELFObjectTargetWriter ctor iif
when we make deal with N64 ABI. So it is redundant to pass additional
'IsN64' flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313878 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 14:04:47 +00:00
Jonas Paulsson
d4b6c99f73 [SystemZ] Improve optimizeCompareZero()
More conversions to load-and-test can be made with this patch by adding a
forward search in optimizeCompareZero().

Review: Ulrich Weigand
https://reviews.llvm.org/D38076

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313877 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 13:52:24 +00:00
Daniel Jasper
4b02ed37e6 Revert r313825: "[IR] Add llvm.dbg.addr, a control-dependent version of llvm.dbg.declare"
.. as well as the two subsequent changes r313826 and r313875.

This leads to segfaults in combination with ASAN. Will forward repro
instructions to the original author (rnk).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313876 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 12:07:33 +00:00
Mikael Holmen
4d4149da55 [SROA] Really remove associated dbg.declare when removing dead alloca
Summary:
There already was code that tried to remove the dbg.declare, but that code
was placed after we had called
 I->replaceAllUsesWith(UndefValue::get(I->getType()));
on the alloca, so when we searched for the relevant dbg.declare, we
couldn't find it.

Now we do the search before we call RAUW so there is a chance to find it.

An existing testcase needed update due to this. Two dbg.declare with undef
were removed and then suddenly one of the two CHECKS failed.

Before this patch we got

  call void @llvm.dbg.declare(metadata i24* undef, metadata !14, metadata !DIExpression(DW_OP_LLVM_fragment, 32, 24)), !dbg !15
  call void @llvm.dbg.declare(metadata %struct.prog_src_register* undef, metadata !14, metadata !DIExpression()), !dbg !15
  call void @llvm.dbg.value(metadata i32 0, metadata !14, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 32)), !dbg !15
  call void @llvm.dbg.value(metadata i32 0, metadata !14, metadata !DIExpression(DW_OP_LLVM_fragment, 32, 24)), !dbg !15

and with it we get

  call void @llvm.dbg.value(metadata i32 0, metadata !14, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 32)), !dbg !15
  call void @llvm.dbg.value(metadata i32 0, metadata !14, metadata !DIExpression(DW_OP_LLVM_fragment, 32, 24)), !dbg !15

However, the CHECKs in the testcase checked things in a silly order, so
they only passed since they found things in the first dbg.declare. Now
we changed the order of the checks and the test passes.

Reviewers: rnk

Reviewed By: rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313875 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 11:14:27 +00:00
Javed Absar
119c880fd8 [TableGen] Tidy up CodeGenRegisters
Replacing range loops.

Reviewed by: @MatzeB
Differential Revision: https://reviews.llvm.org/D38091



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313874 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 10:51:47 +00:00
Simon Atanasyan
0771400c1d [mips] Fix relocation record format and ELF header for N32 ABI
The N32 ABI uses RELA relocation format, do not use 3-in-1 relocation's
encoding, and uses ELFCLASS32. This change passes the `IsN32` flag
to the `MCAsmBackend` to distinguish usage of N32 ABI.

We still do not handle some cases like providing the `-target-abi=o32`
command line option with the `mips64` target triple. That's why
elf_header.s contains some "FIXME" strings. This case will be fixed in
a separate patch.

Differential revision: https://reviews.llvm.org/D37960

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313873 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 10:44:26 +00:00
Jonas Devlieghere
28b2d0c96f [dsymutil] Don't resolve DIE reference to NULL DIE.
This patch prevents dsymutil from resolving a reference to a NULL DIE
when a bogus reference happens to be coincidentally referencing a NULL
DIE. Now this is detected as an invalid reference and a warning is
printed.

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

Differential revision: https://reviews.llvm.org/D38078

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313872 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 10:28:33 +00:00
Strahinja Petrovic
e6b7c56b2e Fixed reverted commit rL312318
This patch contains fix for reverted commit
rL312318 which was causing failure due to use
of unchecked dyn_cast to CIInit.

Patch by: Nikola Prica.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313870 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 10:04:02 +00:00
Jatin Bhateja
5713c8d1d3 [X86] Adding a testpoint for fast-math flags propagation.
Reviewers: jbhateja

Reviewed By: jbhateja

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313869 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 09:53:21 +00:00
George Rimar
00cc3caa4d [yaml2obj] - Don't crash on one more invalid document.
This fixes one more crash I faced.
Testcase contains minimal reduced case.

Differential revision: https://reviews.llvm.org/D38082

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313868 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 08:25:59 +00:00
Matt Arsenault
ae3e3c01b9 AMDGPU: Add option to stress calls
This inverts the behavior of the AlwaysInline pass to mark
every function not already marked alwaysinline as noinline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 07:00:48 +00:00
Craig Topper
aa4af887e4 [X86] Remove execute permissions from a couple files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 04:55:08 +00:00
Craig Topper
badaff3d21 [X86] Remove windows line endings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313862 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 04:55:07 +00:00
Craig Topper
e3c2c6a240 [X86] Remove unused tablegen class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313861 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 04:55:06 +00:00
Craig Topper
a6dd78b474 [TableGen] Use CHAR_BIT instead of hardcoded 8 with sizeof. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313860 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 04:55:04 +00:00
Craig Topper
c0faa7c21a [TableGen] Include StringMap.h instead of StringSet.h since that's the data structure we use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 04:55:03 +00:00
Craig Topper
ba3a480f3c Revert r313782 "[TableGen] Add a DenseMapInfo for MachineValueType."
We aren't making a DenseSet/DenseMap of MVT anywhere. This was added due to an earlier revision of D37957.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313858 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 04:54:59 +00:00
Serguei Katkov
9a13f3e9b8 Revert "Re-enable "[IRCE] Identify loops with latch comparison against current IV value""
Revert the patch causing the functional failures.
The patch owner is notified with test cases which fail.
Test case has been provided to Maxim offline.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313857 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 04:50:41 +00:00
David L. Jones
07f3fba316 [lit/Win] Check if a path was found before attempting to use it.
Summary:
This appears to break some bots, when getToolsPath fails to find some or
all of the tools (for example, an incomplete GnuWin32 installation).

Reviewers: zturner, modocache

Subscribers: sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 01:26:16 +00:00
Vedant Kumar
3d39fc2624 [llvm-cov] Improve error messaging for function mismatches
Passing "-dump" to llvm-cov will now print more detailed information
about function hash and counter mismatches. This should make it easier
to debug *.profdata files which contain incorrect records, and to debug
other scenarios where coverage goes missing due to mismatch issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313853 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 01:11:30 +00:00
Matt Arsenault
ec61af4bcc AMDGPU: Fix crash on immediate operand
We can have a v_mac with an immediate src0.
We can still fold if it's an inline immediate,
otherwise it already uses the constant bus.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313852 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 00:45:59 +00:00
Zachary Turner
1e4a125226 [lit] Make lit support config files with .py extension.
Many editors and Python-related diagnostics tools such as
debuggers break or fail in mysterious ways when python files
don't end in .py.  This is especially true on Windows, but
still exists on other platforms.  I don't want to be too heavy
handed in changing everything across the board, but I do want
to at least *allow* lit configs to have .py extensions.  This
patch makes the discovery process first look for a config file
with a .py extension, and if one is not found, then looks for
a config file using the old method.  So for existing users, there
should be no functional change.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313849 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 00:24:52 +00:00
Craig Topper
8d6f84c7d5 [X86] Replace a condition that can never be true with an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313848 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 00:18:48 +00:00
Craig Topper
1997c335b9 [SelectionDAG] Replace a flag that can never be true with an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313847 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 00:18:46 +00:00
Craig Topper
c712ae8c95 [InstCombine] Teach getDemandedBitsLHSMask to handle constant splat vectors
This replaces a ConstantInt dyn_cast with m_APInt

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313840 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 23:48:58 +00:00
Craig Topper
cecbc1792c [SelectionDAG] Use APInt::getActivebits instead of Bitwidth - leading zeros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313839 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 23:48:56 +00:00
Sam Clegg
3703970fb5 [WebAssembly] Weak symbols should be defined in SF_Global
Summary:
This manifested itself in lld since it meant that weak
symbols were not appearing in archive symbol tables.

Subscribers: jfb, dschuff, jgravelle-google, aheejin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313838 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 23:39:44 +00:00
Adrian Prantl
7176debc9c typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313837 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 23:29:47 +00:00
Adrian Prantl
ff00c9c5ca llvm-dwarfdump: move -eh-frame into the right section in the help output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313836 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 23:29:31 +00:00
Marek Sokolowski
166760504d [llvm-readobj] Fix 'Teach readobj to dump .res files', pt 3.
Fix (r313790) missing ulittle{}_t error on some buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313834 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 23:26:05 +00:00
Marek Sokolowski
bf41ef78ca [llvm-readobj] Fix 'Teach readobj to dump .res files', pt 2.
Another fix-up for r313790. Big-endian hosts swapped byte order in
UTF16 words.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313833 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 23:07:39 +00:00
Matt Morehouse
b01b302b3b [MSan] Disable sanitization for __sanitizer_dtor_callback.
Summary:
Eliminate unnecessary instrumentation at __sanitizer_dtor_callback
call sites.  Fixes https://github.com/google/sanitizers/issues/861.

Reviewers: eugenis, kcc

Reviewed By: eugenis

Subscribers: vitalybuka, llvm-commits, cfe-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313831 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 22:53:08 +00:00