Commit Graph

206270 Commits

Author SHA1 Message Date
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
Simon Pilgrim 357b85c926 [InstCombine] Split off SSE4a tests.
These aren't vector demanded bits tests. More tests to follow.

llvm-svn: 243223
2015-07-25 17:14:01 +00:00
Benjamin Kramer a37e765497 [VTableBuilder] Use range-based for loops. No functional change intended
llvm-svn: 243222
2015-07-25 17:10:49 +00:00
Benjamin Kramer 0cfa68e01b [VTableBuilder] Turn functors into lambdas
No functional change intended.

llvm-svn: 243221
2015-07-25 16:31:30 +00:00
Benjamin Kramer 882b964aaf Add missing namespace specifiers.
llvm-svn: 243220
2015-07-25 15:44:23 +00:00
Benjamin Kramer 4665c29b81 Upgrade for Clang API change.
llvm-svn: 243219
2015-07-25 15:33:17 +00:00
Benjamin Kramer 1d38be985a Capture 'this' so GCC 4.7 can find a static members.
llvm-svn: 243218
2015-07-25 15:27:04 +00:00
Benjamin Kramer 6e4f6e1f06 [AST] Turn the callbacks of lookupInBases and forallBases into a function_ref
This lets us pass functors (and lambdas) without void * tricks. On the
downside we can't pass CXXRecordDecl's Find* members (which are now type
safe) to lookupInBases directly, but a lambda trampoline is a small
price to pay. No functionality change intended.

llvm-svn: 243217
2015-07-25 15:07:25 +00:00
Simon Pilgrim 944a5777bb [X86][SSE] Added additional vector sign/zero load extension tests.
llvm-svn: 243216
2015-07-25 14:07:20 +00:00
Tobias Grosser bb853c24b1 Fix formatting of recent alias-analysis commit
llvm-svn: 243215
2015-07-25 12:31:03 +00:00
Tobias Grosser 3b10c94062 Prevectorize the schedule of the band (or the point loop in case of tiling)
Contributed-by: Roman Gareev <gareevroman@gmail.com>
llvm-svn: 243214
2015-07-25 12:28:56 +00:00
Benjamin Kramer 9a9efbafa7 [Modules] Wrap the main ModuleManager visitor in a function_ref.
Avoids the awkward passing of an opaque void *UserData argument. No
functional change intended.

llvm-svn: 243213
2015-07-25 12:14:04 +00:00
Simon Pilgrim 20dc35aff6 [X86][SSE] Added additional vector sign/zero extension tests.
llvm-svn: 243212
2015-07-25 11:17:35 +00:00
Simon Atanasyan 9191a84392 [Mips] Define _DYNAMIC_LINKING symbol if output is a is dynamically linked executable file
llvm-svn: 243211
2015-07-25 10:18:52 +00:00
Simon Atanasyan 8e24577100 [Mips] Remove redundant separate functions to calculate relocations. Do
that inline.

No functional changes.

llvm-svn: 243210
2015-07-25 10:18:44 +00:00
Simon Atanasyan 4504791890 [Mips] Remove duplicated code by joining the same functions
llvm-svn: 243209
2015-07-25 10:18:39 +00:00
Simon Atanasyan 3b6ea7ab4a [Mips] Do not sign-extend addends read from RELA relocation records
llvm-svn: 243208
2015-07-25 10:18:33 +00:00
David Majnemer bac941c4b1 [clang-cl] Add fallback support for /Zl
llvm-svn: 243207
2015-07-25 06:07:59 +00:00
David Majnemer 6cd35912c0 [CodeGen] Don't UBSan-ize the argument to __builtin_frame_address
__builtin_frame_address requires its argument to be a constant
expression which already implies that it cannot have undefined behavior.
However, we used EmitScalarExpr to emit the argument causing UBSan to
try to check for overflow.

Instead, use the constant expression emission system.

This fixes PR24256.

llvm-svn: 243206
2015-07-25 05:57:24 +00:00
Rui Ueyama 3dd9372d2b COFF: ARM: Support import functions.
llvm-svn: 243205
2015-07-25 03:39:29 +00:00
Rui Ueyama cde7a7907e COFF: ARM: Implement BLX23T relocation.
llvm-svn: 243204
2015-07-25 03:25:28 +00:00
Chen Li 145c2f57ae [LoopUnswitch] Improve loop unswitch pass to find trivial unswitch conditions more effectively
Summary:
This patch improves trivial loop unswitch. 

The current trivial loop unswitch only checks if loop header's terminator contains a trivial unswitch condition. But if the loop header only has one reachable successor (due to intentionally or unintentionally missed code simplification), we should consider the successor as part of the loop header. Therefore, instead of stopping at loop header's terminator, we should keep traversing its successors within loop until reach a *real* conditional branch or switch (whose condition can not be constant folded). This change will enable a single -loop-unswitch pass to unswitch multiple trivial conditions (unswitch one trivial condition could open opportunity to unswitch another one in the same loop), while the old implementation can unswitch only one per pass. 

Reviewers: reames, broune

Subscribers: llvm-commits

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

llvm-svn: 243203
2015-07-25 03:21:06 +00:00
Rui Ueyama 3d9c8639c3 COFF: ARM: Implement BRANCH24T relocation.
llvm-svn: 243202
2015-07-25 03:19:34 +00:00