Commit Graph

206442 Commits

Author SHA1 Message Date
Silviu Baranga 65bdb6788b Fix the tests added in r243270. Use 2>&1 instead of |&
llvm-svn: 243273
2015-07-27 15:08:55 +00:00
Alexander Kornienko 102d2c252a [clang-tidy] Set current main file name in tests.
llvm-svn: 243272
2015-07-27 14:54:31 +00:00
Bruno Cardoso Lopes 669c921bfd [PeepholeOptimizer] Look through PHIs to find additional register sources
Reapply r242295 with fixes in the implementation.

- Teaches the ValueTracker in the PeepholeOptimizer to look through PHI
instructions.
- Add findNextSourceAndRewritePHI method to lookup into multiple sources
returnted by the ValueTracker and rewrite PHIs with new sources.

With these changes we can find more register sources and rewrite more
copies to allow coaslescing of bitcast instructions. Hence, we eliminate
unnecessary VR64 <-> GR64 copies in x86, but it could be extended to
other archs by marking "isBitcast" on target specific instructions. The
x86 example follows:

A:
  psllq %mm1, %mm0
  movd  %mm0, %r9
  jmp C

B:
  por %mm1, %mm0
  movd  %mm0, %r9
  jmp C

C:
  movd  %r9, %mm0
  pshufw  $238, %mm0, %mm0

Becomes:

A:
  psllq %mm1, %mm0
  jmp C

B:
  por %mm1, %mm0
  jmp C

C:
  pshufw  $238, %mm0, %mm0

Differential Revision: http://reviews.llvm.org/D11197
rdar://problem/20404526

llvm-svn: 243271
2015-07-27 14:39:46 +00:00
Silviu Baranga 7581d22512 [ARM/AArch64] Fix cost model for interleaved accesses
Summary:
Fix the cost of interleaved accesses for ARM/AArch64.
We were calling getTypeAllocSize and using it to check
the number of bits, when we should have called
getTypeAllocSizeInBits instead.

This would pottentially cause the vectorizer to
generate loads/stores and shuffles which cannot
be matched with an interleaved access instruction.

No performance changes are expected for now since
matching/generating interleaved accesses is still
disabled by default.

Reviewers: rengolin

Subscribers: aemerson, llvm-commits, rengolin

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

llvm-svn: 243270
2015-07-27 14:39:34 +00:00
Aaron Ballman 6db02dd8f0 Trying again to a failing test the bots found with r243266.
llvm-svn: 243269
2015-07-27 13:59:24 +00:00
Aaron Ballman 84b1b00926 Fixing a failing test the bots found with r243266.
llvm-svn: 243268
2015-07-27 13:47:35 +00:00
Daniel Jasper 9fe55a32b7 misc-unused-parameters: Don't warn on ParmVarDecls in the return type.
As there don't seem to be a good way of formulating a matcher that
finds all pairs of functions and their ParmVarDecls, just match on
functionDecls and iterate over their parameters. This should also be
more efficient as some checks are only performed once per function.

llvm-svn: 243267
2015-07-27 13:46:37 +00:00
Aaron Ballman 5a4892b4fa Updating the documentation for clang-tidy. Removes some non-ASCII characters from the documentation, and removes shell-specific single quote characters as they cause issues for some shells (such as on Windows).
llvm-svn: 243266
2015-07-27 13:41:30 +00:00
Alexander Kornienko ae8f23efa8 [clang-tidy] Don't duplicate the leading slash.
llvm-svn: 243265
2015-07-27 13:07:50 +00:00
Simon Pilgrim 81accb7b27 [X86] Reordered lowerVectorShuffleAsBitMask before lowerVectorShuffleAsBlend. NFCI.
Allows us to show diffs for D11518 more clearly

llvm-svn: 243264
2015-07-27 12:37:19 +00:00
Marek Olsak 1354b87695 AMDGPU/SI: Fix the V_FRACT_F64 SI bug workaround
This is a candidate for 3.7.

llvm-svn: 243263
2015-07-27 11:37:42 +00:00
Renato Golin 24ba3e9852 Setting ARM dynamic linker name from commandline
Currently trigger to select hard-float linker is only based of -gnueabihf
appearing in target triplet, but we should also select it when hardfloat
is requested via cmdline.

Patch by Khem Raj.

llvm-svn: 243262
2015-07-27 09:56:37 +00:00
David Majnemer 015ce0f68f [clang-cl] Handle -O correctly
We had multiple bugs here:
- We didn't support multiple optimization options in one argument.
  e.g. -O2y-
- We didn't correctly expand -O[12dx] to their respective options.
- We treated -O1 as clang -O1 instead of clang -Os.
- We treated -Ox as clang -O3 instead of clang -O2.  In fact, cl's -Ox
  option is *less* powerful than cl's -O2 option despite -Ox described
  as "Full Optimization".

This fixes PR24003.

llvm-svn: 243261
2015-07-27 07:32:11 +00:00
Yaron Keren a96ffd5337 Rename highly-confusing isWhitespace that returns false on \n to
isWhitespaceExceptNL. If that's wasn't bad enough, we have an identically 
named function in Basic/CharInfo.h.

While at it, remove unnecessary includes, .str() calls and #ifdef.

llvm-svn: 243260
2015-07-27 06:35:22 +00:00
Richard Smith 9b88a4cdf4 [modules] Add an assert for redeclarations that we never added to their redecl
chain and fix the cases where it fires.

 * Handle the __va_list_tag as a predefined decl. Previously we failed to merge
   sometimes it because it's not visible to name lookup. (In passing, remove
   redundant __va_list_tag typedefs that we were creating for some ABIs. These
   didn't affect the mangling or representation of the type.)

 * For Decls derived from Redeclarable that are not in fact redeclarable
   (implicit params, function params, ObjC type parameters), remove them from
   the list of expected redeclarable decls.

llvm-svn: 243259
2015-07-27 05:40:23 +00:00
NAKAMURA Takumi 94abbbd6ab LoopAccessAnalysis.cpp: Tweak r243239 to avoid side effects. It caused different emissions between gcc and clang.
llvm-svn: 243258
2015-07-27 01:35:30 +00:00
Oleksiy Vyalov e837e6c7f7 Fix jSignalsInfo packet handling.
llvm-svn: 243257
2015-07-27 01:32:58 +00:00
Sean Silva e1c6b549ef Avoid using uncommon acronym "MSROM".
llvm-svn: 243256
2015-07-27 00:46:59 +00:00
David Majnemer b856e8f071 [Targets] Define _M_AMD64 and _M_X64 to a more appropriate value
We used to define them to 1, we should have defined them to 100.

llvm-svn: 243255
2015-07-26 23:17:29 +00:00
Tobias Grosser 2764794ba4 Simplify some isl expression we use
Suggested-by: Sven Verdoolaege <skimo-polly@kotnet.org>
llvm-svn: 243254
2015-07-26 19:22:35 +00:00
Jingyue Wu bfefff555e Roll forward r243250
r243250 appeared to break clang/test/Analysis/dead-store.c on one of the build
slaves, but I couldn't reproduce this failure locally. Probably a false
positive as I saw this test was broken by r243246 or r243247 too but passed
later without people fixing anything.

llvm-svn: 243253
2015-07-26 19:10:03 +00:00
David Majnemer 9d8af4de4c [AST] It should be impossible to get Int128 or UInt128 into VisitIntegerLiteral
These cases should now be impossible as of r243243.

llvm-svn: 243252
2015-07-26 18:33:32 +00:00
Jingyue Wu 84879b71a9 Revert r243250
breaks tests

llvm-svn: 243251
2015-07-26 18:30:13 +00:00
Jingyue Wu bf485f059c [TTI/CostModel] improve TTI::getGEPCost and use it in CostModel::getInstructionCost
Summary:
This patch updates TargetTransformInfoImplCRTPBase::getGEPCost to consider
addressing modes. It now returns TCC_Free when the GEP can be completely folded
to an addresing mode.

I started this patch as I refactored SLSR. Function isGEPFoldable looks common
and is indeed used by some WIP of mine. So I extracted that logic to getGEPCost.

Furthermore, I noticed getGEPCost wasn't directly tested anywhere. The best
testing bed seems CostModel, but its getInstructionCost method invokes
getAddressComputationCost for GEPs which provides very coarse estimation. So
this patch also makes getInstructionCost call the updated getGEPCost for GEPs.
This change inevitably breaks some tests because the cost model changes, but
nothing looks seriously wrong -- if we believe the new cost model is the right
way to go, these tests should be updated.

This patch is not perfect yet -- the comments in some tests need to be updated.
I want to know whether this is a right approach before fixing those details.

Reviewers: chandlerc, hfinkel

Subscribers: aschwaighofer, llvm-commits, aemerson

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

llvm-svn: 243250
2015-07-26 17:28:13 +00:00
Simon Pilgrim 65d35a14b7 [X86][SSE] Refreshed vector bit count tests.
llvm-svn: 243249
2015-07-26 17:02:25 +00:00
Simon Pilgrim 8a9c1d7d88 [X86][AVX2] Refreshed avx2 conversion tests
llvm-svn: 243248
2015-07-26 17:01:16 +00:00
Tobias Grosser 56eab3603a bugpoint: make the number of trim iterations a compile-time constant
Around 10 year ago Chris limited this code to a single iteration by just
dropping a break into the loop body. We now make the number of trim iterations
a compile time constant to be able to play with it and see if this can
improve the bugpoint results. We currently use with '3' still a small and
conservative value, but this can be adjusted in the future, if needed.

I tried to look for a trivial test case, but did not succeed yet.

llvm-svn: 243247
2015-07-26 15:18:45 +00:00
Igor Breger f2460112ad Implemented encoding and intrinsics of the following instructions
vunpckhps/pd, vunpcklps/pd, 
  vpunpcklbw, vpunpckhbw, vpunpcklwd, vpunpckhwd, vpunpckldq, vpunpckhdq, vpunpcklqdq, vpunpckhqdq
Added tests for intrinsics and encoding.

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

llvm-svn: 243246
2015-07-26 14:41:44 +00:00
Johannes Doerfert 210b09aa21 Remove explicit heap allocation to fix and prevent memory leaks
llvm-svn: 243245
2015-07-26 13:14:38 +00:00
Tobias Grosser e692669759 Fix typo in comment
llvm-svn: 243244
2015-07-26 11:37:05 +00:00
David Majnemer 5055dfcf4a [MS Extensions] Remove support for the i128 integer literal suffix
There is currently no support in MSVC for using i128 as an integer
literal suffix.  In fact, there appears to be no evidence that they have
ever supported this feature in any of their compilers.  This was an over
generalization of their actual feature and is a nasty source of bugs.
Why is it a source of bugs?  Because most code in clang expects that
evaluation of an integer constant expression won't give them something
that 'long long' can't represent.  Instead of providing a meaningful
feature, i128 gives us cute ways of exploding the compiler.

llvm-svn: 243243
2015-07-26 09:02:26 +00:00
David Majnemer 0be6bd0f7a [Sema] Refactor AddAlignedAttr to reduce indentation
No functionality change intended, just a tidy-up.

llvm-svn: 243242
2015-07-26 09:02:21 +00:00
Dmitry Vyukov d161fcba17 tsan: fix shift overflow
3<<30 fits into 32-bit unsigned, but does not fit into int.
Found by ubsan.

llvm-svn: 243241
2015-07-26 07:45:26 +00:00
Davide Italiano 4376ddb88e [llvm-dwarfump] Don't rely on global state, part 3.
Some tools used to rely on a global static variable to keep track of the 
return value for main(). I changed llvm-cxxdump to use exit(1)
and Rafael shortly after did the same with llvm-readobj. This is
(yet) another step towards the goal.

llvm-svn: 243240
2015-07-26 05:35:59 +00:00
Adam Nemet 1da7df3700 [LAA] Begin moving the logic of generating checks out of addRuntimeCheck
Summary:
The goal is to start moving us closer to the model where
RuntimePointerChecking will compute and store the checks.  Then a client
can filter the check according to its requirements and then use the
filtered list of checks with addRuntimeCheck.

Before the patch, this is all done in addRuntimeCheck.  So the patch
starts to split up addRuntimeCheck while providing the old API under
what's more or less a wrapper now.

The new underlying addRuntimeCheck takes a collection of checks now,
expands the code for the bounds then generates the code for the checks.

I am not completely happy with making expandBounds static because now it
needs so many explicit arguments but I don't want to make the type
PointerBounds part of LAI.  This should get fixed when addRuntimeCheck
is moved to LoopVersioning where it really belongs, IMO.

Audited the assembly diff of the testsuite (including externals).  There
is a tiny bit of assembly churn that is due to the different order the
code for the bounds is expanded now
(MultiSource/Benchmarks/Prolangs-C/bison/conflicts.s and with LoopDist
on 456.hmmer/fast_algorithms.s).

Reviewers: hfinkel

Subscribers: klimek, llvm-commits

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

llvm-svn: 243239
2015-07-26 05:32:14 +00:00
Yaron Keren 77dc460eec This test failed on ninja-x64-msvc-RA-centos6.
We could probably get this and the previous three disabled in r243237
working on these builders if MSYS was updated to current MSYS2.

llvm-svn: 243238
2015-07-26 05:15:24 +00:00
Yaron Keren d37c0fdea8 Revert three tests enabled on r243236, they fail on clang-x86-win2008-selfhost.
llvm-svn: 243237
2015-07-26 04:59:52 +00:00
Yaron Keren 5a76498729 Enable passing clang tests on Windows/MSYS.
llvm-svn: 243236
2015-07-26 04:36:39 +00:00
Yaron Keren d6a16bb8e7 Fix test running under mingw.
llvm-svn: 243235
2015-07-26 04:09:41 +00:00
David Majnemer 72f8c5e0c9 Try to make the buildbots happy
This test was missing a triple causing it to error out on windows
targets.  They accept a much smaller alignment value.

llvm-svn: 243234
2015-07-26 02:16:35 +00:00
David Majnemer 29c69db760 [Sema] The alignment of an object has an upper bound from the object file format
Don't use the spelling of the alignment attribute to determine whether
or not an alignment amount makes sense.

llvm-svn: 243233
2015-07-26 01:48:59 +00:00
Rui Ueyama 06d7bd2e42 ELF2: Avoid calling std::sort to make output deterministic.
llvm-svn: 243232
2015-07-26 00:50:15 +00:00
Rui Ueyama 179cd7b82a ELF2: Remove dead code.
llvm-svn: 243231
2015-07-26 00:50:13 +00:00
Chaoren Lin 424848cabe XFAIL TestExprOptions on Linux.
llvm-svn: 243230
2015-07-25 22:06:48 +00:00
Rui Ueyama 5e706b3ee3 COFF: Use short identifiers. NFC.
llvm-svn: 243229
2015-07-25 21:54:50 +00:00
Rui Ueyama 5c437cd1e9 COFF: Fix image base address for 32-bit.
0x140000000 or 0x180000000 are not correct image base addresses
for 32-bit. They are actually much smaller.

llvm-svn: 243228
2015-07-25 21:42:33 +00:00
Benjamin Kramer 11a9cd956a [libclang] Use lambdas instead of explicit structs when storing arguments.
This boilerplate code was necessary to move arguments between threads in
C++98, lambdas make this much easier. No functionality change intended.

llvm-svn: 243227
2015-07-25 20:55:44 +00:00
Simon Pilgrim 54fcd62c6f [InstCombine][SSE4A] Standardized references to Length/Width and Index/Start to match AMD docs. NFCI.
llvm-svn: 243226
2015-07-25 20:41:00 +00:00
David Majnemer 3b1c990dcc [AST] Rename RecordLayoutBuilder to ItaniumRecordLayoutBuilder
RecordLayoutBuilder is an inaccruate name because it does not build all
records.  It only builds layouts for targets using the Itanium C++ ABI.

llvm-svn: 243225
2015-07-25 20:18:14 +00:00
Yaron Keren 640e7c99cc Enable clang tests requiring "clang-driver" on mingw.
At least on my mingw system they do pass, let's see what the bots think.

llvm-svn: 243224
2015-07-25 20:05:21 +00:00