Commit Graph

123917 Commits

Author SHA1 Message Date
James Molloy
3808e8c85d [SDAG] Fix expansion of BITREVERSE
Richard Trieu noted that UBSan detected an overflowing shift, and the obvious fix caused a crash.

What was happening was that the shiftee (1U) was indeed too small for the possible range of shifts it had to handle, but also we were using "VT.getSizeInBits()" to get the maximum type bitwidth, but we wanted "VT.getScalarSizeInBits()" to get the vector lane size instead of the entire vector size.

Use an APInt for the shift and VT.getScalarSizeInBits().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253023 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 10:02:36 +00:00
Sanjoy Das
63f8155d9d [ImplicitNulls] Add some clarifying comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253020 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 08:14:00 +00:00
Colin LeMahieu
e78416caa5 [Hexagon] Fixing leak in padEndloop by allocating in MCContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253019 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 07:58:06 +00:00
NAKAMURA Takumi
08ccc7e7d1 llvm/test/tools/llvm-profdata/text-format-errors.test: Use prepared version of the input file, instead of using echo.
...and s/\C9/\xC9/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253014 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 06:06:58 +00:00
Nathan Slingerland
572e633224 [llvm-profdata] Add check for text profile formats and improve error reporting (2nd try)
Summary:
This change addresses two possible instances of user error / confusion when
merging sampled profile data.

Previously any input that didn't match the raw or processed instrumented format
would automatically be interpreted as instrumented profile text format data.
No error would be reported during the merge.

Example:
If foo-sampled.profdata and bar-sampled.profdata are binary sampled profiles:

Old behavior:
$ llvm-profdata merge foo-sampled.profdata bar-sampled.profdata -output foobar-sampled.profdata
$ llvm-profdata show -sample foobar-sampled.profdata
error: foobar-sampled.profdata:1: Expected 'mangled_name:NUM:NUM', found  lprofi

This change adds basic checks for valid input data when assuming text input.
It also makes error messages related to file format validity more specific about
the assumbed profile data type.

New behavior:
$ llvm-profdata merge foo-sampled.profdata bar-sampled.profdata -o foobar-sampled.profdata
error: foo.profdata: Unrecognized instrumentation profile encoding format
Perhaps you forgot to use the -sample option?

Reviewers: bogner, davidxl, dnovillo

Subscribers: davidxl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253009 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 03:47:58 +00:00
Kostya Serebryany
1adc6064bc [libFuzzer] more trophies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253006 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 02:44:16 +00:00
Davide Italiano
73922aaade [lib/Linker] Convert assert(false) to llvm_unreachable().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253005 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 02:16:51 +00:00
Kostya Serebryany
ad9ec32c1f [libFuzzer] make libFuzzer build even with a compiler that does not have sanitizer headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253003 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 01:54:40 +00:00
Colin LeMahieu
333bbfc0c5 [Hexagon] NFC. Adding a number of packet correctness tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253000 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 01:46:06 +00:00
Akira Hatanaka
7edcc75a6b Revert r252990.
Some of the buildbots are still failing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252999 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 01:44:32 +00:00
Dan Gohman
3ba85f0622 [WebAssembly] Inline asm support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252997 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 01:42:29 +00:00
NAKAMURA Takumi
b8e1ed86a5 LLVM_ENABLE_MODULES: No need to set -fcxx-modules in trunk, just -fmodules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252996 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 01:26:31 +00:00
Akira Hatanaka
2069c3c898 Provide a way to specify inliner's attribute compatibility and merging.
This reapplies r252949. I've changed the type of FuncName to be
std::string instead of StringRef in emitFnAttrCompatCheck.

Original commit message for r252949:

Provide a way to specify inliner's attribute compatibility and merging
rules using table-gen. NFC.

This commit adds new classes CompatRule and MergeRule to Attributes.td,
which are used to generate code to check attribute compatibility and
merge attributes of the caller and callee.

rdar://problem/19836465


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252990 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 01:23:11 +00:00
Colin LeMahieu
e1fbc7e8ba [Hexagon] Adding relaxation functionality to backend and test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252989 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 01:12:25 +00:00
Dan Gohman
223fb8cb62 [WebAssembly] Un-mangle the conversion instruction names.
This arranges the types in the LLVM instruction names in the same order that
they appear in the WebAssembly opcode names, and eliminates
double-underscores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252988 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 00:50:04 +00:00
Dan Gohman
1a2634b635 [WebAssembly] Rename BR_IF_ to BR_IF
With MC-based instruction printing, we no longer need instruction names to
mangle in hints about how they should be printed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252987 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 00:46:31 +00:00
Dan Gohman
80bb81536c [WebAssembly] Remove unneeded TODO items. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252985 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 00:41:25 +00:00
Dan Gohman
aad19e333d [WebAssembly] Tidy up and update a TODO item. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252984 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 00:40:37 +00:00
Joseph Tremoulet
a736fb5421 [WinEH] Find root frame correctly in CLR funclets
Summary:
The value that the CoreCLR personality passes to a funclet for the
establisher frame may be the root function's frame or may be the parent
funclet's (mostly empty) frame in the case of nested funclets.  Each
funclet stores a pointer to the root frame in its own (mostly empty)
frame, as does the root function itself.  All frames allocate this slot at
the same offset, measured from the post-prolog stack pointer, so that the
same sequence can accept any ancestor as an establisher frame parameter
value, and so that a single offset can be reported to the GC, which also
looks at this slot.

This change allocate the slot when processing function entry, and records
its frame index on the WinEHFuncInfo object, then inserts the code to
set/copy it during prolog emission.


Reviewers: majnemer, AndyAyers, pgavlin, rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252983 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 00:39:23 +00:00
Dan Gohman
c7f1d5b5dc [WebAssembly] Introduce a new pseudo-operand for unused expression results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252975 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 00:21:05 +00:00
Vyacheslav Klochkov
c81095daa7 X86-FMA3: Implemented commute transformations FMA*_Int instructions.
It made it possible to apply the memory folding optimization for the 2nd
operand of FMA*_Int instructions.

Reviewer: Quentin Colombet
Differential Revision: http://reviews.llvm.org/D14550


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252973 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 00:07:35 +00:00
Davide Italiano
e4296ea350 [SimplifyLibCalls] Make a function shorter. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252970 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 23:39:00 +00:00
Colin LeMahieu
c3b82d06df [Hexagon] Adding checks for values out of operand range and correct new-value producer usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252969 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 23:28:01 +00:00
Colin LeMahieu
4fadb877b4 [Hexagon] Adding test to make sure labels and register pairs are correctly parsed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252968 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 22:54:14 +00:00
Sanjay Patel
a9eb339a53 specify triple and tighten checks using update_llc_test_checks.py
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252962 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 22:27:38 +00:00
Tom Stellard
b6cc1fddcd Revert "Remove unnecessary call to getAllocatableRegClass"
This reverts commit r252565.

This also includes the revert of the commit mentioned below in order to
avoid breaking tests in AMDGPU:

Revert "AMDGPU: Set isAllocatable = 0 on VS_32/VS_64"

This reverts commit r252674.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252956 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 21:43:25 +00:00
Akira Hatanaka
85b811eedd Revert r252949.
It broke some of the bots including clang-x64-ninja-win7.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252951 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 21:19:18 +00:00
Akira Hatanaka
d68ad56b3f Provide a way to specify inliner's attribute compatibility and merging
rules using table-gen. NFC.

This commit adds new classes CompatRule and MergeRule to Attributes.td,
which are used to generate code to check attribute compatibility and
merge attributes of the caller and callee.

rdar://problem/19836465


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252949 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 20:59:43 +00:00
Sanjoy Das
22e911c8dd Revert r243347 "Add TargetTransformInfo::isZExtFree."
r243347 was intended to support a change to LSR (r243348).  That change
to LSR has since had to be reverted (r243939) because it was buggy, and
now the code added in r243347 is untested and unexercised.  Given that,
I think it is appropriate to revert r243347 for now, with the intent of
adding it back in later if I get around to checking in a fixed version
of r243348.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252948 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 20:51:52 +00:00
Sanjoy Das
13036d4421 [ImplicitNulls] Fix wrapping by breaking up a condition, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252947 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 20:51:49 +00:00
Sanjoy Das
a2f2875b75 [ImplicitNull] Extract out a HazardDetector class, NFC
This will make later functional changes easier to follow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252946 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 20:51:44 +00:00
Mike Aizatsky
8b07272072 disabling sancov tests: too many failures on different platforms.
Differential Revision: http://reviews.llvm.org/D14624

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252945 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 20:47:12 +00:00
Mike Aizatsky
4192660fd2 sancov tests - platform independent separators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252943 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 20:17:49 +00:00
Vyacheslav Klochkov
c319d2c8cc My first/test commit. Removed a trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252940 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 20:11:57 +00:00
Tobias Grosser
8887882603 Revert "Fix bug 25440: GVN assertion after coercing loads"
This reverts 252919 which broke LNT: MultiSource/Applications/SPASS

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252936 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 20:04:21 +00:00
Mike Aizatsky
91e7b1246c sancov test suite
Differential Revision: http://reviews.llvm.org/D14589

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252933 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 19:34:21 +00:00
Teresa Johnson
8e6493db91 [ThinLTO] Update test to be more tolerant of ordering changes
Update the ThinLTO function importing test to use DAG forms of checks so
that it is more tolerant of changes to relative ordering between
imported decls/defs. This reduces the number of changes required by the
comdat importing patch I am sending for review shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252932 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 19:31:46 +00:00
Benjamin Kramer
667c2c29cf [Hexagon] Allocate MCInst in the MCContext to avoid leaking it.
Found by leaksanitizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252931 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 19:30:40 +00:00
Chad Rosier
1a1fb00653 [LIR] Minor refactoring. NFCI.
This change prevents uninteresting stores from being inserted into the list of
candidate stores for memset/memcpy conversion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252926 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 19:09:16 +00:00
David Blaikie
7c389fb7c5 Roll an expression into an assert to fix -Wunused-variable in a -Asserts build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252925 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 19:07:43 +00:00
Nathan Slingerland
69c9ea3b39 reverting r252916 to investigate test failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252921 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 18:39:26 +00:00
Weiming Zhao
13d37da28f Fix bug 25440: GVN assertion after coercing loads
Summary:
when coercing loads, it inserts some instructions, which have no GV assigned.

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


Reviewers: hfinkel, dberlin

Subscribers: dberlin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252919 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 18:19:59 +00:00
Quentin Colombet
15dd44677b [ShrinkWrap] Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252918 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 18:16:27 +00:00
Quentin Colombet
88d45c6801 [ShrinkWrap] Make sure we do not mess up with EH funclet lowering.
ShrinkWrapping does not understand exception handling constraints for now, so
make sure we do not mess with them by aborting on functions that use EH
funclets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252917 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 18:13:42 +00:00
Nathan Slingerland
7b81b822ba [llvm-profdata] Add check for text profile formats and improve error reporting
Summary:
This change addresses two possible instances of user error / confusion when
merging sampled profile data.

Previously any input that didn't match the raw or processed instrumented format
would automatically be interpreted as instrumented profile text format data.
No error would be reported during the merge.

Example:
If foo-sampled.profdata and bar-sampled.profdata are binary sampled profiles:

Old behavior:
$ llvm-profdata merge foo-sampled.profdata bar-sampled.profdata -output foobar-sampled.profdata
$ llvm-profdata show -sample foobar-sampled.profdata
error: foobar-sampled.profdata:1: Expected 'mangled_name:NUM:NUM', found  lprofi

This change adds basic checks for valid input data when assuming text input.
It also makes error messages related to file format validity more specific about
the assumbed profile data type.

New behavior:
$ llvm-profdata merge foo-sampled.profdata bar-sampled.profdata -o foobar-sampled.profdata
error: foo.profdata: Unrecognized instrumentation profile encoding format
Perhaps you forgot to use the -sample option?

Reviewers: bogner, davidxl, dnovillo

Subscribers: davidxl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252916 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 18:06:18 +00:00
Diego Novillo
7e02753319 SamplePGO - Move FunctionSamples::print() to a better location. NFC.
The class is declared in SampleProf.h, so a better home for this is
SampleProf.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252915 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 17:58:14 +00:00
Andrew Kaylor
2aca944a0e [WinEH] Fix problem with removing an element from a SetVector while iterating.
Patch provided by Yaron Keren. (Thanks!)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252913 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 17:36:03 +00:00
Rafael Espindola
d0663f3a4e Comment update. NFC.
Fix the library name.
Don't duplicate the comment in the .cpp file.
Don't repeat the name in the comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252911 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 17:13:45 +00:00
Dan Gohman
d39c38d2bc [WebAssembly] Reapply r252858, with svn add for the new file.
Switch to MC for instruction printing.

This encompasses several changes which are all interconnected:
 - Use the MC framework for printing almost all instructions.
 - AsmStrings are now live.
 - This introduces an indirection between LLVM vregs and WebAssembly registers,
   and a new pass, WebAssemblyRegNumbering, for computing a basic the mapping.
   This addresses some basic issues with argument registers and unused registers.
 - The way ARGUMENT instructions are handled no longer generates redundant
   get_local+set_local for every argument.

This also changes the assembly syntax somewhat; most notably, MC's printing
does not use sigils on label names, so those are no longer present, and
push/pop now have a sigil to keep them unambiguous.

The usage of set_local/get_local/$push/$pop will continue to evolve
significantly. This patch is just one step of a larger change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252910 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 17:04:33 +00:00
Michael Zuckerman
8e8b0ba38b [x86] translating "fp" (floating point) instructions from {fadd,fdiv,fmul,fsub,fsubr,fdivr} to {faddp,fdivp,fmulp,fsubp,fsubrp,fdivrp}
LLVM Missing the following instructions: fadd\fdiv\fmul\fsub\fsubr\fdivr.
GAS and MS supporting this instruction and lowering them in to a faddp\fdivp\fmulp\fsubp\fsubrp\fdivrp instructions.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252908 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 16:58:51 +00:00