Commit Graph

131618 Commits

Author SHA1 Message Date
Kostya Serebryany
c48930b338 [libFuzzer] add a test for libFuzzer+ubsan, extend the docs on using libFuzzer+ubsan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268968 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 21:02:36 +00:00
Marcin Koscielnicki
05b09ea28d [MSan] [AArch64] Fix vararg helper for >1 or non-int fixed arguments.
This fixes http://llvm.org/PR27646 on AArch64.

There are three issues here:

- The GR save area is 7 words in size, instead of 8.  This is not enough
  if none of the fixed arguments is passed in GRs (they're all floats or
  aggregates).
- The first argument is ignored (which counteracts the above if it's passed
  in GR).
- Like x86_64, fixed arguments landing in the overflow area are wrongly
  counted towards the overflow offset.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268967 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 20:57:36 +00:00
Adrian Prantl
f68fb38629 Separate the Verifier into an analysis and a transformation pass and
allow the transformation to strip invalid debug info.

This patch separates the Verifier into an analysis and a transformation
pass, with the transformation pass optionally stripping malformed
debug info.

The problem I'm trying to solve with this sequence of patches is that
historically we've done a really bad job at verifying debug info. We want
to be able to make the verifier stricter without having to worry about
breaking bitcode compatibility with existing producers. For example, we
don't necessarily want IR produced by an older version of clang to be
rejected by an LTO link just because of malformed debug info, and rather
provide an option to strip it. Note that merely outdated (but well-formed)
debug info would continue to be auto-upgraded in this scenario.

http://reviews.llvm.org/D19988
rdar://problem/25818489

This reapplies r268937 without modifications.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268966 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 19:57:29 +00:00
Adrian Prantl
b6708cf087 Allow the LTO code generator to strip invalid debug info from the input.
This patch introduces a new option -lto-strip-invalid-debug-info, which
drops malformed debug info from the input.

The problem I'm trying to solve with this sequence of patches is that
historically we've done a really bad job at verifying debug info. We want
to be able to make the verifier stricter without having to worry about
breaking bitcode compatibility with existing producers. For example, we
don't necessarily want IR produced by an older version of clang to be
rejected by an LTO link just because of malformed debug info, and rather
provide an option to strip it. Note that merely outdated (but well-formed)
debug info would continue to be auto-upgraded in this scenario.

rdar://problem/25818489
http://reviews.llvm.org/D19987

This reapplies 268936 with a test case fix for Linux (-exported-symbol foo)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268965 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 19:57:15 +00:00
Quentin Colombet
b8b6ac5e09 [X86] Drop the 64-bit alignment for LOW32_ADDR_ACCESS register class.
The only 64-bit register in that register class is RIP and it will not
get spilled in the current ABIs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268963 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 19:50:30 +00:00
Kostya Serebryany
ce06f035f9 [libFuzzer] reshuffle docs more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268961 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 19:32:10 +00:00
Chad Rosier
f9451d9d7f [InstCombine] Fold icmp eq/ne (udiv i32 A, B), 0 -> icmp ugt/ule B, A.
Differential Revision: http://reviews.llvm.org/D20036

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268960 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 19:30:20 +00:00
Kostya Serebryany
464c4e89a5 [libFuzzer] reshuffle docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 19:29:53 +00:00
Kostya Serebryany
3fc00408ae [libFuzzer] better document the -merge=1 flag, part 2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268958 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 19:23:28 +00:00
Kostya Serebryany
2f120989e3 [libFuzzer] better document the -merge=1 flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268957 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 19:11:36 +00:00
Quentin Colombet
5db7dd2a56 Reapply [X86] Add a new LOW32_ADDR_ACCESS_RBP register class.
This reapplies commit r268796, with a fix for the setting of the inline asm
constraints. I.e., "mark" LOW32_ADDR_ACCESS_RBP as a GR variant, so that the
regular processing of the GR operands (setting of the subregisters) happens.

Original commit log:
[X86] Add a new LOW32_ADDR_ACCESS_RBP register class.

ABIs like NaCl uses 32-bit addresses but have 64-bit frame.
The new register class reflects those constraints when choosing a
register class for a address access.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268955 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 19:01:46 +00:00
Quentin Colombet
41c48e040d [X86] Update a regexp in a test case to resist register allocation
changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268954 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 19:01:42 +00:00
Quentin Colombet
3024e4486b [X86] Strengthen the setting of inline asm constraints.
The setting of the inline asm constraints was implicitly relying on the
order of the register classes in the file generated by tablegen.
Since, we do not have any control on that order, make sure we do not
depend on it anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268953 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 19:01:35 +00:00
Nemanja Ivanovic
f9018a1eb7 [Power9] Add support for -mcpu=pwr9 in the back end
This patch corresponds to review:
http://reviews.llvm.org/D19683

Simply adds the bits for being able to specify -mcpu=pwr9 to the back end.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268950 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 18:54:58 +00:00
Sanjay Patel
1f19a43136 clean up; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268949 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 18:54:14 +00:00
Zachary Turner
2391618ef9 Fix build error with ambiguity of size_t.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268948 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 18:45:21 +00:00
Krzysztof Parzyszek
13fc4ae0bf [Hexagon] Treat all conditional branches as predicted (not-taken by default)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268946 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 18:22:07 +00:00
Konstantin Zhuravlyov
2fdfecfd6e [AMDGPU] Clean up debugger tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268944 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 18:05:42 +00:00
Benjamin Kramer
6bb23fcbb9 Unbreak the non-windows build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268943 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 18:05:28 +00:00
Zachary Turner
a95bc25b20 [pdb] Parse the module info stream for each module.
Differential Revision: http://reviews.llvm.org/D20026
Reviewed By: rnk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268942 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 17:45:21 +00:00
Zachary Turner
5c1193559a Make TypeIterator generic so it can iterate symbols too.
Reviewed By: amccarth
Differential Revision: http://reviews.llvm.org/D20038

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268941 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 17:44:58 +00:00
Adrian Prantl
cfd85505ad Revert "Allow the LTO code generator to strip invalid debug info from the input."
This reverts commit 268936 while investigating buildbot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268940 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 17:43:30 +00:00
Adrian Prantl
0a3572607f Revert "Separate the Verifier into an analysis and a transformation pass and"
This reverts commit 268937 while investigating build bot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268939 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 17:43:24 +00:00
Daniel Sanders
a2d03d2ed9 [mips] Fix a partially initialized member variable that was introduced in r268896.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 17:42:04 +00:00
Adrian Prantl
6d99a3d56e Separate the Verifier into an analysis and a transformation pass and
allow the transformation to strip invalid debug info.

This patch separates the Verifier into an analysis and a transformation
pass, with the transformation pass optionally stripping malformed
debug info.

The problem I'm trying to solve with this sequence of patches is that
historically we've done a really bad job at verifying debug info. We want
to be able to make the verifier stricter without having to worry about
breaking bitcode compatibility with existing producers. For example, we
don't necessarily want IR produced by an older version of clang to be
rejected by an LTO link just because of malformed debug info, and rather
provide an option to strip it. Note that merely outdated (but well-formed)
debug info would continue to be auto-upgraded in this scenario.

http://reviews.llvm.org/D19988
rdar://problem/25818489

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268937 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 17:37:42 +00:00
Adrian Prantl
9860b93e07 Allow the LTO code generator to strip invalid debug info from the input.
This patch introduces a new option -lto-strip-invalid-debug-info, which
drops malformed debug info from the input.

The problem I'm trying to solve with this sequence of patches is that
historically we've done a really bad job at verifying debug info. We want
to be able to make the verifier stricter without having to worry about
breaking bitcode compatibility with existing producers. For example, we
don't necessarily want IR produced by an older version of clang to be
rejected by an LTO link just because of malformed debug info, and rather
provide an option to strip it. Note that merely outdated (but well-formed)
debug info would continue to be auto-upgraded in this scenario.

rdar://problem/25818489
http://reviews.llvm.org/D19987

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268936 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 17:37:33 +00:00
Sanjay Patel
bc9409d1af [CGP] avoid crashing from weightlessness
It's possible that we have branch weights with 0 values.
In that case, don't try to create an impossible BranchProbability.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268935 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 17:31:55 +00:00
Matt Arsenault
51485ffe89 DivergenceAnalysis: Fix crash with no return blocks
The post dominator tree does not have a root node in this case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268933 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 16:57:08 +00:00
Sanjay Patel
98959b5434 [TargetLowering] make helper function for SetCC + and optimizations (NFC)
After looking at D19087 again, it occurred to me that we can do better. If we consolidate
the valueHasExactlyOneBitSet() transforms, we won't incur extra overhead from calling it a
2nd time, and we can shrink SimplifySetCC() a bit. No functional change intended.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268932 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 16:42:50 +00:00
Simon Pilgrim
826093255c Fixed unused but set variable warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268931 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 16:42:23 +00:00
Matt Arsenault
deeb131011 AMDGPU: Fold shift into cvt_f32_ubyteN
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268930 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 16:29:50 +00:00
Sanjay Patel
aef806ec52 fix spelling; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268929 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 16:07:45 +00:00
Daniel Sanders
1cc844b098 [mips] Try to fix 'truncation from FindBestPredicateResult to bool' reported by MSVC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268928 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 15:50:15 +00:00
Daniel Sanders
8bc041ce85 [mips][ias] Attempt to fix 'not all control paths return a value' reported by MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268927 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 15:37:52 +00:00
Frederic Riss
856a0143b0 [dsymutil] Prevent use-after-free
The BinaryHolder would query the archive member MemoryBuffer name
to check if the current open archive also contains the next requested
objectfile. This comparison was using a StringRef to a temporary
buffer. It only happened with fat archives. This commit adds long-lived
storage along with the MemoryBuffers for the fat archive filename.

The added test would fail during an ASAN build without the fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268924 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 14:44:14 +00:00
Joerg Sonnenberger
ee2078606f Optimize a printf with a double procent to putchar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268922 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 14:36:16 +00:00
James Molloy
ec0b9c8745 [VectorUtils] Query number of sign bits to allow more truncations
When deciding if a vector calculation can be done in a smaller bitwidth, use sign bit information from ValueTracking to add more information and allow more truncations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268921 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 14:32:30 +00:00
Daniel Sanders
43d2886cca [mips][micromips] Make getPointerRegClass() result depend on the instruction.
Summary:
Previously, it returned the GPR16MMRegClass for all instructions which was
incorrect for instructions like lwsp/lwgp and unnecesarily restricted the
permitted registers for instructions like lw32.

This fixes quite a few of the -verify-machineinstrs errors reported in PR27458.
I've only added -verify-machineinstrs to one test in this change since I
understand there is a plan to enable the verifier by default.

Reviewers: hvarga, zbuljan, zoran.jovanovic, sdardis

Subscribers: dsanders, llvm-commits, sdardis

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 13:38:25 +00:00
Rafael Espindola
0c06716f89 Fix bug where temporary file would be left behind every time an archive was updated.
When updating an existing archive, llvm-ar opens the old archive into a
`MemoryBuffer`, does its thing, and writes the results to a temporary
file. That file is then renamed to the original archive filename, thus
replacing it with the updated contents. However, on Windows at least,
what would happen is that the `MemoryBuffer` for the old archive would
actually be an mmap'ed view of the file, so when it came time to do the
rename via Win32's `ReplaceFile`, it would succeed but would be unable
to fully replace the file since there would still be a handle open on
it; instead, the old version got renamed to a random temporary name and
left behind.

Patch by Cameron!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 13:31:11 +00:00
Simon Pilgrim
0f420ada79 [X86][SSE] Added TODO comment to add support for AVX512 mask registers to shuffle comments
This came up in discussion on D19198

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268915 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 13:30:16 +00:00
Daniel Sanders
b2292f8443 [mips] Fix use after free and an unnecessary copy introduced in r268896.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 13:10:57 +00:00
Strahinja Petrovic
a16fdea51a [PowerPC] fix register alignment for long double type
This patch fixes register alignment for long double type in
soft float mode. Before this patch alignment was 8 and this
patch changes it to 4.
Differential Revision: http://reviews.llvm.org/D18034



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268909 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 12:27:39 +00:00
Chris Dewhurst
e06fb6bce7 [Sparc][LEON] Add UMAC and SMAC instruction support for Sparc LEON subtargets
This change adds SMAC (signed multiply-accumulate) and UMAC (unsigned multiply-accumulate) for LEON subtargets of the Sparc processor.

The new files LeonFeatures.td and leon-instructions.ll will both be expanded in future, so I want to leave them separate as small files for this review, to be expanded in future check-ins.

Note: The functions are provided only for inline-assembly provision. No DAG selection is provided.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 11:55:15 +00:00
Silviu Baranga
784cb3fef6 [AArch64] Implement lowering of the X constraint on AArch64
Summary:
This implements the lowering of the X constraint on
AArch64.

The default behaviour of the X constraint lowering is to
restrict it to "f". This is a problem because the "f"
constraint is not implemented on AArch64 and would be too
restrictive anyway. Therefore, the AArch64 hook will
lower this to "w" (if the operand is a floating point or
vector) or "r" otherwise.

The implementation is similar with the one added for
ARM (r267411).

This is the AArch64 side of the fix for http://llvm.org/PR26493

Reviewers: rengolin

Subscribers: aemerson, rengolin, llvm-commits, t.p.northover

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 11:10:44 +00:00
Simon Pilgrim
a5df424f08 [X86][AVX512] Added masked version of combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268904 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 10:43:13 +00:00
Benjamin Kramer
bc38c49428 Revert "[Mips] Fix use after free."
Fixes use after free but breaks tests.

This reverts commit r268901.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 10:31:17 +00:00
Benjamin Kramer
04c6ebbe71 [Mips] Fix use after free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268901 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 10:21:56 +00:00
Daniel Sanders
0b6e0490cf [mips][ias] R_MIPS_(GOT|HI|LO|PC)16 and R_MIPS_GPREL32 do not need symbols.
Summary:
In theory, care must be taken to ensure that pairs of R_MIPS_(GOT|HI|LO)16
make the same decision on both relocs in the reloc pair but in practice
this isn't as hard as it sounds and only limits the complexity of the
predicate used. We handle all three with the same code to ensure their
decisions always agree with each other.

Reviewers: sdardis

Subscribers: rafael, dsanders, sdardis, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268900 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 10:21:14 +00:00
Zlatko Buljan
dc02050702 [mips][microMIPS] Implement LWP and SWP instructions
Differential Revision: http://reviews.llvm.org/D10640


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 08:07:28 +00:00
Frederic Riss
c0fdf88ac7 [dsymutil] Fix -arch option for thumb variants.
r267249 removed the dual ARM/Thumb interface from MachOObjectFile,
simplifying llvm-dsymutil's code. This unfortunately also regressed
llvm-dsymutil's ability to select thumb slices, because the simplified
code was also dealing with the discrepency between the slice arch
(eg. armv7m) and the triple arch name (eg. thumbv7m).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268894 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 06:01:12 +00:00