Craig Topper [Sun, 25 Jan 2015 23:26:12 +0000 (23:26 +0000)]
[X86] Change comparision immediate type to i8 in test cases for AVX512 floating point comparisons. The type was already changed in the definitions and was being auto upgraded to the new type.
llvm-svn: 227064
Craig Topper [Sun, 25 Jan 2015 23:26:02 +0000 (23:26 +0000)]
[X86] Use i8 immediate for comparison type on AVX512 packed integer instructions. This matches floating point equivalents. Includes autoupgrade support to convert old code.
llvm-svn: 227063
Renato Golin [Sun, 25 Jan 2015 23:17:48 +0000 (23:17 +0000)]
Allows Clang to use LLVM's fixes-x18 option
This patch allows clang to have llvm reserve the x18
platform register on AArch64. FreeBSD will use this in the kernel for
per-cpu data but has no need to reserve this register in userland so
will need this flag to reserve it.
This uses llvm r226664 to allow this register to be reserved.
Patch by Andrew Turner.
llvm-svn: 227062
NAKAMURA Takumi [Sun, 25 Jan 2015 23:10:21 +0000 (23:10 +0000)]
clang/test/Driver/rewrite-map-in-diagnostics.c: This depends on crash-recovery.
llvm-svn: 227061
Alex Rosenberg [Sun, 25 Jan 2015 22:46:59 +0000 (22:46 +0000)]
Add the triple for the Sony Playstation®4.
Lots more to follow.
llvm-svn: 227060
Simon Atanasyan [Sun, 25 Jan 2015 21:31:52 +0000 (21:31 +0000)]
[Mips] Add checking of disassembler output in some test cases
No functional changes.
llvm-svn: 227059
Simon Atanasyan [Sun, 25 Jan 2015 19:15:35 +0000 (19:15 +0000)]
[Mips] Teach LLD to recognize one more MIPS target triple - mips64el
This is initial patch to support MIPS64 object files linking.
The patch just makes some classes more generalized, and rejects
attempts to interlinking O32 and N64 ABI object files.
I try to reuse the current MIPS target related classes as much as
possible because O32 and N64 MIPS ABI are tightly related and share
almost the same set of relocations, GOT, flags etc.
llvm-svn: 227058
Johannes Doerfert [Sun, 25 Jan 2015 19:09:49 +0000 (19:09 +0000)]
[FIX] Independent blocks with intrinsics handling
Also an old option was removed from some new test cases
llvm-svn: 227057
Adrian Prantl [Sun, 25 Jan 2015 19:04:08 +0000 (19:04 +0000)]
Debug info: Fix PR22296 by omitting the DW_AT_location if we lost the
physical register that is described in a DBG_VALUE.
In the testcase the DBG_VALUE describing "p5" becomes unavailable
because the register its address is in is clobbered and we (currently)
aren't smart enough to realize that the value is rematerialized immediately
after the DBG_VALUE and/or is actually a stack slot.
llvm-svn: 227056
Bill Schmidt [Sun, 25 Jan 2015 18:18:54 +0000 (18:18 +0000)]
[PowerPC] Revert ppc64le-aggregates.ll test changes from r227053
It appears we have different behavior with and without -mcpu=pwr8 even
with ppc64le defaulting to POWER8. The failure appears as follows:
/home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/test/CodeGen/PowerPC/ppc64le-aggregates.ll:268:14: error: expected string not found in input
; CHECK-DAG: lfs 1, 0([[REG]])
^
<stdin>:497:11: note: scanning from here
ld 3, .LC1@toc@l(3)
^
<stdin>:497:11: note: with variable "REG" equal to "3"
ld 3, .LC1@toc@l(3)
^
<stdin>:514:2: note: possible intended match here
lfs 1, 0(4)
^
Reverting this particular test case change. Nemanja, please have a look
at the reason for the failure.
llvm-svn: 227055
Johannes Doerfert [Sun, 25 Jan 2015 18:07:30 +0000 (18:07 +0000)]
Support for math/misc intrinsics
The support is currently limited as we only allow them in the input but do
not emit them in the transformed SCoP due to the possible semantic changes.
Differential Revision: http://reviews.llvm.org/D5225
llvm-svn: 227054
Bill Schmidt [Sun, 25 Jan 2015 18:05:42 +0000 (18:05 +0000)]
[PowerPC] Reset the baseline for ppc64le to be equivalent to pwr8
Test by Nemanja Ivanovic.
Since ppc64le implies POWER8 as a minimum, it makes sense that the
same features are included. Since the pwr8 processor model will likely
be getting new features until the implementation is complete, I
created a new list to add these updates to. This will include them in
both pwr8 and ppc64le.
Furthermore, it seems that it would make sense to compose the feature
lists for other processor models (pwr3 and up). Per discussion in the
review, I will make this change in a subsequent patch.
In order to test the changes, I've added an additional run step to
test cases that specify -march=ppc64le -mcpu=pwr8 to omit the -mcpu
option. Since the feature lists are the same, the behaviour should be
unchanged.
llvm-svn: 227053
Francisco Lopes da Silva [Sun, 25 Jan 2015 17:00:47 +0000 (17:00 +0000)]
Sema: Formatting. No behavior change.
llvm-svn: 227052
Simon Atanasyan [Sun, 25 Jan 2015 16:38:16 +0000 (16:38 +0000)]
[Mips] Make MipsELFObjectReader and MipsELFDSOReader class templates
No functional changes.
llvm-svn: 227051
Simon Atanasyan [Sun, 25 Jan 2015 16:20:30 +0000 (16:20 +0000)]
[docs] Add link to the MIPS 64-bit ELF object file specification
llvm-svn: 227050
Simon Atanasyan [Sun, 25 Jan 2015 16:17:16 +0000 (16:17 +0000)]
[Mips] Reformat the code with clang-format
No functional changes.
llvm-svn: 227049
Simon Atanasyan [Sun, 25 Jan 2015 16:17:10 +0000 (16:17 +0000)]
[Mips] Remove duplicated typedef's
No functional changes.
llvm-svn: 227048
Simon Atanasyan [Sun, 25 Jan 2015 16:17:02 +0000 (16:17 +0000)]
[Mips] Use template class argument instead of hard-coded type name in
the class field declarations.
No functional changes.
llvm-svn: 227047
NAKAMURA Takumi [Sun, 25 Jan 2015 15:05:36 +0000 (15:05 +0000)]
Instantiate Registry<GCStrategy> in LLVMCore, to let it available on Win32 DLL.
llvm-svn: 227046
Simon Atanasyan [Sun, 25 Jan 2015 13:44:02 +0000 (13:44 +0000)]
[ELF] Update for LLVM api change
The `Elf_Rel_Impl::setSymbolAndType` method now has the third argument
`IsMips64EL` (like complement methods `getSymbol` and `getType`). While
we do not support linking of MIPS64 ELF object file just pass `false`
to the `setSymbolAndType`.
llvm-svn: 227045
Simon Atanasyan [Sun, 25 Jan 2015 13:29:25 +0000 (13:29 +0000)]
[ELFYAML] Support mips64 relocation record format in yaml2obj/obj2yaml
MIPS64 ELF file has a very specific relocation record format. Each
record might specify up to three relocation operations. So the `r_info`
field in fact consists of three relocation type sub-fields and optional
code of "special" symbols.
http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf
page 40
The patch implements support of the MIPS64 relocation record format in
yaml2obj/obj2yaml tools by introducing new optional Relocation fields:
Type2, Type3, and SpecSym. These fields are recognized only if the
object/YAML file relates to the MIPS64 target.
Differential Revision: http://reviews.llvm.org/D7136
llvm-svn: 227044
Elena Demikhovsky [Sun, 25 Jan 2015 12:47:15 +0000 (12:47 +0000)]
AVX-512: Changes in operations on masks registers for KNL and SKX
- Added KSHIFTB/D/Q for skx
- Added KORTESTB/D/Q for skx
- Fixed store operation for v8i1 type for KNL
- Store size of v8i1, v4i1 and v2i1 are changed to 8 bits
llvm-svn: 227043
NAKAMURA Takumi [Sun, 25 Jan 2015 11:41:56 +0000 (11:41 +0000)]
Orc/IRCompileLayer.h: Avoid non-static initializer.
llvm-svn: 227042
NAKAMURA Takumi [Sun, 25 Jan 2015 11:41:49 +0000 (11:41 +0000)]
OrcJIT: Avoid non-static initializers.
llvm-svn: 227041
NAKAMURA Takumi [Sun, 25 Jan 2015 11:41:41 +0000 (11:41 +0000)]
Orc/LLVMBuild.txt: Prune redundant "Target" in libdeps.
llvm-svn: 227040
Craig Topper [Sun, 25 Jan 2015 08:49:22 +0000 (08:49 +0000)]
[X86] Give scalar VRNDSCALE instructions priority in AVX512 mode.
llvm-svn: 227039
Craig Topper [Sun, 25 Jan 2015 08:49:19 +0000 (08:49 +0000)]
Simplify a multiclass. No functional change.
llvm-svn: 227038
Francisco Lopes da Silva [Sun, 25 Jan 2015 08:47:59 +0000 (08:47 +0000)]
Sema: require a complete type before lookup.
llvm-svn: 227037
Craig Topper [Sun, 25 Jan 2015 08:45:32 +0000 (08:45 +0000)]
Remove tab characters. NFC
llvm-svn: 227036
Elena Demikhovsky [Sun, 25 Jan 2015 08:44:46 +0000 (08:44 +0000)]
Implemented cost model for masked load/store operations.
llvm-svn: 227035
David Blaikie [Sun, 25 Jan 2015 07:44:05 +0000 (07:44 +0000)]
Fix the buildbots (fallout from r227028) by returning the exprloc of non-binary operator overload calls (and ->) to the start of the expression, not the location of the operator
I'll give this some further thought/discussion later, but this is enough
to unbreak the buildbots at least.
llvm-svn: 227034
David Blaikie [Sun, 25 Jan 2015 04:39:06 +0000 (04:39 +0000)]
Fix up test cases to account for improved column fidelity provided by clang
llvm-svn: 227033
Craig Topper [Sun, 25 Jan 2015 02:21:16 +0000 (02:21 +0000)]
[X86] Replace i32i8imm on SSE/AVX instructions with i32u8imm which will make the assembler bounds check them. It will also make them print as unsigned.
llvm-svn: 227032
Craig Topper [Sun, 25 Jan 2015 02:21:13 +0000 (02:21 +0000)]
[X86] Use u8imm in several places that used i32i8imm that don't require an i32 type.
llvm-svn: 227031
Craig Topper [Sun, 25 Jan 2015 02:21:11 +0000 (02:21 +0000)]
Remove tab characters. NFC.
llvm-svn: 227030
Nico Weber [Sun, 25 Jan 2015 02:04:36 +0000 (02:04 +0000)]
Rename four test files from .C to .cpp.
lit.cfg has never supported running .C files, so these tests were never
executed by check-clang. Rename them to .cpp so that they run as part of
the test suite, and minorly tweak two of them that look like they were broken
when checked in to actually pass.
llvm-svn: 227029
David Blaikie [Sun, 25 Jan 2015 01:25:37 +0000 (01:25 +0000)]
DebugInfo: Attribute calls to overloaded operators with the operator, not the start of the whole expression
llvm-svn: 227028
David Blaikie [Sun, 25 Jan 2015 01:19:10 +0000 (01:19 +0000)]
DebugInfo: Use the preferred location rather than the start location for expression line info
This causes things like assignment to refer to the '=' rather than the
LHS when attributing the store instruction, for example.
There were essentially 3 options for this:
* The beginning of an expression (this was the behavior prior to this
commit). This meant that stepping through subexpressions would bounce
around from subexpressions back to the start of the outer expression,
etc. (eg: x + y + z would go x, y, x, z, x (the repeated 'x's would be
where the actual addition occurred)).
* The end of an expression. This seems to be what GCC does /mostly/, and
certainly this for function calls. This has the advantage that
progress is always 'forwards' (never jumping backwards - except for
independent subexpressions if they're evaluated in interesting orders,
etc). "x + y + z" would go "x y z" with the additions occurring at y
and z after the respective loads.
The problem with this is that the user would still have to think
fairly hard about precedence to realize which subexpression is being
evaluated or which operator overload is being called in, say, an asan
backtrace.
* The preferred location or 'exprloc'. In this case you get sort of what
you'd expect, though it's a bit confusing in its own way due to going
'backwards'. In this case the locations would be: "x y + z +" in
lovely postfix arithmetic order. But this does mean that if the op+
were an operator overload, say, and in a backtrace, the backtrace will
point to the exact '+' that's being called, not to the end of one of
its operands.
(actually the operator overload case doesn't work yet for other reasons,
but that's being fixed - but this at least gets scalar/complex
assignments and other plain operators right)
llvm-svn: 227027
Nico Weber [Sun, 25 Jan 2015 01:00:21 +0000 (01:00 +0000)]
Name a bool parameter. No behavior change.
llvm-svn: 227026
Chandler Carruth [Sun, 25 Jan 2015 00:30:05 +0000 (00:30 +0000)]
[PM] Remove the restricted visibility from the instcombine worklist. Now
that library consumers access the instcombine pass directly, they also
(transitively) access the worklist. Also, it would need to be used
directly in order to have a useful utility if we ever want that.
This should fix some warnings since I moved this code. Sorry for the
trouble.
llvm-svn: 227025
Nathan Sidwell [Sun, 25 Jan 2015 00:25:44 +0000 (00:25 +0000)]
Remove duplicate code
llvm-svn: 227024
David Blaikie [Sat, 24 Jan 2015 23:35:17 +0000 (23:35 +0000)]
DebugInfo: Correct the line location of geps on array accesses
llvm-svn: 227023
Larisse Voufo [Sat, 24 Jan 2015 23:09:54 +0000 (23:09 +0000)]
First steps in implementing DR1467: List-initialization of aggregate from same-type object.
Only the first two items for now, changing Sections 8.5.4 [dcl.init.list] paragraph 3 and 13.3.1.7 [over.match.list] paragraph 1,
so that defining class objects and character arrays using uniform initialization syntax is actually treated as list initialization
and before it is treated aggregate initialization.
llvm-svn: 227022
Lang Hames [Sat, 24 Jan 2015 22:41:13 +0000 (22:41 +0000)]
Remove a few more redundant ExecutionEngine regression tests.
llvm-svn: 227021
Charlie Turner [Sat, 24 Jan 2015 21:51:21 +0000 (21:51 +0000)]
Fixup debug information references.
llvm-svn: 227020
Charlie Turner [Sat, 24 Jan 2015 21:51:17 +0000 (21:51 +0000)]
Update references to lines of code count.
The number of lines of code in Kaleidoscope has risen from the
previously reported 700 to 986 according to the cloc tool. This tools
was run on the toy.cpp file from Chapter 8.
llvm-svn: 227019
Justin Bogner [Sat, 24 Jan 2015 21:13:23 +0000 (21:13 +0000)]
InstrProf: Add operator!= to coverage counters
I'll use this in clang shortly. Also makes the operator definition
style more consistent in this class.
llvm-svn: 227018
Justin Bogner [Sat, 24 Jan 2015 20:58:52 +0000 (20:58 +0000)]
llvm-cov: Only combine segments if they overlap exactly
If two coverage segments cover the same area we need to combine them,
as per r218432. OTOH, just because they start at the same place
doesn't mean they cover the same area. This fixes the check to be more
exact about this.
This is pretty hard to test right now. The frontend doesn't currently
emit regions that start at the same place but don't overlap, but some
upcoming work changes this.
llvm-svn: 227017
Patrik Hagglund [Sat, 24 Jan 2015 20:35:36 +0000 (20:35 +0000)]
Revert r227013 "Add visibility attribute for InstCombinePass (r226987)."
Buildbot breakage.
http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/21749
llvm-svn: 227016
Justin Bogner [Sat, 24 Jan 2015 20:22:32 +0000 (20:22 +0000)]
InstrProf: Use an Optional instead of an out parameter
llvm-svn: 227015
Saleem Abdulrasool [Sat, 24 Jan 2015 20:19:45 +0000 (20:19 +0000)]
CodeGen: drive-by formatting clean ups
Minor tweaks to whitespace formatting that I noticed was off. NFC.
llvm-svn: 227014
Patrik Hagglund [Sat, 24 Jan 2015 20:06:53 +0000 (20:06 +0000)]
Add visibility attribute for InstCombinePass (r226987).
Warning by gcc:
'llvm::InstCombinePass' declared with greater visibility than the type of its field 'llvm::InstCombinePass::Worklist' [-Wattributes]
llvm-svn: 227013
Benjamin Kramer [Sat, 24 Jan 2015 19:55:23 +0000 (19:55 +0000)]
DebugInfo: Fix use after return found by asan.
llvm-svn: 227012
Lang Hames [Sat, 24 Jan 2015 19:00:09 +0000 (19:00 +0000)]
[Orc] Add TransformUtils to Orc's dependency list.
Patch by Jan Vesely. Thanks Jan!
llvm-svn: 227011
Lang Hames [Sat, 24 Jan 2015 18:49:51 +0000 (18:49 +0000)]
Remove a number of redundant ExecutionEngine regression tests.
These tests used to test the legacy JIT but since that has been removed they're
just redundantly testing MCJIT. Remove them and just leave their counterparts in
test/ExecutionEngine/MCJIT.
llvm-svn: 227010
Alexei Starovoitov [Sat, 24 Jan 2015 18:20:52 +0000 (18:20 +0000)]
bpf: add missing lit.local.cfg
llvm-svn: 227009
Alexei Starovoitov [Sat, 24 Jan 2015 17:51:26 +0000 (17:51 +0000)]
BPF backend
Summary:
V8->V9:
- cleanup tests
V7->V8:
- addressed feedback from David:
- switched to range-based 'for' loops
- fixed formatting of tests
V6->V7:
- rebased and adjusted AsmPrinter args
- CamelCased .td, fixed formatting, cleaned up names, removed unused patterns
- diffstat: 3 files changed, 203 insertions(+), 227 deletions(-)
V5->V6:
- addressed feedback from Chandler:
- reinstated full verbose standard banner in all files
- fixed variables that were not in CamelCase
- fixed names of #ifdef in header files
- removed redundant braces in if/else chains with single statements
- fixed comments
- removed trailing empty line
- dropped debug annotations from tests
- diffstat of these changes:
46 files changed, 456 insertions(+), 469 deletions(-)
V4->V5:
- fix setLoadExtAction() interface
- clang-formated all where it made sense
V3->V4:
- added CODE_OWNERS entry for BPF backend
V2->V3:
- fix metadata in tests
V1->V2:
- addressed feedback from Tom and Matt
- removed top level change to configure (now everything via 'experimental-backend')
- reworked error reporting via DiagnosticInfo (similar to R600)
- added few more tests
- added cmake build
- added Triple::bpf
- tested on linux and darwin
V1 cover letter:
---------------------
recently linux gained "universal in-kernel virtual machine" which is called
eBPF or extended BPF. The name comes from "Berkeley Packet Filter", since
new instruction set is based on it.
This patch adds a new backend that emits extended BPF instruction set.
The concept and development are covered by the following articles:
http://lwn.net/Articles/599755/
http://lwn.net/Articles/575531/
http://lwn.net/Articles/603983/
http://lwn.net/Articles/606089/
http://lwn.net/Articles/612878/
One of use cases: dtrace/systemtap alternative.
bpf syscall manpage:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=
b4fc1a460f3017e958e6a8ea560ea0afd91bf6fe
instruction set description and differences vs classic BPF:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/filter.txt
Short summary of instruction set:
- 64-bit registers
R0 - return value from in-kernel function, and exit value for BPF program
R1 - R5 - arguments from BPF program to in-kernel function
R6 - R9 - callee saved registers that in-kernel function will preserve
R10 - read-only frame pointer to access stack
- two-operand instructions like +, -, *, mov, load/store
- implicit prologue/epilogue (invisible stack pointer)
- no floating point, no simd
Short history of extended BPF in kernel:
interpreter in 3.15, x64 JIT in 3.16, arm64 JIT, verifier, bpf syscall in 3.18, more to come in the future.
It's a very small and simple backend.
There is no support for global variables, arbitrary function calls, floating point, varargs,
exceptions, indirect jumps, arbitrary pointer arithmetic, alloca, etc.
From C front-end point of view it's very restricted. It's done on purpose, since kernel
rejects all programs that it cannot prove safe. It rejects programs with loops
and with memory accesses via arbitrary pointers. When kernel accepts the program it is
guaranteed that program will terminate and will not crash the kernel.
This patch implements all 'must have' bits. There are several things on TODO list,
so this is not the end of development.
Most of the code is a boiler plate code, copy-pasted from other backends.
Only odd things are lack or < and <= instructions, specialized load_byte intrinsics
and 'compare and goto' as single instruction.
Current instruction set is fixed, but more instructions can be added in the future.
Signed-off-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Subscribers: majnemer, chandlerc, echristo, joerg, pete, rengolin, kristof.beyls, arsenm, t.p.northover, tstellarAMD, aemerson, llvm-commits
Differential Revision: http://reviews.llvm.org/D6494
llvm-svn: 227008
Justin Bogner [Sat, 24 Jan 2015 17:39:36 +0000 (17:39 +0000)]
test: Convert some tests to FileCheck
These were all doing trivial greps. It's better to use FileCheck.
llvm-svn: 227007
Justin Bogner [Sat, 24 Jan 2015 17:39:32 +0000 (17:39 +0000)]
test: Remove two redundant lines from this test
The FileCheck already checks for these lines, no need to grep as well.
llvm-svn: 227006
Daniel Sanders [Sat, 24 Jan 2015 14:35:11 +0000 (14:35 +0000)]
[mips] Fix 'jumpy' debug line info around calls.
Summary:
At the moment, address calculation is taking the debug line info from the
address node (e.g. TargetGlobalAddress). When a function is called multiple
times, this results in output of the form:
.loc $first_call_location
.. address calculation ..
.. function call ..
.. address calculation ..
.loc $second_call_location
.. function call ..
.loc $first_call_location
.. address calculation ..
.loc $third_call_location
.. function call ..
This patch makes address calculations for function calls take the debug line
info for the call node and results in output of the form:
.loc $first_call_location
.. address calculation ..
.. function call ..
.loc $second_call_location
.. address calculation ..
.. function call ..
.loc $third_call_location
.. address calculation ..
.. function call ..
All other address calculations continue to use the address node.
Test Plan: Fixes test/DebugInfo/multiline.ll on a mips host.
Subscribers: dblaikie, llvm-commits
Differential Revision: http://reviews.llvm.org/D7050
llvm-svn: 227005
Sylvestre Ledru [Sat, 24 Jan 2015 13:59:08 +0000 (13:59 +0000)]
Update of the gold-plugin.cpp code to match Chandler's changes (r226981)
llvm-svn: 227004
Daniel Sanders [Sat, 24 Jan 2015 12:58:10 +0000 (12:58 +0000)]
[mips] Fix assertion on i128 addition/subtraction on MIPS64
Summary:
In addition to the included tests, this fixes
test/CodeGen/Generic/i128-addsub.ll on a mips64 host.
Reviewers: atanasyan, sagar, vmedic
Reviewed By: vmedic
Subscribers: sdkie, llvm-commits
Differential Revision: http://reviews.llvm.org/D6610
llvm-svn: 227003
Andrea Di Biagio [Sat, 24 Jan 2015 11:54:29 +0000 (11:54 +0000)]
[DAG] Fix wrong canonicalization performed on shuffle nodes.
This fixes a regression introduced by r226816.
When replacing a splat shuffle node with a constant build_vector,
make sure that the new build_vector has a valid number of elements.
Thanks to Patrik Hagglund for reporting this problem and providing a
small reproducible.
llvm-svn: 227002
Chandler Carruth [Sat, 24 Jan 2015 11:44:32 +0000 (11:44 +0000)]
[PM] General doxygen and comment cleanup for this pass.
llvm-svn: 227001
Chandler Carruth [Sat, 24 Jan 2015 11:33:55 +0000 (11:33 +0000)]
[PM] Reformat this code with clang-format so that I can use clang-format
when refactoring for the new pass manager without introducing too many
formatting changes into meaning full diffs.
llvm-svn: 227000
Chandler Carruth [Sat, 24 Jan 2015 11:13:02 +0000 (11:13 +0000)]
[PM] Port LowerExpectIntrinsic to the new pass manager.
This just lifts the logic into a static helper function, sinks the
legacy pass to be a trivial wrapper of that helper fuction, and adds
a trivial wrapper for the new PM as well. Not much to see here.
I switched a test case to run in both modes, but we have to strip the
dead prototypes separately as that pass isn't in the new pass manager
(yet).
llvm-svn: 226999
Chandler Carruth [Sat, 24 Jan 2015 11:12:57 +0000 (11:12 +0000)]
[PM] Change LowerExpectIntrinsic to actually return true when it has
changed the IR. This is particularly easy as we can just look for the
existence of any expect intrinsic at all to know whether we've changed
the IR.
llvm-svn: 226998
Chandler Carruth [Sat, 24 Jan 2015 10:57:25 +0000 (10:57 +0000)]
[PM] Use a more appropriate name for the statistics variable in
lower-expect, as we don't have 'if's in the IR and we use it for
switches as well.
llvm-svn: 226997
Chandler Carruth [Sat, 24 Jan 2015 10:57:19 +0000 (10:57 +0000)]
[PM] Switch tihs code to use a range based for loop over the function.
We can't switch the loop over the instructions because it needs to
early-increment the iterator.
llvm-svn: 226996
Chandler Carruth [Sat, 24 Jan 2015 10:47:13 +0000 (10:47 +0000)]
[PM] Use a SmallVector instead of std::vector to avoid heap allocations
for small switches, and avoid using a complex loop to set up the
weights.
We know what the baseline weights will be so we can just resize the
vector to contain all that value and clobber the one slot that is
likely. This seems much more direct than the previous code that tested
at every iteration, and started off by zeroing the vector.
llvm-svn: 226995
Chandler Carruth [Sat, 24 Jan 2015 10:39:24 +0000 (10:39 +0000)]
[PM] Pull the two helpers for this pass into static functions. There are
no members for them to use.
Also, make them accept references as there is no possibility of a null
pointer.
llvm-svn: 226994
Chandler Carruth [Sat, 24 Jan 2015 10:32:53 +0000 (10:32 +0000)]
[PM] Add a basic doxygen comment for this pass.
llvm-svn: 226993
Chandler Carruth [Sat, 24 Jan 2015 10:30:14 +0000 (10:30 +0000)]
[PM] Clean up the formatting of the LowerExpectIntrinsic pass prior to
refactoring its code.
llvm-svn: 226992
Chandler Carruth [Sat, 24 Jan 2015 10:18:47 +0000 (10:18 +0000)]
[PM] Move the LowerExpectIntrinsic pass to the Scalar library.
It was already in the Scalar header and referenced extensively as being
in this library, the source file was just in the utils directory for
some reason. No actual functionality changed. I noticed as it didn't
make sense to add a pass header to the utils headers.
llvm-svn: 226991
Filipe Cabecinhas [Sat, 24 Jan 2015 05:13:52 +0000 (05:13 +0000)]
Revert r226950. The test doesn't require the Mips target anymore
llvm-svn: 226990
Greg Fitzgerald [Sat, 24 Jan 2015 04:51:26 +0000 (04:51 +0000)]
Fix single-arch builds broken by r226976
TODO: Move ELF/PPC to ELF/PowerPC
TODO: Move ELF/X86_64 into ELF/X86
llvm-svn: 226989
Yunzhong Gao [Sat, 24 Jan 2015 04:23:08 +0000 (04:23 +0000)]
If we see UTF-8 BOM sequence at the beginning of a response file, we shall
remove these bytes before parsing.
Phabricator Revision: http://reviews.llvm.org/D7156
llvm-svn: 226988
Chandler Carruth [Sat, 24 Jan 2015 04:19:17 +0000 (04:19 +0000)]
[PM] Port instcombine to the new pass manager!
This is exciting as this is a much more involved port. This is
a complex, existing transformation pass. All of the core logic is shared
between both old and new pass managers. Only the access to the analyses
is separate because the actual techniques are separate. This also uses
a bunch of different and interesting analyses and is the first time
where we need to use an analysis across an IR layer.
This also paves the way to expose instcombine utility functions. I've
got a static function that implements the core pass logic over
a function which might be mildly interesting, but more interesting is
likely exposing a routine which just uses instructions *already in* the
worklist and combines until empty.
I've switched one of my favorite instcombine tests to run with both as
well to make sure this keeps working.
llvm-svn: 226987
Filipe Cabecinhas [Sat, 24 Jan 2015 04:15:05 +0000 (04:15 +0000)]
[Bitcode] Diagnose errors instead of asserting from bad input
Eventually we can make some of these pass the error along to the caller.
Reports a fatal error if:
We find an invalid abbrev record
We try to get an invalid abbrev number
We can't fill the current word due to an EOF
Fixed an invalid bitcode test to check for output with FileCheck
Bugs found with afl-fuzz
llvm-svn: 226986
Filipe Cabecinhas [Sat, 24 Jan 2015 03:55:22 +0000 (03:55 +0000)]
Fix REQUIRES lines added in r226951 and add the x86 feature if the X86 target was compiled in
llvm-svn: 226985
Rui Ueyama [Sat, 24 Jan 2015 02:57:20 +0000 (02:57 +0000)]
Return a boolean value directly, instead of returning true if true and false if false.
llvm-svn: 226984
Richard Trieu [Sat, 24 Jan 2015 02:48:32 +0000 (02:48 +0000)]
When checking the template argument list, use a copy of that list for changes
and only update the orginal list on a valid arugment list. When checking an
individual expression template argument, and conversions are required, update
the expression in the template argument. Since template arguments are
speculatively checked, the copying of the template argument list prevents
updating the template arguments when the list does not match the template.
Additionally, clean up the integer checking code in the template diffing code.
The code performs unneccessary conversions from APSInt to APInt.
Fixes PR21758.
This essentially reverts r224770 to recommits r224667 and r224668 with extra
changes to prevent the template instantiation problems seen in PR22006.
A test to catch the discovered problem is also added.
llvm-svn: 226983
Chandler Carruth [Sat, 24 Jan 2015 02:25:21 +0000 (02:25 +0000)]
[PM] Update Clang to reflect the TLI API change in LLVM r226981.
llvm-svn: 226982
Chandler Carruth [Sat, 24 Jan 2015 02:06:09 +0000 (02:06 +0000)]
[PM] Rework how the TargetLibraryInfo pass integrates with the new pass
manager to support the actual uses of it. =]
When I ported instcombine to the new pass manager I discover that it
didn't work because TLI wasn't available in the right places. This is
a somewhat surprising and/or subtle aspect of the new pass manager
design that came up before but I think is useful to be reminded of:
While the new pass manager *allows* a function pass to query a module
analysis, it requires that the module analysis is already run and cached
prior to the function pass manager starting up, possibly with
a 'require<foo>' style utility in the pass pipeline. This is an
intentional hurdle because using a module analysis from a function pass
*requires* that the module analysis is run prior to entering the
function pass manager. Otherwise the other functions in the module could
be in who-knows-what state, etc.
A somewhat surprising consequence of this design decision (at least to
me) is that you have to design a function pass that leverages
a module analysis to do so as an optional feature. Even if that means
your function pass does no work in the absence of the module analysis,
you have to handle that possibility and remain conservatively correct.
This is a natural consequence of things being able to invalidate the
module analysis and us being unable to re-run it. And it's a generally
good thing because it lets us reorder passes arbitrarily without
breaking correctness, etc.
This ends up causing problems in one case. What if we have a module
analysis that is *definitionally* impossible to invalidate. In the
places this might come up, the analysis is usually also definitionally
trivial to run even while other transformation passes run on the module,
regardless of the state of anything. And so, it follows that it is
natural to have a hard requirement on such analyses from a function
pass.
It turns out, that TargetLibraryInfo is just such an analysis, and
InstCombine has a hard requirement on it.
The approach I've taken here is to produce an analysis that models this
flexibility by making it both a module and a function analysis. This
exposes the fact that it is in fact safe to compute at any point. We can
even make it a valid CGSCC analysis at some point if that is useful.
However, we don't want to have a copy of the actual target library info
state for each function! This state is specific to the triple. The
somewhat direct and blunt approach here is to turn TLI into a pimpl,
with the state and mutators in the implementation class and the query
routines primarily in the wrapper. Then the analysis can lazily
construct and cache the implementations, keyed on the triple, and
on-demand produce wrappers of them for each function.
One minor annoyance is that we will end up with a wrapper for each
function in the module. While this is a bit wasteful (one pointer per
function) it seems tolerable. And it has the advantage of ensuring that
we pay the absolute minimum synchronization cost to access this
information should we end up with a nice parallel function pass manager
in the future. We could look into trying to mark when analysis results
are especially cheap to recompute and more eagerly GC-ing the cached
results, or we could look at supporting a variant of analyses whose
results are specifically *not* cached and expected to just be used and
discarded by the consumer. Either way, these seem like incremental
enhancements that should happen when we start profiling the memory and
CPU usage of the new pass manager and not before.
The other minor annoyance is that if we end up using the TLI in both
a module pass and a function pass, those will be produced by two
separate analyses, and thus will point to separate copies of the
implementation state. While a minor issue, I dislike this and would like
to find a way to cleanly allow a single analysis instance to be used
across multiple IR unit managers. But I don't have a good solution to
this today, and I don't want to hold up all of the work waiting to come
up with one. This too seems like a reasonable thing to incrementally
improve later.
llvm-svn: 226981
Richard Smith [Sat, 24 Jan 2015 01:55:52 +0000 (01:55 +0000)]
Bring the modules buildbot back to life after r226940.
llvm-svn: 226980
Kuba Brecka [Sat, 24 Jan 2015 01:42:44 +0000 (01:42 +0000)]
Reverting r226937: lit: Make MCJIT's supported arch check case insensitive
The r226937 commit causes ASan lit tests to be all skipped on OS X.
llvm-svn: 226979
Quentin Colombet [Sat, 24 Jan 2015 01:25:54 +0000 (01:25 +0000)]
[AArch64][LoadStoreOptimizer] Form LDPSW when possible.
This patch adds the missing LD[U]RSW variants to the load store optimizer, so
that we generate LDPSW when possible.
<rdar://problem/
19583480>
llvm-svn: 226978
Richard Smith [Sat, 24 Jan 2015 01:07:20 +0000 (01:07 +0000)]
[modules] Sometimes we can deserialize a class member but not have yet
encountered any definition for the class; this happens when the definition is
added by an update record that is not yet loaded. In such a case, eagerly pick
the original parent of the member as the canonical definition of the class
rather than muddling through with the canonical declaration (the latter can
lead to us failing to merge properly later if the canonical definition turns
out to be some other declaration).
llvm-svn: 226977
Greg Fitzgerald [Sat, 24 Jan 2015 01:06:07 +0000 (01:06 +0000)]
Fix the ELF shared library build targets - take 2
lldELF is used by each ELF backend. lldELF's ELFLinkingContext
also held a reference to each backend, creating a link-time
cycle. This patch moves the backend references to lldDriver.
Differential Revision: http://reviews.llvm.org/D7119
llvm-svn: 226976
Lang Hames [Sat, 24 Jan 2015 00:45:11 +0000 (00:45 +0000)]
[Orc] Add some missing headers to the CompileOnDemandLayer.h
llvm-svn: 226975
Bruno Cardoso Lopes [Sat, 24 Jan 2015 00:22:04 +0000 (00:22 +0000)]
[x86] Fix a comment
llvm-svn: 226974
Lang Hames [Sat, 24 Jan 2015 00:01:29 +0000 (00:01 +0000)]
[Orc] Add orcjit to the dependencies list in the Makefile for lli.
This should fix a few more broken bots.
llvm-svn: 226973
Rui Ueyama [Fri, 23 Jan 2015 23:59:39 +0000 (23:59 +0000)]
ELF: Remove dead code.
llvm-svn: 226972
Rui Ueyama [Fri, 23 Jan 2015 23:59:37 +0000 (23:59 +0000)]
ELF: Remove virtual from non-overriden functions.
If it's overridden by a derived class, add override to the derived class.
llvm-svn: 226971
Tom Stellard [Fri, 23 Jan 2015 23:59:08 +0000 (23:59 +0000)]
R600/SI: Emit .hsa.version section for amdhsa OS
llvm-svn: 226970
Reid Kleckner [Fri, 23 Jan 2015 23:51:25 +0000 (23:51 +0000)]
Fix assertion when C++ EH filters are present in functions using SEH
Should fix PR22305.
llvm-svn: 226969
Justin Bogner [Fri, 23 Jan 2015 23:46:13 +0000 (23:46 +0000)]
InstrProf: Use the stream when dumping counters
llvm-svn: 226968
Adrian Prantl [Fri, 23 Jan 2015 23:40:47 +0000 (23:40 +0000)]
Address more review comments for DIExpression::iterator.
- input_iterator
- define an operator->
- make constructors private were possible
llvm-svn: 226967
Rui Ueyama [Fri, 23 Jan 2015 23:39:33 +0000 (23:39 +0000)]
Fix spelling.
llvm-svn: 226966
Rui Ueyama [Fri, 23 Jan 2015 23:39:30 +0000 (23:39 +0000)]
Remove extra parentheses.
llvm-svn: 226965