Commit Graph

182760 Commits

Author SHA1 Message Date
Benjamin Kramer 1009df42c0 Edit: Do not extend a removal to include trailing whitespace if we're at the end
of the file.

This would run past the end of the buffer. Sadly I don't have a great way to
test it, the only way to trigger the bug is having a removal fix it at the end
of the file, which none of our current warnings can generate.

llvm-svn: 217766
2014-09-15 11:47:10 +00:00
Chandler Carruth 00b1e0fc9d [x86] Add an explicit SSE3 run to this test and flesh out a bunch of
missing specific checks.

While there is a lot of redundancy here where all-but-one mode use the
same code generation, I'd rather have each variant spelled out and
checked so that readers aren't misled by an omission in the test suite.

llvm-svn: 217765
2014-09-15 11:40:20 +00:00
Evgeniy Stepanov bc496dab07 [asan] Delay system log initialization on Android.
Writing to system log requires libc interceptors to be initialized.
Fixes crashes with verbosity=1 on newer Android builds.

llvm-svn: 217764
2014-09-15 11:37:40 +00:00
Ehsan Akhgari c4f23419bb Avoid calling strtoll and atoll in asan_str_test.cc on Windows for now
Summary:
These two functions are unavailable on MSVC2012, which breaks building the
ASAN tests with MSVC2012.  Since the tests required to run these functions
are disabled on Windows for now, avoid building them to fix the MSVC2012
builds.

Test Plan: This is needed in order to fix building the ASAN tests with MSVC2012.

Reviewers: timurrrr

Subscribers: llvm-commits

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

llvm-svn: 217763
2014-09-15 11:34:12 +00:00
Ehsan Akhgari 47d260962f Port the variadic std::tr1::tuple hack for building gtest for MSVC2012 to ASAN tests.
Summary: This is copied from llvm/utils/unittest/CMakeLists.txt.

Test Plan: This partly enables building ASAN tests with MSVC2012.

Reviewers: timurrrr

Subscribers: llvm-commits

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

llvm-svn: 217762
2014-09-15 11:33:50 +00:00
Chandler Carruth 12d4a70cbd [x86] Teach the x86 DAG combiner to form UNPCKLPS and UNPCKHPS
instructions from the relevant shuffle patterns.

This is the last tweak I'm aware of to generate essentially perfect
v4f32 and v2f64 shuffles with the new vector shuffle lowering up through
SSE4.1. I'm sure I've missed some and it'd be nice to check since v4f32
is amenable to exhaustive exploration, but this is all of the tricks I'm
aware of.

With AVX there is a new trick to use the VPERMILPS instruction, that's
coming up in a subsequent patch.

llvm-svn: 217761
2014-09-15 11:26:25 +00:00
James Molloy 0ffb093931 [ARM] Add ACLE predefines: maxmin, rounding and h/w integer division
Patch by Assad Hashmi!

llvm-svn: 217760
2014-09-15 11:25:38 +00:00
Daniel Jasper c58c70e2f3 clang-format: Basic support for Java.
llvm-svn: 217759
2014-09-15 11:21:46 +00:00
Chandler Carruth 41a25dd7ef [x86] Teach the x86 DAG combiner to form MOVSLDUP and MOVSHDUP
instructions when it finds an appropriate pattern.

These are lovely instructions, and its a shame to not use them. =] They
are fast, and can hand loads folded into their operands, etc.

I've also plumbed the comment shuffle decoding through the various
layers so that the test cases are printed nicely.

llvm-svn: 217758
2014-09-15 11:15:23 +00:00
Daniel Jasper ac043c900c clang-format: Add option to break before non-assignment operators.
This will allow:
  int aaaaaaaaaaaaaa =
      bbbbbbbbbbbbbb
      + ccccccccccccccc;

llvm-svn: 217757
2014-09-15 11:11:00 +00:00
Frederic Riss 5bfe02c632 Fix a non-virtual destructor warning introduced in r217747.
llvm-svn: 217756
2014-09-15 10:38:13 +00:00
Chandler Carruth 35e3b545d6 [x86] Undo a flawed transform I added to form UNPCK instructions when
AVX is available, and generally tidy up things surrounding UNPCK
formation.

Originally, I was thinking that the only advantage of PSHUFD over UNPCK
instruction variants was its free copy, and otherwise we should use the
shorter encoding UNPCK instructions. This isn't right though, there is
a larger advantage of being able to fold a load into the operand of
a PSHUFD. For UNPCK, the operand *must* be in a register so it can be
the second input.

This removes the UNPCK formation in the target-specific DAG combine for
v4i32 shuffles. It also lifts the v8 and v16 cases out of the
AVX-specific check as they are potentially replacing multiple
instructions with a single instruction and so should always be valuable.
The floating point checks are simplified accordingly.

This also adjusts the formation of PSHUFD instructions to attempt to
match the shuffle mask to one which would fit an UNPCK instruction
variant. This was originally motivated to allow it to match the UNPCK
instructions in the combiner, but clearly won't now.

Eventually, we should add a MachineCombiner pass that can form UNPCK
instructions post-RA when the operand is known to be in a register and
thus there is no loss.

llvm-svn: 217755
2014-09-15 10:35:41 +00:00
Evgeniy Stepanov 7a8330e7bf [asan] Fix path in test.
llvm-svn: 217754
2014-09-15 09:33:20 +00:00
Evgeniy Stepanov 207930d345 [asan] Disable wait4 test on Android.
https://code.google.com/p/memory-sanitizer/issues/detail?id=64

llvm-svn: 217753
2014-09-15 09:20:15 +00:00
Chandler Carruth 44e64b5267 [x86] Teach the new vector shuffle lowering to use 'punpcklwd' and
'punpckhwd' instructions when suitable rather than falling back to the
generic algorithm.

While we could canonicalize to these patterns late in the process, that
wouldn't help when the freedom to use them is only visible during
initial lowering when undef lanes are well understood. This, it turns
out, is very important for matching the shuffle patterns that are used
to lower sign extension. Fixes a small but relevant regression in
gcc-loops with the new lowering.

When I changed this I noticed that several 'pshufd' lowerings became
unpck variants. This is bad because it removes the ability to freely
copy in the same instruction. I've adjusted the widening test to handle
undef lanes correctly and now those will correctly continue to use
'pshufd' to lower. However, this caused a bunch of churn in the test
cases. No functional change, just churn.

Both of these changes are part of addressing a general weakness in the
new lowering -- it doesn't sufficiently leverage undef lanes. I've at
least a couple of patches that will help there at least in an academic
sense.

llvm-svn: 217752
2014-09-15 09:02:37 +00:00
Frederic Riss 65379c564d Fix ambiguous typedef introduced in r217747.
Use fully qualified name inside a typedef from llvm::iterator_range<...> to
iterator_range. This is reported (rightly I think) by GCC as an
ambiguous name redefinition. Hope this fixes the buildbots.

llvm-svn: 217751
2014-09-15 08:23:07 +00:00
David Majnemer a315bd80c2 InstSimplify: Simplify trivial and/or of icmps
Some ICmpInsts when anded/ored with another ICmpInst trivially reduces
to true or false depending on whether or not all integers or no integers
satisfy the intersected/unioned range.

This sort of trivial looking code can come about when InstCombine
performs a range reduction-type operation on sdiv and the like.

This fixes PR20916.

llvm-svn: 217750
2014-09-15 08:15:28 +00:00
Frederic Riss dd7aec5dde Fix DebugInfo replaceAllUsesWith.
Summary:
replaceAllUsesWith had been modified to allow a DbgNode value to be
replaced by itself. In that case a new node is created by copying the
current DbgNode and the copy is used as replacement value.

When that copying happens, the value stored in this->DbgNode at the end
of RAUW would be a reference to the Node that has just been deleted.

This doesn't produce any bug right now, because the DI node on which we
call RAUW won't be used again.

Reviewers: dblaikie, echristo, aprantl

Subscribers: llvm-commits

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

llvm-svn: 217749
2014-09-15 07:50:42 +00:00
Frederic Riss 36acf0fb8b Move replaceAllUsesWith() from DIType to DIDescriptor.
RAUW was only used on DIType to merge declarations and full definitions
of types. In order to support the same functionality for functions and
global variables, move the function up type DI type hierarchy to the
common parent of DIType, DISubprogram and DIVariable which is
DIDescriptor.

This functionality will be exercized when we add the code to emit
imported declarations for forward declared function/variables.

Reviewers: echristo, dblaikie, aprantl

Subscribers: llvm-commits

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

llvm-svn: 217748
2014-09-15 07:50:36 +00:00
Frederic Riss 4e126a0011 Introduce the DWARFUnitSection abstraction.
A DWARFUnitSection is the collection of Units that have been extracted from
the same debug section.

By embeding a reference to their DWARFUnitSection in each unit, the DIEs
will be able to resolve inter-unit references by interrogating their Unit's
DWARFUnitSection.

This is a minimal patch where the DWARFUnitSection is-a SmallVector of Units,
thus exposing exactly the same interface as before. Followup-up patches might
change from inheritance to composition in order to expose only the wanted
DWARFUnitSection abstraction.

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

llvm-svn: 217747
2014-09-15 07:50:27 +00:00
Justin Bogner 7dad93bec2 llvm-cov: Clean up some redundancy in the view API (NFC)
This removes the need to pass a starting and ending line when creating
a SourceCoverageView, since these are easy to determine.

llvm-svn: 217746
2014-09-15 03:41:04 +00:00
Justin Bogner aee36f9439 llvm-cov: Simplify CounterMappingRegion, pushing logic to its user
A single function in SourceCoverageDataManager was the only user of
some of the comparisons in CounterMappingRegion, and at this point we
know that only one file is relevant. This lets us use slightly simpler
logic directly in the client.

llvm-svn: 217745
2014-09-15 03:41:01 +00:00
Chandler Carruth 0a98790b32 [x86] Teach the new vector shuffle lowering to use BLENDPS and BLENDPD.
These are super simple. They even take precedence over crazy
instructions like INSERTPS because they have very high throughput on
modern x86 chips.

I still have to teach the integer shuffle variants about this to avoid
so many domain crossings. However, due to the particular instructions
available, that's a touch more complex and so a separate patch.

Also, the backend doesn't seem to realize it can commute blend
instructions by negating the mask. That would help remove a number of
copies here. Suggestions on how to do this welcome, it's an area I'm
less familiar with.

llvm-svn: 217744
2014-09-14 23:43:33 +00:00
JF Bastien 87ebb6859c Make test/Driver hermetic
Summary:
The includes shouldn't be there, use the compiler's built-in types/macros instead.

This is a follow-up to r217694, as discussed in:
  http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140908/114669.html

Test Plan: ninja check-clang

Reviewers: nlewycky, thakis, echristo, chandlerc

Subscribers: cfe-commits

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

llvm-svn: 217743
2014-09-14 23:42:15 +00:00
NAKAMURA Takumi da86d7c26b llvm/test/CodeGen/X86/vec_shuffle-38.ll: Add explicit -mtriple=x86_64-unknown to avoid incompatibility of win32.
llvm-svn: 217742
2014-09-14 23:39:01 +00:00
Chandler Carruth f2a92921f9 [x86] Add an SSE41 mode to this test. Nothing interesting here, its the
same as SSE3.

llvm-svn: 217741
2014-09-14 23:28:12 +00:00
Chandler Carruth b396922647 [x86] Switch this test to use an ALL prefix with special SSE2 and SSE3
variants where significant.

This will make it more obvious what is happening when we start using
blends in SSE41.

llvm-svn: 217740
2014-09-14 23:19:37 +00:00
Chandler Carruth da5ce5cad8 [x86] Add some test cases where we should emit blendpd in SSE4.1. No
actual change yet though.

llvm-svn: 217739
2014-09-14 23:15:52 +00:00
Chandler Carruth 47ebd24e24 [x86] Teach the vector combiner that picks a canonical shuffle from to
support transforming the forms from the new vector shuffle lowering to
use 'movddup' when appropriate.

A bunch of the cases where we actually form 'movddup' don't actually
show up in the test results because something even later than DAG
legalization maps them back to 'unpcklpd'. If this shows back up as
a performance problem, I'll probably chase it down, but it is at least
an encoded size loss. =/

To make this work, also always do this canonicalizing step for floating
point vectors where the baseline shuffle instructions don't provide any
free copies of their inputs. This also causes us to canonicalize
unpck[hl]pd into mov{hl,lh}ps (resp.) which is a nice encoding space
win.

There is one test which is "regressed" by this: extractelement-load.
There, the test case where the optimization it is testing *fails*, the
exact instruction pattern which results is slightly different. This
should probably be fixed by having the appropriate extract formed
earlier in the DAG, but that would defeat the purpose of the test.... If
this test case is critically important for anyone, please let me know
and I'll try to work on it. The prior behavior was actually contrary to
the comment in the test case and seems likely to have been an accident.

llvm-svn: 217738
2014-09-14 22:41:37 +00:00
Yaron Keren 66b0cebf7f In DwarfEHPrepare, after all passes are run, RewindFunction may be a dangling
pointer to a dead function. To make sure it's valid, doFinalization nullptrs
RewindFunction just like the constructor and so it will be found on next run.

llvm-svn: 217737
2014-09-14 20:36:28 +00:00
Matt Arsenault f620a575bf R600/SI: Fix broken check lines
llvm-svn: 217736
2014-09-14 18:32:05 +00:00
James Molloy 05ce999134 [A57FPLoadBalancing] Modify r217689 - actually we do need to check defs
... Just make sure we check uses first so we see the kill first. It
turns out ignoring defs gives some pretty nasty runtime failures.
I'm certain this is the fix but I'm still reducing a testcase.

llvm-svn: 217735
2014-09-14 18:24:26 +00:00
Ed Maste 279ebe2ded Correct typo in tutorial page
llvm-svn: 217733
2014-09-14 00:56:13 +00:00
Juergen Ributzka 85c1f84650 [FastISel][AArch64] Add support for non-native types for logical ops.
Extend the logical ops selection to also support non-native types such as i1,
i8, and i16.

Fixes rdar://problem/18330589.

llvm-svn: 217732
2014-09-13 23:46:28 +00:00
Nick Lewycky 9e6d184803 Add control of function merging to the PMBuilder.
llvm-svn: 217731
2014-09-13 21:46:00 +00:00
Matt Arsenault 5d26d04357 Fix typo
llvm-svn: 217730
2014-09-13 19:58:27 +00:00
Johannes Doerfert 377a620f98 Compute and print the minimal loop carried dependency distance
During the IslAst parallelism check also compute the minimal dependency
  distance and store it in the IstAst for node.

Reviewer: sebpop

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

llvm-svn: 217729
2014-09-13 17:34:11 +00:00
Tobias Grosser 230acc4445 Delinearize _all_ accesses to a multi-dimensional array
Even though we previously correctly detected the multi-dimensional access
pattern for accesses with a certain base address, we only delinearized
non-affine accesses to this address. Affine accesses have not been touched and
remained as single dimensional accesses. The result was an inconsistent
description of accesses to the same array, with some being one dimensional and
some being multi-dimensional.

This patch ensures that all accesses are delinearized with the same
dimensionality as soon as a single one of them has been detected as non-affine.

While writing this patch, it became evident that the options
-polly-allow-nonaffine and -polly-detect-keep-going have not been properly
supported in case delinearization has been turned on. This patch adds relevant
test coverage and addresses these issues as well. We also added some more
documentation to the functions that are modified in this patch.

This fixes llvm.org/PR20123

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

llvm-svn: 217728
2014-09-13 14:47:55 +00:00
Tobias Grosser bcd4efffa7 Check that the elements of an array have the same size
At the moment we assume that only elements of identical size are stored/loaded
to a certain base pointer. This patch adds logic to the scop detection to verify
this.

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

llvm-svn: 217727
2014-09-13 14:47:40 +00:00
Benjamin Kramer 0bd147da17 Simplify code. No functionality change.
llvm-svn: 217726
2014-09-13 12:38:49 +00:00
Chad Rosier ce65c060e7 [AArch64] Update test case to pass with post-RA MI scheduler.
Check that the post RA scheduler is being skipped, regardless of
whether it's the top-down list latency scheduler or the post-RA
MI scheduler.

llvm-svn: 217725
2014-09-13 03:23:23 +00:00
Nick Kledzik 3df5fb812c [llvm-objdump] Use PRIX64 with format()
llvm-svn: 217724
2014-09-13 00:18:40 +00:00
Jim Ingham ead45ccc2c Nope, I was right originally. ResolveUsername should resolve "~" to the
current user, and ResolvePartialUsername will resolve "~" to the list of
users.

llvm-svn: 217723
2014-09-12 23:50:36 +00:00
Jim Ingham 1adba8b6e3 Don't make paths with /Foo//bar, that confuses everybody down the line.
This gets the file completer for absolute paths working again.

llvm-svn: 217722
2014-09-12 23:39:38 +00:00
Zachary Turner cf3f3683f8 Fix incorrect initializer list style.
llvm-svn: 217721
2014-09-12 23:10:33 +00:00
Jim Ingham 2f21bbc804 Revert 217719, that wasn't the right fix, that should complete user names, and
anyway /Vol doesn't complete correctly either.  Somehow we're chopping the names
up incorrectly before passing them into the completer.

llvm-svn: 217720
2014-09-12 23:04:40 +00:00
Jim Ingham 2614db1a13 ResolveUsername should resolve "~" to the user's home directory as well as "~/". This
gets command-line file completion from ~ working again.

llvm-svn: 217719
2014-09-12 22:59:05 +00:00
Enrico Granata 7506dc06f4 std::function is a better choice than a raw function pointer here. You probably still want to be careful about cleaning up stuff you captured, but it's not like a function pointer wasn't going to let you shoot yourself in the foot given enough dedication.
llvm-svn: 217718
2014-09-12 22:56:52 +00:00
Todd Fiala 7206c6d11f llgs: fix thread names broken by recent native thread changes.
* Fixes the local stack variable return pointer usage in NativeThreadLinux::GetName().
* Changes NativeThreadProtocol::GetName() to return a std::string.
* Adds a unit test to verify thread names don't regress in the future.  Currently only run on Linux since I know default thread names there.

llvm-svn: 217717
2014-09-12 22:51:49 +00:00
Richard Trieu 8a0c9e6247 Check delegating constructors for using uninitialized fields.
llvm-svn: 217716
2014-09-12 22:47:58 +00:00