Commit Graph

101594 Commits

Author SHA1 Message Date
Eric Christopher
7f22dc90ad Fix for coding style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204177 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 20:39:54 +00:00
Eric Christopher
994c303f24 Remove a bunch of unnecessary includes and forward declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204176 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 20:37:10 +00:00
Hans Wennborg
523f800e90 X86 memcpy lowering: use "rep movs" even when esi is used as base pointer
For functions where esi is used as base pointer, we would previously fall back
from lowering memcpy with "rep movs" because that clobbers esi.

With this patch, we just store esi in another physical register, and restore
it afterwards. This adds a little bit of register preassure, but the more
efficient memcpy should be worth it.

Differential Revision: http://llvm-reviews.chandlerc.com/D2968

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204174 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 20:04:34 +00:00
Rui Ueyama
172c31844b Use early returns to reduce nesting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204171 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 18:58:51 +00:00
Michael Zolotukhin
50e4d56b9f Fix test lsr-normalization.ll broken in r204161.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204166 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 18:17:59 +00:00
Raul E. Silvera
370981ad17 Add support for scalarizing/splitting vector bswap.
Summary:
  SLP Vectorization of intrinsics (r203707) has exposed cases where the
  expansion of vector bswap is failing (PR19151).

Reviewers: hfinkel

CC: chandlerc

Differential Revision: http://llvm-reviews.chandlerc.com/D3104

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204163 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 17:49:12 +00:00
Adrian Prantl
e1ea4faca1 Debug info: Remove OdrMemberMap from DwarfDebug, it's not necessary.
Follow-up to r203982.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204162 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 17:41:15 +00:00
Michael Zolotukhin
13ca05e2b8 Add stride normalization to SCEV Normalize/Denormalize transformation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204161 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 17:34:03 +00:00
Andrea Di Biagio
6077ca9abb [DAGCombiner] teach how to simplify xor/and/or nodes according to the following rules:
1)  (AND (shuf (A, C, Mask), shuf (B, C, Mask)) -> shuf (AND (A, B), C, Mask)
 2)  (OR  (shuf (A, C, Mask), shuf (B, C, Mask)) -> shuf (OR  (A, B), C, Mask)
 3)  (XOR (shuf (A, C, Mask), shuf (B, C, Mask)) -> shuf (XOR (A, B), V_0, Mask)

 4)  (AND (shuf (C, A, Mask), shuf (C, B, Mask)) -> shuf (C, AND (A, B), Mask)
 5)  (OR  (shuf (C, A, Mask), shuf (C, B, Mask)) -> shuf (C, OR  (A, B), Mask)
 6)  (XOR (shuf (C, A, Mask), shuf (C, B, Mask)) -> shuf (V_0, XOR (A, B), Mask)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204160 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 17:12:59 +00:00
Manuel Jacob
7e18b99f1e X86: Use enums for memory operand decoding instead of integer literals.
Summary:
X86BaseInfo.h defines an enum for the offset of each operand in a memory operand
sequence.  Some code uses it and some does not.  This patch replaces (hopefully)
all remaining locations where an integer literal was used instead of this enum.
No functionality change intended.

Reviewers: nadav

CC: llvm-commits, t.p.northover

Differential Revision: http://llvm-reviews.chandlerc.com/D3108

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204158 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 16:14:11 +00:00
Krzysztof Parzyszek
3da56299df Enable CFI on Hexagon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204157 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 16:02:37 +00:00
Bill Schmidt
d4585b941a Fix PR19144: Incorrect offset generated for int-to-fp conversion at -O0.
When converting a signed 32-bit integer to double-precision floating point on
hardware without a lfiwax instruction, we have to instead use a lfd followed
by fcfid.  We were erroneously offsetting the address by 4 bytes in
preparation for either a lfiwax or lfiwzx when generating the lfd.  This fixes
that silly error.

This was not caught in the test suite since the conversion tests were run with
-mcpu=pwr7, which implies availability of lfiwax.  I've added another test
case for older hardware that checks the code we expect in the absence of
lfiwax and other flavors of fcfid.  There are fewer tests in this test case
because we punt to DAG selection in more cases on older hardware.  (We must
generate complex fiddly sequences in those cases, and there is marginal
benefit in duplicating that logic in fast-isel.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204155 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 14:32:50 +00:00
Evgeniy Stepanov
610469f4c2 [msan] Origin tracking with history.
LLVM part of MSan implementation of advanced origin tracking,
when we record not only creation point, but all locations where
an uninitialized value was stored to memory, too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204151 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 13:30:56 +00:00
Diego Novillo
c605296342 Tolerate unmangled names in sample profiles.
Summary:
The compiler does not always generate linkage names. If a function
has been inlined and its body elided, its linkage name may not be
generated.

When the binary executes, the profiler will use its unmangled name
when attributing samples. This results in unmangled names in the
input profile.

We are currently failing hard when this happens. However, in this case
all that happens is that we fail to attribute samples to the inlined
function. While this means fewer optimization opportunities, it should
not cause a compilation failure.

This patch accepts all valid function names, regardless of whether
they were mangled or not.

Reviewers: chandlerc

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D3087

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204142 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 12:03:12 +00:00
Alexander Kornienko
8a99824c5a Revert r203962 and two revisions depending on it: r204028 and r204059.
The revision I'm reverting breaks handling of transitive aliases. This blocks us
and breaks sanitizer bootstrap:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/2651
(and checked locally by Alexey).

This revision is the result of:

  svn merge -r204059:204058 -r204028:204027 -r203962:203961 .

+ the regression test added to test/MC/ELF/alias.s

Another way to reproduce the regression with clang:
  $ cat q.c
  void a1();
  void a2() __attribute__((alias("a1")));
  void a3() __attribute__((alias("a2")));
  void a1() {}

  $ ~/work/llvm-build/bin/clang-3.5-good -c q.c && mv q.o good.o && \
      ~/work/llvm-build/bin/clang-3.5-bad -c q.c && mv q.o bad.o && \
      objdump -t good.o bad.o

    good.o:     file format elf64-x86-64

    SYMBOL TABLE:
    0000000000000000 l    df *ABS*  0000000000000000 q.c
    0000000000000000 l    d  .text  0000000000000000 .text
    0000000000000000 l    d  .data  0000000000000000 .data
    0000000000000000 l    d  .bss   0000000000000000 .bss
    0000000000000000 l    d  .comment       0000000000000000 .comment
    0000000000000000 l    d  .note.GNU-stack        0000000000000000 .note.GNU-stack
    0000000000000000 l    d  .eh_frame      0000000000000000 .eh_frame
    0000000000000000 g     F .text  0000000000000006 a1
    0000000000000000 g     F .text  0000000000000006 a2
    0000000000000000 g     F .text  0000000000000006 a3



    bad.o:     file format elf64-x86-64

    SYMBOL TABLE:
    0000000000000000 l    df *ABS*  0000000000000000 q.c
    0000000000000000 l    d  .text  0000000000000000 .text
    0000000000000000 l    d  .data  0000000000000000 .data
    0000000000000000 l    d  .bss   0000000000000000 .bss
    0000000000000000 l    d  .comment       0000000000000000 .comment
    0000000000000000 l    d  .note.GNU-stack        0000000000000000 .note.GNU-stack
    0000000000000000 l    d  .eh_frame      0000000000000000 .eh_frame
    0000000000000000 g     F .text  0000000000000006 a1
    0000000000000000 g     F .text  0000000000000006 a2
    0000000000000000 g       .text  0000000000000000 a3




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204137 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 10:36:11 +00:00
Renato Golin
f48cfddd26 Add IAS/EHABI changes to release notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204134 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 10:16:15 +00:00
NAKAMURA Takumi
99ffa5c0f4 DebugIRTests: Fixup for r204130.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204132 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 09:58:28 +00:00
Evgeniy Stepanov
f7a8108a6d [msan] Kill -msan-store-clean-origin flag.
Not only is it slower than the alternative, but also subtly broken.
This commit does not change the default behavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204131 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 09:47:06 +00:00
Alon Mishne
086494730d [C++11] Change DebugInfoFinder to use range-based loops
Also changes the iterators to return actual DI type over MDNode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204130 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 09:41:07 +00:00
Evgeniy Stepanov
fabbbc96ca [msan] Remove unused code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204125 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 08:29:42 +00:00
Craig Topper
a9d93e3c74 [C++11] Mark the target fast isel classes as 'final' so that the compiler can de-virtualize some of the internal calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204123 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 07:27:13 +00:00
Alexey Samsonov
5b645797db [C++11] Change the interface of getCOFF{Section,Relocation,Symbol} to make it work with range-based for loops.
Reviewers: ruiu

Reviewed By: ruiu

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D3097

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204120 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 06:53:02 +00:00
NAKAMURA Takumi
3bdef4b6dc CodeGen/R600/v_cndmask.ll: Relax an expression to unbreak msvcrt.
V_CNDMASK_B32_e64 v0, v0, -1.#QNAN0e+00, s[2:3], 0, 0, 0, 0

FIXME: We really need to implement our formatter...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204118 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 06:17:22 +00:00
NAKAMURA Takumi
27c2eb2026 DebugInfo/lto-comp-dir.ll: Tweak for dos path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204117 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 06:01:14 +00:00
Saleem Abdulrasool
96be4240bb ARM: add an assertion
Add an assertion that a valid section is referenced.  The potential NULL pointer
dereference was identified by the clang static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204114 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 05:26:55 +00:00
Adrian Prantl
ff5abbb4d3 DwarfDebug: Only unique retained types instead of all types.
This is a follow-up to r203983 based on feedback from dblaikie and mren (Thanks!)
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204107 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 02:35:03 +00:00
Adrian Prantl
5e8144df32 Switch the type field in DIVariable and DIGlobalVariable over to DITypeRefs.
This allows us to catch more opportunities for ODR-based type uniquing
during LTO.
Paired commit with CFE which updates some testcases to verify the new
DIBuilder behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204106 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 02:34:58 +00:00
Adrian Prantl
4d82ca7462 Replace unnecessary #include directive with forward declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204104 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 02:34:52 +00:00
Eric Christopher
635ed6dfe9 Add explanatory comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204103 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 02:18:27 +00:00
Eric Christopher
b005e96324 Shorten DotDebugLocEntry to just DebugLocEntry and reformat.
No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204102 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 02:18:24 +00:00
David Blaikie
c5b39af329 DebugInfo: Avoid emitting standard opcode lengths in debug_line.dwo headers where opcodes are never used anyway
Introduce a slightly tighter wrapper around the header structure that
handles this use case. (MCDwarfDwoLineTable)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204101 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 02:13:23 +00:00
David Blaikie
9c1e56a84d DebugInfo: Implement debug_line.dwo for file names used in type units during -gsplit-dwarf
This removes an attribute (and more importantly, a relocation) from
skeleton type units and removes some unnecessary file names from the
debug_line section that remains in the .o (and linked executable) file.

There's still a few places we could shave off some more space here:

* use compilation dir of the underlying compilation unit (since all the
  type units share that compilation dir - though this would be more
  complicated in LTO cases where they don't (keep a map of compilation
  dir->line table header?))

* Remove some of the unnecessary header fields from the line table since
  they're not needed in this situation (about 12 bytes per table).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204099 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 01:17:26 +00:00
David Blaikie
cdbfefbfed DebugInfo: Flag test as requiring object emission support
Cleans up buildbot failures on R600 and similar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204095 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 00:12:25 +00:00
David Blaikie
2a12c4e5bd DebugInfo: Do not rely on the compilation dir (index 0) for files in line tables shared between compilation units
When emitting assembly there's no support for emitting separate line
tables for each compilation unit - so LLVM emits .loc directives
producing a single line table.

Line tables have an implicit directory (index 0) equal to the
compilation directory (DW_AT_comp_dir) of the compilation unit that
references them.

If multiple compilation units (with possibly disparate compilation
directories) reference the same line table, we must avoid relying on
this ambiguous directory.

Achieve this my simply not setting the compilation directory on the line
table when we're in this situation (multiple units while emitting
assembly).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204094 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 00:11:48 +00:00
David Blaikie
1881227389 DebugInfo: Move getOrCreateSourceID from DwarfDebug to DwarfCompileUnit
We still do a few lookups into the line table mapping in MCContext that
could be factored out into a single lookup (rather than looking it up
once for the table label, once to set the compilation unit, once for
each time we need a file ID, etc... ) but assembly output complicates
that somewhat as we still need a virtual dispatch back to the
MCAsmStreamer in that case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204092 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 23:53:25 +00:00
David Blaikie
2879a6caa8 DebugInfo: Move line table zero-directory-index (compilation dir) handling into MCDwarf
Our handling of compilation directory in DwarfDebug was broken
(incorrectly using the 'last' compilation directory (that of the last
CU in the metadata list) for all function emission in any CU). By moving
this handling down into MCDwarf the issue is fixed as the compilation
dir is tracked correctly per line table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204089 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 23:29:40 +00:00
Matt Arsenault
9f44c113bd Make methods static
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204085 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 22:23:09 +00:00
Dan Gohman
43873d4f73 Use range metadata instead of introducing selects.
When GlobalOpt has determined that a GlobalVariable only ever has two values,
it would convert the GlobalVariable to a boolean, and introduce SelectInsts
at every load, to choose between the two possible values. These SelectInsts
introduce overhead and other unpleasantness.

This patch makes GlobalOpt just add range metadata to loads from such
GlobalVariables instead. This enables the same main optimization (as seen in
test/Transforms/GlobalOpt/integer-bool.ll), without introducing selects.

The main downside is that it doesn't get the memory savings of shrinking such
GlobalVariables, but this is expected to be negligible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204076 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 19:57:04 +00:00
Owen Anderson
92fca73d52 Switch a number of loops in lib/CodeGen over to range-based for-loops, now that
the MachineRegisterInfo iterators are compatible with it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204075 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 19:36:09 +00:00
Owen Anderson
7ad87e4d3b Really REALLY finish adding const to the MachineRegisterInfo iterator range methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204074 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 19:34:51 +00:00
Kevin Enderby
c153e49aa9 Making a guess to fix the test case with r204056 to get the build bot working.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204073 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 19:00:03 +00:00
Matt Arsenault
2683baa8ac R600: Match sign_extend_inreg to BFE instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204072 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 18:58:11 +00:00
Matt Arsenault
94bdb453a4 Make DAGCombiner work on vector bitshifts with constant splat vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204071 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 18:58:01 +00:00
Owen Anderson
63d93faa9b Add one more const marker that I missed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204070 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 18:16:10 +00:00
David Blaikie
daeeb37373 DebugInfo: Use MC line table file entry uniquing for non-asm input as well.
See r204027 for the precursor to this that applied to asm debug info.

This required some non-obvious API changes to handle the case of asm
output (we never go asm->asm so this didn't come up in r204027): the
modification of the file/directory name by MCDwarfLineTableHeader needed
to be reflected in the MCAsmStreamer caller so it could print the
appropriate .file directive, so those StringRef parameters are now
non-const ref (in/out) parameters rather than just const.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204069 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 18:13:58 +00:00
Owen Anderson
03a3f643b1 Mark MachineRegisterInfo's iterator range methods as const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204067 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 18:05:05 +00:00
Owen Anderson
3645c32163 Add iterator range definitions for the MachineRegisterInfo iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204066 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 18:01:41 +00:00
Adam Nemet
131ab020c3 [X86] Fix unused variable warning with NDEBUG from r204058
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204063 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 17:32:53 +00:00
Saleem Abdulrasool
1e4d7d7ef7 MC: change runtime check to an assertion
It is unclear how it would be possible to get M to be NULL in normal scenarios.
Change this to an assert rather than a runtime check as per dblakie's
suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204060 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 17:13:57 +00:00
Saleem Abdulrasool
5b5e5abd20 ARM IAS: support .thumb_set
This performs the equivalent of a .set directive in that it creates a symbol
which is an alias for another symbol or value which may possibly be yet
undefined.  This directive also has the added property in that it marks the
aliased symbol as being a thumb function entry point, in the same way that the
.thumb_func directive does.

The current implementation fails one test due to an unrelated issue.  Functions
within .thumb sections are not marked as thumb_func.  The result is that
the aliasee function is not valued correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204059 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 17:13:54 +00:00