Commit Graph

125658 Commits

Author SHA1 Message Date
Chandler Carruth
a2062f0893 [lcg] Fix formatting errors found with clang-format, remove the now
optional '\brief' tag and reflow some comments based on the added
horizontal space. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256479 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-28 01:54:18 +00:00
Craig Topper
39b49edd7f [AVX512] Remove separate instruction and patterns for lowering ctlz_zero_undef. Change the operation for CTLZ_ZERO_UNDEF to Expand so SelectionDAG will convert them to CTLZ before lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256477 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-27 21:33:50 +00:00
Craig Topper
04df59213b [SelectionDAG] Teach LegalizeVectorOps to not unroll CTLZ_ZERO_UNDEF and CTTZ_ZERO_UNDEF if the non-ZERO_UNDEF form is legal or custom. Will be used to simplify X86 code in a follow on commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256476 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-27 21:33:47 +00:00
Craig Topper
1422e1f158 [AVX512] Remove alternate data type versions of VALIGND, VALIGNQ, VMOVSHDUP and VMOVSLDUP. They don't have any tests and I don't think they can be selected. If they are truly needed they should be implemented with patterns against the normal instructions and not separate instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256475 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-27 19:45:21 +00:00
Dan Liew
d3bcf04e83 [lit] Implement support of per test timeout in lit.
This should work with ShTest (executed externally or internally) and GTest
test formats.

To set the timeout a new option ``--timeout=`` has
been added which specifies the maximum run time of an individual test
in seconds. By default this 0 which causes no timeout to be enforced.

The timeout can also be set from a lit configuration file by modifying
the ``lit_config.maxIndividualTestTime`` property.

To implement a timeout we now require the psutil Python module if a
 timeout is requested. This dependency is confined to the newly added
 ``lit.util.killProcessAndChildren()``. A note has been added into the
 TODO document describing how we can remove the dependency on the
 ``pustil`` module in the future. It would be nice to remove this
 immediately but that is a lot more work and Daniel Dunbar believes it is
better that we get a working implementation first and then improve it.

To avoid breaking the existing behaviour the psutil module will not be
imported if no timeout is requested.

The included testcases are derived from test cases provided by
 Jonathan Roelofs which were in an previous attempt to add a per test
 timeout to lit (http://reviews.llvm.org/D6584). Thanks Jonathan!

Reviewers: ddunbar, jroelofs, cmatthews, MatzeB

Subscribers: cmatthews, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256471 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-27 14:03:49 +00:00
Igor Breger
3f202fdf9e AVX512: Change VPMOVB2M DAG lowering , use CVT2MASK node instead TRUNCATE.
Fix TRUNCATE lowering vector to vector i1, use LSB and not MSB.
Implement VPMOVB/W/D/Q2M intrinsic.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256470 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-27 13:56:16 +00:00
Asaf Badouh
a026dfe248 [X86][AVX512] change broadcast to use maskable pattern
Differential Revision: http://reviews.llvm.org/D15786



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256469 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-27 12:14:34 +00:00
Chandler Carruth
d97964253e [attrs] Extract the pure inference of function attributes into
a standalone pass.

There is no call graph or even interesting analysis for this part of
function attributes -- it is literally inferring attributes based on the
target library identification. As such, we can do it using a much
simpler module pass that just walks the declarations. This can also
happen much earlier in the pass pipeline which has benefits for any
number of other passes.

In the process, I've cleaned up one particular aspect of the logic which
was necessary in order to separate the two passes cleanly. It now counts
inferred attributes independently rather than just counting all the
inferred attributes as one, and the counts are more clearly explained.

The two test cases we had for this code path are both ... woefully
inadequate and copies of each other. I've kept the superset test and
updated it. We need more testing here, but I had to pick somewhere to
stop fixing everything broken I saw here.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256466 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-27 08:41:34 +00:00
Chandler Carruth
6a1ce8ecd6 [attrs] Split off the forced attributes utility into its own pass that
is (by default) run much earlier than FuncitonAttrs proper.

This allows forcing optnone or other widely impactful attributes. It is
also a bit simpler as the force attribute behavior needs no specific
iteration order.

I've added the pass into the default module pass pipeline and LTO pass
pipeline which mirrors where function attrs itself was being run.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256465 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-27 08:13:45 +00:00
Craig Topper
c8af8d2378 [AVX-512] Remove alernate integer forms for VPERMILPS and VPERMILPD. There no tests for them and I don't see any way to select them anyway. If they are really needed they should be implemented as patterns and not full fledged instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256462 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-27 06:55:08 +00:00
David Majnemer
13f5e7d35c Make the test properly constrained
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256460 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-27 06:26:41 +00:00
NAKAMURA Takumi
aee63adab4 InstrProfTest.cpp: Don't assume string literals are always merged.
MSC18 Debug didn't merge them.

FIXME: I tweaked just to appease a builder. Almost string literals should be addressed identically there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256459 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-27 06:18:57 +00:00
David Majnemer
2b72c52b3f Try to passify buildbot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256458 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-27 06:18:48 +00:00
NAKAMURA Takumi
b6019f26bc Prune the feature "tls". No one is using it since TLS is enabled for Cygwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256457 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-27 06:14:33 +00:00
David Majnemer
1342075082 [X86, Win64] Use a frame pointer if pushf is emitted
A frame pointer must be used if stack pointer is modified after the
prologue.  LLVM will emit pushf/popf if we need to save/restore the
FLAGS register, requiring us to have a frame pointer for the function.

There is a small twist: this sequence might exist in user code via
inline-assembly.  For now, conservatively assume that such functions
require a frame pointer.  For real world justification, please see
clang's implementation of __readeflags.

This fixes PR25945.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256456 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-27 06:07:26 +00:00
David Majnemer
7de4c3d125 [WinEH] Add comments explaining the EH tables
This is aids in debugging WinEH, similar functionality is present for
DWARF EH.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256455 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-27 06:07:12 +00:00
Sanjay Patel
39227c5849 [x86] lower calls to llvm.maxnum.v4f32 using maxps
This is a follow-on to:
http://reviews.llvm.org/rL255700



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256454 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-26 21:44:55 +00:00
Craig Topper
177b35e464 [X86] Fix an unused variable warning in released builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256453 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-26 20:13:33 +00:00
Craig Topper
5608047173 [X86] Add support for printing shuffle comments for AVX512 PSHUFB instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256452 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-26 19:48:43 +00:00
Craig Topper
4e87da88e6 [X86] Fold some variable declarations and initializations into if statements. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256451 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-26 19:48:37 +00:00
Benjamin Kramer
1c6a388c07 Fix safepoint intrinsic signatures in test.
Should bring back the bots after r256443.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256450 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-26 11:40:48 +00:00
Chen Li
955318d58d [gc.statepoint] Change gc.statepoint intrinsic's return type to token type instead of i32 type
Summary: This patch changes gc.statepoint intrinsic's return type to token type instead of i32 type. Using token types could prevent LLVM to merge different gc.statepoint nodes into PHI nodes and cause further problems with gc relocations. The patch also changes the way on how gc.relocate and gc.result look for their corresponding gc.statepoint on unwind path. The current implementation uses the selector value extracted from a { i8*, i32 } landingpad as a hook to find the gc.statepoint, while the patch directly uses a token type landingpad (http://reviews.llvm.org/D15405) to find the gc.statepoint. 

Reviewers: sanjoy, JosephTremoulet, pgavlin, igor-laevsky, mjacob

Subscribers: reames, mjacob, sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256443 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-26 07:54:32 +00:00
Craig Topper
d8ff987182 Add test case for r256433. "[X86] Fix shuffle decoding for variable VPERMIL to be tolerant of the Constant type not matching due to folding in the constant pool and to get VPERMILPD correct."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256435 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-26 04:58:05 +00:00
Craig Topper
7d5d4dd66a Revert r256432 "Test"
This is the test case for r256433, but it got committed incorrectly in my local repo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256434 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-26 04:56:51 +00:00
Craig Topper
eeeb117a90 [X86] Fix shuffle decoding for variable VPERMIL to be tolerant of the Constant type not matching due to folding in the constant pool and to get VPERMILPD correct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256433 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-26 04:50:07 +00:00
Craig Topper
eef8544f1d Test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256432 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-26 04:50:01 +00:00
Craig Topper
a177d3e3a2 [X86] Fix copy and paste typo from pasting from another Makefile to restore code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256431 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 23:27:57 +00:00
Craig Topper
68dc67d007 [X86] Put back the include path to the main X86 sources in the AsmParser library to fix the bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256430 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 22:22:16 +00:00
Craig Topper
ceae661f8f [X86] Remove X86CodeGen dependency from the AsmParser library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256429 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 22:10:11 +00:00
Craig Topper
894bfb2d42 [X86] Move getX86SubSuperRegisterOrZero to X86MCTargetDesc.cpp so it can be used by AsmParser library without depending on X86CodeGen library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256428 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 22:10:08 +00:00
Craig Topper
30e7d038e9 Remove extra forward declarations and scrub includes for all in tree InstPrinters. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256427 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 22:10:01 +00:00
Craig Topper
0270f2bbbf [X86] Move AVX512 STATIC_ROUNDING enum to X86BaseInfo.h to fix a layering violation in AsmParser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256426 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 22:09:49 +00:00
Craig Topper
5f471068e4 [X86] Replace MVT::SimpleValueType in the AsmParser library and getX86SubSuperRegister with just an unsigned representing size.
This a is step towards fixing a layering violation so the X86 AsmParser won't depending on CodeGen types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256425 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 22:09:45 +00:00
Craig Topper
d3c9c4b303 [X86] Don't pass the default value to the High argument of getX86SubSuperRegister. Most place don't care about this argument. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256424 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 19:44:16 +00:00
Davide Italiano
8e798f8001 [llvm-objdump] Use stderr and not stdout for fatal errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256423 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 18:16:45 +00:00
Craig Topper
041d7c3b77 [X86] getX86SubSuperRegisterOrZero shouldn't call getX86SubSuperRegister recursively. It should call itself instead. Otherwise it might fire an assertion when it was designed not too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256422 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 17:07:32 +00:00
Craig Topper
329fa3a529 [X86] Add missing X86II::MRM_C4, MRM_C5, etc. encodings to getMemoryOperandNo. These aren't used by any instructions, but could be someday. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256421 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 17:07:30 +00:00
Craig Topper
b5faf2d296 [X86] Use assert instead of if and llvm_unreachable. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256420 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 17:07:27 +00:00
Craig Topper
c6a8ba4da6 [X86] Minor identation fixes. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256419 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 17:07:24 +00:00
David Majnemer
5af873932e [CodeGen] Use generic printAsOperand machinery instead of hand rolling it
We already know how to properly print out basic blocks in
printAsOperand, we should not roll it ourselves in
AsmPrinter::EmitBasicBlockStart.  No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256413 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 09:37:26 +00:00
Craig Topper
adcf2671f5 [IR] Mark the Type subclass helper methods 'inline' and move their definitions to DerivedTypes.h so they can be inlined by the compiler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256406 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 04:06:20 +00:00
Craig Topper
13b499e588 [Transforms] Use asserts instead of ifs around llvm_unreachable. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256405 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 02:04:17 +00:00
Dan Gohman
005cc9c500 [WebAssembly] Fix handling of COPY instructions in WebAssemblyRegStackify.
Move RegStackify after coalescing and teach it to use LiveIntervals instead
of depending on SSA form. This avoids a problem where a register in a COPY
instruction is stackified and then subsequently coalesced with a register
that is not stackified.

This also puts it after the scheduler, which allows us to simplify the
EXPR_STACK constraint, as we no longer have instructions being reordered
after stackification and before coloring.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256402 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 00:31:02 +00:00
Sanjay Patel
75759ab3e9 [InstCombine] transform more extract/insert pairs into shuffles (PR2109)
This is an extension of the shuffle combining from r203229:
http://reviews.llvm.org/rL203229

The idea is to widen a short input vector with undef elements so the
existing shuffle transform for extract/insert can kick in.

The motivation is to finally solve PR2109:
https://llvm.org/bugs/show_bug.cgi?id=2109

For that example, the IR becomes:

%1 = bitcast <2 x i32>* %P to <2 x float>*
%ld1 = load <2 x float>, <2 x float>* %1, align 8
%2 = shufflevector <2 x float> %ld1, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
%i2 = shufflevector <4 x float> %A, <4 x float> %2, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
ret <4 x float> %i2

And x86 SSE output improves from:

movq	(%rdi), %xmm1           ## xmm1 = mem[0],zero
movdqa	%xmm1, %xmm2
shufps	$229, %xmm2, %xmm2      ## xmm2 = xmm2[1,1,2,3]
shufps	$48, %xmm0, %xmm1       ## xmm1 = xmm1[0,0],xmm0[3,0]
shufps	$132, %xmm1, %xmm0      ## xmm0 = xmm0[0,1],xmm1[0,2]
shufps	$32, %xmm0, %xmm2       ## xmm2 = xmm2[0,0],xmm0[2,0]
shufps	$36, %xmm2, %xmm0       ## xmm0 = xmm0[0,1],xmm2[2,0]
retq

To the almost optimal:

movhpd	(%rdi), %xmm0

Note: There's a tension in the existing transform related to generating
arbitrary shufflevector masks. We avoid that in other places in InstCombine
because we're scared that codegen can't handle strange masks, but it looks
like we're ok with producing those here. I purposely chose weird insert/extract
indexes for the regression tests to see the effect in these cases. 
For PowerPC+Altivec, AArch64, and X86+SSE/AVX, I think the codegen is equal or
better for these examples.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256394 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-24 21:17:56 +00:00
Dave Bartolomeo
21466099e3 Fix signed/unsigned warning in Line.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256390 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-24 19:17:54 +00:00
Dave Bartolomeo
341c84c440 Remove unused constants from TypeTableBuilder.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256389 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-24 19:15:56 +00:00
Bill Seurer
4c2011be7d Fix case of path name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256388 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-24 18:54:35 +00:00
Dave Bartolomeo
23d49e466a Fix CodeView library name and non-CMake builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256387 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-24 18:51:35 +00:00
Dave Bartolomeo
7c20e75d81 Fix initializer order warning in TypeRecord.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256386 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-24 18:25:54 +00:00
Dave Bartolomeo
994a189088 LLVM CodeView library
Summary: This diff is the initial implementation of the LLVM CodeView library. There is much more work to be done, namely a CodeView dumper and tests. This patch should help others make progress on the LLVM->CodeView debug info emission while I continue with the implementation of the dumper and tests.

This library implements support for emitting debug info in the CodeView format. This phase of the implementation only includes support for CodeView type records. Clients that need to emit type records will use a class derived from TypeTableBuilder. TypeTableBuilder provides member functions for writing each kind of type record; each of these functions eventually calls the writeRecord virtual function to emit the actual bits of the record. Derived classes override writeRecord to implement the folding of duplicate records and the actual emission to the appropriate destination. LLVMCodeView provides MemoryTypeTableBuilder, which creates the table in memory. In the future, other classes derived from TypeTableBuilder will write to other destinations, such as the type stream in a PDB.

The rest of the types in LLVMCodeView define the actual CodeView type records and all of the supporting enums and other types used in the type records. The TypeIndex class is of particular interest, because it is used by clients as a handle to a type in the type table.

The library provides a relatively low-level interface based on the actual on-disk format of CodeView. For example, type records refer to other type records by TypeIndex, rather than by an actual pointer to the referent record. This allows clients to emit type records one at a time, rather than having to keep the entire transitive closure of type records in memory until everything has been emitted. At some point, having a higher-level interface layered on top of this one may be useful for debuggers and other tools that want a more holistic view of the debug info. The lower-level interface should be sufficient for compilers and linkers to do the debug info manipulation that they need to do efficiently.

Reviewers: rnk, majnemer

Subscribers: silvas, rnk, jevinskie, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256385 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-24 18:12:38 +00:00