Commit Graph

121325 Commits

Author SHA1 Message Date
Sanjay Patel
4b1821fa36 [x86] enable machine combiner reassociations for scalar 'and' insts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246300 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 14:09:48 +00:00
Davide Italiano
a82bdabbf2 [MC] Convert tests to use llvm-readobj --macho-version-min.
As an added bonus this also tests the newly introduced feature.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246296 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 12:40:05 +00:00
Rui Ueyama
c2aa1793ed llvm-readobj: Dump more info for COFF import libraries.
This patch teaches llvm-readobj to print out COFF import file header fields.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246291 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 10:27:50 +00:00
Chandler Carruth
9befb59470 [SROA] Fix PR24463, a crash I introduced in SROA by allowing it to
handle more allocas with loads past the end of the alloca.

I suspect there are some related crashers with slightly different
patterns, but I'll fix those and add test cases as I find them.

Thanks to David Majnemer for the excellent test case reduction here.
Made this super simple to debug and fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246289 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 09:03:52 +00:00
Rui Ueyama
3bc806de10 Attempt to unbreak Win32 build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246284 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 07:48:41 +00:00
Rui Ueyama
40e22518fc Re-apply r246276 - Object: Teach llvm-ar to create symbol table for COFF short import files
This patch includes a fix for a llvm-readobj test. With this patch, 
the tool does no longer print out COFF headers for the short import
file, but that's probably desirable because the header for the short
import file is dummy.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246283 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 07:40:30 +00:00
Steven Wu
109cab4450 Revert r246244 and r246243
These two commits cause clang/llvm bootstrap to hang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246279 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 06:52:00 +00:00
Rui Ueyama
976f3e14bf Rollback r246276 - Object: Teach llvm-ar to create symbol table for COFF short import files
This change caused a test for llvm-readobj to fail.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246277 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 06:03:01 +00:00
Rui Ueyama
e8402a23ca Object: Teach llvm-ar to create symbol table for COFF short import files.
COFF short import files are special kind of files that contains only
DLL-exported symbol names. That's different from object files because
it has no data except symbol names.

This change implements a SymbolicFile interface for the short import
files so that symbol names can be accessed through that interface.
llvm-ar is now able to read the file and create symbol table entries
for short import files.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246276 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 05:47:46 +00:00
NAKAMURA Takumi
d2d41f20f7 LLVMCodeGen: Update libdeps corresponding to r246236.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246274 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 05:38:49 +00:00
Peter Collingbourne
06cc30573e Tweak XFAIL line for mips.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246269 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 04:07:52 +00:00
NAKAMURA Takumi
51c7ae83c6 Kaleidoscope: Prune __attribute__((used)). Some compilers wouldn't accept one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246268 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 03:34:33 +00:00
NAKAMURA Takumi
e8a7097338 Disable llvm/test/Examples/ for now while investigating.
FIXME:
  - Introduce explicit mapping.
  - Investigate crash on win32. Could we introduce crash handler in examples?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246267 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 03:32:43 +00:00
Peter Collingbourne
ef9fc8314e XFAIL parallel.ll test on MIPS and AArch64 until test failures can be investigated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246261 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 02:14:15 +00:00
Ahmed Bougacha
5edf06bb57 [CodeGen] Support (and default to) expanding READCYCLECOUNTER to 0.
For targets that didn't support this, this will let us respect the
langref instead of failing to select.

Note that we don't need to change the 32-bit x86/PPC lowerings (to
account for the result type/# difference) because they're both
custom and bypass type legalization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246258 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 01:49:59 +00:00
Joseph Tremoulet
0bf9bbac45 [WinEH] Update coloring to handle nested cases cleanly
Summary:
Change the coloring algorithm in WinEHPrepare to visit a funclet's exits
in its parents' contexts and so properly classify the continuations of
nested funclets.

Also change the placement of cloned blocks to be deterministic and to
maintain the relative order of each funclet's blocks.

Add a lit test showing various patterns that require cloning, the last
several of which don't have CHECKs yet because they require cloning
entire funclets which is NYI.


Reviewers: rnk, andrew.w.kaylor, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246245 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 01:12:35 +00:00
Piotr Padlewski
bcd94e99ee Constant propagation after hitting assume(cmp) bugfix
Last time code run into assertion `BBE.isSingleEdge()` in
lib/IR/Dominators.cpp:200.

http://reviews.llvm.org/D12170

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246244 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 01:02:00 +00:00
Piotr Padlewski
0f4937c492 Constant propagation after hiting llvm.assume
After hitting @llvm.assume(X) we can:
- propagate equality that X == true
- if X is icmp/fcmp (with eq operation), and one of operand
  is constant we can change all variables with constants in the same BasicBlock

http://reviews.llvm.org/D11918

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246243 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 01:01:57 +00:00
NAKAMURA Takumi
87a13599bb [CMake] Fix build on MSVC in r246156.
add_windows_version_resource_file() affects ALL_FILES. OBJLIB shouldn't have *.obj as SOURCES.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246241 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 00:36:58 +00:00
George Burgess IV
dc5cb4d4ca Fix: CFLAA -- Mark no-args returns as unknown
Prior to this patch, we hadn't been marking StratifiedSets with the
appropriate StratifiedAttrs when handling the result of no-args call
instructions. This caused us to report NoAlias when handed, for
example, an escaped alloca and a result from an opaque function. Now we
properly mark the return value of said functions.

Thanks again to Chandler, Richard, and Nick for pinging me about this.

Differential review: http://reviews.llvm.org/D12408



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246240 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 00:16:18 +00:00
Quentin Colombet
4a93cd8f66 [AArch64][CollectLOH] Fix a regression that prevented us to detect chains of
more than 2 instructions.

I introduced this regression a while back and did not noticed it because I
somehow forgot to push the initial test cases for the pass!

Fix that as well!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246239 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 23:47:10 +00:00
Peter Collingbourne
daf6885fa4 CodeGen: Introduce splitCodeGen and teach LTOCodeGenerator to use it.
llvm::splitCodeGen is a function that implements the core of parallel LTO
code generation. It uses llvm::SplitModule to split the module into linkable
partitions and spawning one code generation thread per partition. The function
produces multiple object files which can be linked in the usual way.

This has been threaded through to LTOCodeGenerator (and llvm-lto for testing
purposes). Separate patches will add parallel LTO support to the gold plugin
and lld.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246236 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 23:37:36 +00:00
Reid Kleckner
c0e64ada5c [WinEH] Add some support for code generating catchpad
We can now run 32-bit programs with empty catch bodies.  The next step
is to change PEI so that we get funclet prologues and epilogues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246235 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 23:27:47 +00:00
Michael J. Spencer
82f1bf2f60 [yaml2obj] Support numeric indexes to create invalid files. Will be used by lld test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246233 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 23:11:20 +00:00
David Majnemer
2cdf5c3e03 [ValueTracking] readnone CallInsts are fair game for speculation
Any call which is side effect free is trivially OK to speculate.  We
already had similar logic in EarlyCSE and GVN but we were missing it
from isSafeToSpeculativelyExecute.

This fixes PR24601.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246232 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 23:03:01 +00:00
Lang Hames
ef38201ab0 Add a global mapping layer for Orc. Adapted from a patch by Andy Somogyi.
Thanks Andy!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246226 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 22:20:05 +00:00
Peter Collingbourne
a74d34a8a9 Support: Introduce thread.h.
This header is a wrapper for <thread> that works around problems with the
MSVC headers when exceptions are disabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246218 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 21:52:31 +00:00
Ahmed Bougacha
69019c5399 [CodeGen] Check FoldConstantArithmetic result before using it.
Fixes PR24602: r245689 introduced an unguarded use of
SelectionDAG::FoldConstantArithmetic, which returns 0 when it fails
because of opaque (hoisted) constants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246217 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 21:46:04 +00:00
Ahmed Bougacha
bfe0f6957b [TableGen][DAGISel] Dedup predicates with same code to run. NFCI.
I locally hit the 255 limit, but a lot of these are redundant: each
predicate coming from a different record was allocated a new number,
even when we already emitted the same code for another predicate.

Instead, re-use numbers and emit the predicate code only once.
This reduces the total text size of *DAGISel.cpp.o by ~1%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246208 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 20:43:34 +00:00
Tyler Nowicki
aa08d66b7b Fix test introduced in r246187 that failed on some systems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246207 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 20:43:29 +00:00
Lang Hames
b6347771b1 Oops - Re-add the Kaleidoscope regression tests themselves (accidentally left
out of r246201).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246203 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 20:33:22 +00:00
Lang Hames
8c46d7964e Recommit r246175 - Add Kaleidoscope regression tests, with a fix to make sure
the kaleidoscope 'library' functions aren't dead-stripped in release builds.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246201 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 20:31:44 +00:00
Erik Schnetter
742f5d8f37 Enable constant propagation for more math functions
Constant propagation for single precision math functions (such as
tanf) is already working, but was not enabled. This patch enables
these for many single-precision functions, and adds respective test
cases.

Newly handled functions: acosf asinf atanf atan2f ceilf coshf expf
exp2f fabsf floorf fmodf logf log10f powf sinhf tanf tanhf


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246194 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 19:56:57 +00:00
Erik Schnetter
e34ade50ea Revert 246186; still breaks on some systems
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246191 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 19:34:14 +00:00
Tyler Nowicki
5e59aab216 Improve vectorization diagnostic messages and extend vectorize(enable) pragma.
This patch changes the analysis diagnostics produced when loops with
floating-point recurrences or memory operations are identified. The new messages 
say "cannot prove it is safe to reorder * operations; allow reordering by
specifying #pragma clang loop vectorize(enable)". Depending on the type of 
diagnostic the message will include additional options such as ffast-math or
__restrict__.

This patch also allows the vectorize(enable) pragma to override the low pointer
memory check threshold. When the hint is given a higher threshold is used.

See the clang patch for the options produced for each diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246187 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 18:56:49 +00:00
Erik Schnetter
75e205d682 Enable constant propagation for more math functions
Constant propagation for single precision math functions (such as
tanf) is already working, but was not enabled. This patch enables
these for many single-precision functions, and adds respective test
cases.

Newly handled functions: acosf asinf atanf atan2f ceilf coshf expf
exp2f fabsf floorf fmodf logf log10f powf sinhf tanf tanhf


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246186 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 18:56:23 +00:00
Lang Hames
38941a6a20 Revert r246175 to get builder green again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246185 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 18:54:41 +00:00
Ahmed Bougacha
631949892f [TableGen] Remove dead code. NFC.
The only user of this was removed in r129670.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246176 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 18:14:21 +00:00
Lang Hames
b325a1ace5 Add Kaleidoscope regression tests.
These will be run if LLVM_BUILD_EXAMPLES is enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246175 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 18:13:34 +00:00
Matt Arsenault
2b96ce62f4 AMDGPU/SI: Add test for folding constants into operands
Patch by Axel Davy

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246167 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 17:41:27 +00:00
Erik Schnetter
7f284a9aaf Revert r246158 since it breaks LLVM.Transforms/ConstProp.calls.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246166 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 17:24:01 +00:00
Jonathan Roelofs
61f7047c52 Fix a case of CHECK[^:]*$.
http://reviews.llvm.org/D11917


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246163 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 17:03:14 +00:00
Erik Schnetter
6164af29bb Enable constant propagation for more math functions
Constant propagation for single precision math functions (such as
tanf) is already working, but was not enabled. This patch enables
these for many single-precision functions, and adds respective test
cases.

Newly handled functions: acosf asinf atanf atan2f ceilf coshf expf
exp2f fabsf floorf fmodf logf log10f powf sinhf tanf tanhf


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246158 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 16:36:37 +00:00
NAKAMURA Takumi
68027c4618 [CMake] OBJLIB-ize *-tblgen.
This improves dependency chain of;

  (LLVMSupport && LLVMTableGen) && (*.cpp in *-tblgen) && (linking *-tblgen)

with;

  (LLVMSupport && LLVMTableGen && *.cpp) && (linking *-tblgen)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246156 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 16:10:47 +00:00
Chad Rosier
ff123881d2 [LoopVectorize] Move test from r246149 into a target-specific folder to appease bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246154 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 15:24:47 +00:00
NAKAMURA Takumi
251477e918 [CMake] Let ExceptionDemo buildable with ENABLE_EH.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246152 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 15:13:14 +00:00
Davide Italiano
7dbe74f4e3 [llvm-readobj] Add support for dumping MachO min version load command.
Example output:
File: <stdin>
Format: Mach-O arm
Arch: arm
AddressSize: 32bit
MinVersion {
  Cmd: LC_VERSION_MIN_IPHONEOS
  Size: 16
  Version: 99.8.7
  SDK: n/a
}

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246151 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 15:11:32 +00:00
Chad Rosier
ed15c79fb6 [LoopVectorize] Add Support for Small Size Reductions.
Unlike scalar operations, we can perform vector operations on element types that
are smaller than the native integer types. We type-promote scalar operations if
they are smaller than a native type (e.g., i8 arithmetic is promoted to i32
arithmetic on Arm targets). This patch detects and removes type-promotions
within the reduction detection framework, enabling the vectorization of small
size reductions.

In the legality phase, we look through the ANDs and extensions that InstCombine
creates during promotion, keeping track of the smaller type. In the
profitability phase, we use the smaller type and ignore the ANDs and extensions
in the cost model. Finally, in the code generation phase, we truncate the result
of the reduction to allow InstCombine to rewrite the entire expression in the
smaller type.

This fixes PR21369.
http://reviews.llvm.org/D12202

Patch by Matt Simpson <mssimpso@codeaurora.org>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246149 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 14:12:17 +00:00
James Molloy
18671a3a8f [LoopVectorize] Extract InductionInfo into a helper class...
... and move it into LoopUtils where it can be used by other passes, just like ReductionDescriptor. The API is very similar to ReductionDescriptor - that is, not very nice at all. Sorting these both out will come in a followup.

NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246145 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 09:53:00 +00:00
Alex Rosenberg
c20a7982e0 Whoops, remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246141 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 05:37:12 +00:00