Commit Graph

216418 Commits

Author SHA1 Message Date
Tobias Grosser 4927c8e606 ScopInfo: Add option to ignore integer wrapping
llvm-svn: 253976
2015-11-24 12:50:02 +00:00
Matt Arsenault ff05da806c AMDGPU: Split LDS vector loads
If properly aligned this could allow using ds_read_b64.

llvm-svn: 253975
2015-11-24 12:18:54 +00:00
Matt Arsenault 4d801cd357 AMDGPU: Split x8 and x16 vector loads instead of scalarize
The one regression in the builtin tests is in the read2 test which now
(again) has many extra copies, but this should be solved once the pass
is replaced with a DAG combine.

llvm-svn: 253974
2015-11-24 12:05:03 +00:00
Omair Javaid 9d0f44bf8a Disable forcing -marm (A32 instruction set) while running testsuite on arm targets.
Differential revision: http://reviews.llvm.org/D14823

llvm-svn: 253973
2015-11-24 10:35:03 +00:00
Vasileios Kalintiris 08010b5a0c Use libcxx's default rune table with the Musl C library.
Summary:
Also, there are no exported character type tables from Musl so we have to
Fallback to the standard functions. This reduces the number of libcxx's
test-suite failures down to ~130 for MIPS. Most of the remaining failures
come from the atomics (due to the lack of 8-byte atomic-ops in MIPS32) and
thread tests.

Reviewers: mclow.lists, EricWF, dalias, jroelofs

Subscribers: tberghammer, danalbert, srhines, cfe-commits

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

llvm-svn: 253972
2015-11-24 10:24:54 +00:00
George Rimar e3336c0be6 Reapply fixed r253967.
llvm-svn: 253971
2015-11-24 10:15:50 +00:00
George Rimar 11721ce810 Revert r253967 which broke buildbot.
llvm-svn: 253970
2015-11-24 10:04:22 +00:00
Ismail Donmez 65487e2d7e Fix build after r253954
llvm-svn: 253969
2015-11-24 09:48:09 +00:00
Pavel Labath e3af02695d Fix non-PIC build after 253959
CMAKE_EXE_LINKER_FLAGS is a string. Appending a flag using list(APPEND) introduces an extra
semicolon which breaks stuff. Change this to append the value in the same way that everyone else
seems to be doing.

llvm-svn: 253968
2015-11-24 09:46:01 +00:00
George Rimar 63a6ca9150 [ELF] Implements -z relro: create an ELF "PT_GNU_RELRO" segment header in the object.
Partial (-z relro) and full (-z relro, -z now) relro cases are implemented.

Partial relro:
The ELF sections are reordered so that the ELF internal data sections (.got, .dtors, etc.) precede the program's data sections (.data and .bss).
.got is readonly, .got.plt is still writeable.

Full relro:
Supports all the features of partial RELRO, .got.plt is also readonly.

Differential revision: http://reviews.llvm.org/D14218

llvm-svn: 253967
2015-11-24 09:44:28 +00:00
George Rimar 77d1cb1ddf [ELF2] - Optimization for R_X86_64_GOTTPOFF relocation.
R_X86_64_GOTTPOFF is not always requires GOT entries. Some relocations can be converted to local ones.

Differential revision: http://reviews.llvm.org/D14713

llvm-svn: 253966
2015-11-24 09:00:06 +00:00
Cong Hou 1938f2eb98 Let SelectionDAG start to use probability-based interface to add successors.
The patch in http://reviews.llvm.org/D13745 is broken into four parts:

1. New interfaces without functional changes.
2. Use new interfaces in SelectionDAG, while in other passes treat probabilities
as weights.
3. Use new interfaces in all other passes.
4. Remove old interfaces.

This the second patch above. In this patch SelectionDAG starts to use
probability-based interfaces in MBB to add successors but other MC passes are
still using weight-based interfaces. Therefore, we need to maintain correct
weight list in MBB even when probability-based interfaces are used. This is
done by updating weight list in probability-based interfaces by treating the
numerator of probabilities as weights. This change affects many test cases
that check successor weight values. I will update those test cases once this
patch looks good to you.


Differential revision: http://reviews.llvm.org/D14361

llvm-svn: 253965
2015-11-24 08:51:23 +00:00
Craig Topper 5712d46114 [TableGen] Use std::remove_if instead of manually coded loops that call erase multiple times. NFC
llvm-svn: 253964
2015-11-24 08:20:47 +00:00
Craig Topper 16f1cbd1e4 [TableGen] Use the other version of EnforceVectorEltTypeIs inside the TypeSet version of EnforceVectorEltTypeIs to reduce duplicated code. NFC
llvm-svn: 253963
2015-11-24 08:20:45 +00:00
Craig Topper dbfcc10e44 [TableGen] Fix formatting and use logical OR. NFC
llvm-svn: 253962
2015-11-24 08:20:44 +00:00
Craig Topper fef745c36a [TableGen] Use std::set_intersection to merge TypeSets. NFC
llvm-svn: 253961
2015-11-24 08:20:42 +00:00
Craig Topper 4856c81b46 [TableGen] Use SmallVector::assign instead of a resize and replace element.
llvm-svn: 253960
2015-11-24 08:20:41 +00:00
Chris Bieneman 7494dc5e55 [CMake] When disabling PIC, also pass -fno-pie when linking if it is supported.
Building clang with -fno-pie generates slightly faster code. In my not-very-rigorous testing I saw about a 4% speed up using the clang test-suite sources.

llvm-svn: 253959
2015-11-24 08:04:59 +00:00
Richard Smith 812465436b Reduce the stack usage per recursive step when RecursiveASTVisitor cannot perform data recursion.
llvm-svn: 253958
2015-11-24 07:13:06 +00:00
Igor Kudrin 5d2bffdd57 [ELF/AArch64] Add support for R_AARCH64_ADR_GOT_PAGE and R_AARCH64_LD64_GOT_LO12_NC.
With these relocations, it is now possible to build a simple "hello world"
program for AArch64 Debian.

Differential revision: http://reviews.llvm.org/D14917

llvm-svn: 253957
2015-11-24 06:48:31 +00:00
Craig Topper d324d75102 Revert change that accidentally snuck into r253955.
llvm-svn: 253956
2015-11-24 06:24:06 +00:00
Craig Topper 030418802a [TableGen] Use array_pod_sort. NFC
llvm-svn: 253955
2015-11-24 06:22:43 +00:00
Mehdi Amini 42418aba58 Add a FunctionImporter helper to perform summary-based cross-module function importing
Summary:
This is a helper to perform cross-module import for ThinLTO. Right now
it is importing naively every possible called functions.

Reviewers: tejohnson

Subscribers: dexonsmith, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 253954
2015-11-24 06:07:49 +00:00
Mehdi Amini 1d704cdedf Add findFunctionInfoList() accessor to FunctionInfoIndex.
Summary:
This allows to query for a function in the map without creating an
entry, allowing to use a const FunctionInfoIndex.

Reviewers: tejohnson

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 253953
2015-11-24 06:07:42 +00:00
Cong Hou bed60d35ed [X86][SSE] Detect AVG pattern during instruction combine for SSE2/AVX2/AVX512BW.
This patch detects the AVG pattern in vectorized code, which is simply
c = (a + b + 1) / 2, where a, b, and c have the same type which are vectors of
either unsigned i8 or unsigned i16. In the IR, i8/i16 will be promoted to
i32 before any arithmetic operations. The following IR shows such an example:

%1 = zext <N x i8> %a to <N x i32>
%2 = zext <N x i8> %b to <N x i32>
%3 = add nuw nsw <N x i32> %1, <i32 1 x N>
%4 = add nuw nsw <N x i32> %3, %2
%5 = lshr <N x i32> %N, <i32 1 x N>
%6 = trunc <N x i32> %5 to <N x i8>

and with this patch it will be converted to a X86ISD::AVG instruction.

The pattern recognition is done when combining instructions just before type
legalization during instruction selection. We do it here because after type
legalization, it is much more difficult to do pattern recognition based
on many instructions that are doing type conversions. Therefore, for
target-specific instructions (like X86ISD::AVG), we need to take care of type
legalization by ourselves. However, as X86ISD::AVG behaves similarly to
ISD::ADD, I am wondering if there is a way to legalize operands and result
types of X86ISD::AVG together with ISD::ADD. It seems that the current design
doesn't support this idea.

Tests are added for SSE2, AVX2, and AVX512BW and both i8 and i16 types of
variant vector sizes.


Differential revision: http://reviews.llvm.org/D14761

llvm-svn: 253952
2015-11-24 05:44:19 +00:00
Tobias Grosser d68ba42556 ScopInfo: Split hasAffineMemoryAccesses() into multiple functions [NFC]
This makes the overall code more readable.

llvm-svn: 253951
2015-11-24 05:00:36 +00:00
Richard Smith 919ce23566 [modules] Add -cc1 flag -fmodules-embed-all-files.
This flag causes all files that were read by the compilation to be embedded
into a produced module file. This is useful for distributed build systems that
use an include scanning system to determine which files are "needed" by a
compilation, and only provide those files to remote compilation workers. Since
using a module can require any file that is part of that module (or anything it
transitively includes), files that are not found by an include scanner can be
required in a regular build using explicit modules. With this flag, only files
that are actually referenced by transitively-#included files are required to be
present on the build machine.

llvm-svn: 253950
2015-11-24 04:22:21 +00:00
Richard Smith 50668455a7 Remove DataRecursiveASTVisitor; it no longer serves any purpose, since it's just an alias for RecursiveASTVisitor.
llvm-svn: 253949
2015-11-24 03:55:01 +00:00
Richard Smith 8583872060 Use data recursion in RecursiveASTVisitor when traversing Stmt and Expr nodes.
When RAV traverses a Stmt or Expr node, if the corresponding Traverse*
functions have not been overridden, it will now use data recursion to walk
those nodes. We arrange this to be an unobservable optimization to RAV
subclasses, and to gracefully degrade as parts of the visitation are overridden
with functions that might observe the visitation.

For instance, if an RAV subclass overrides TraverseUnaryNot, we will ensure
that there are real recursive stack frames for those traversals, but we'll
use data recursion for all other traversals.

This removes the need for DataRecursiveASTVisitor, and for the
'shouldUseDataRecursionFor' extension point, both of which are removed by this
change.

llvm-svn: 253948
2015-11-24 03:09:01 +00:00
Artem Belevich d977f4ab99 Do not attempt to include CUDA headers during the test.
llvm-svn: 253947
2015-11-24 02:45:55 +00:00
Richard Smith 2af65c4a89 [coroutines] Build a CoroutineBodyStmt when finishing parsing a coroutine, and form the initial_suspend, final_suspend, and get_return_object calls.
llvm-svn: 253946
2015-11-24 02:34:39 +00:00
Davide Italiano c304a0ddc1 [DIE] Make DIE.h NDEBUG conditional-free.
Switch dump()/print() method definitions to LLVM_DUMP_METHOD instead.

llvm-svn: 253945
2015-11-24 02:21:43 +00:00
Chris Bieneman 914742bb80 [CMake] export_executable_symbols also needs to add -rdynamic to the linker flags on Darwin
Without -rdynamic LLVM built with LTO fails to pass "check" due to loadable modules failing.

llvm-svn: 253944
2015-11-24 00:58:58 +00:00
Xinliang David Li bd1e84bc84 sync up InstrProfData.inc with master
llvm-svn: 253943
2015-11-24 00:37:45 +00:00
Xinliang David Li ff1a0bb254 Use make_unique [NFC]
llvm-svn: 253942
2015-11-24 00:32:00 +00:00
Xinliang David Li b46ad0a3c8 Remove trailing space in comments
llvm-svn: 253941
2015-11-24 00:31:41 +00:00
Sanjay Patel 8ca4a5b9e5 minimize test case but still show the bug
llvm-svn: 253940
2015-11-24 00:11:48 +00:00
NAKAMURA Takumi 8965799aa3 CodeGenFunction.h: Prune a \param in r253926. [-Wdocumentation]
llvm-svn: 253938
2015-11-23 23:38:13 +00:00
Chris Bieneman ae88ac200d NFC. Fixing my consistently incorrect spelling.
llvm-svn: 253937
2015-11-23 23:34:13 +00:00
Chris Bieneman 4cb7ab67c9 NFC. Fixing my consistently incorrect spelling.
llvm-svn: 253936
2015-11-23 23:34:09 +00:00
Sanjay Patel 16fcf25eb9 added comment (using freshly updated update_llc_test_checks.py)
llvm-svn: 253935
2015-11-23 23:22:05 +00:00
Sanjay Patel d6e0cb01b1 [x86] add test to show suboptimal codegen (PR25554)
llvm-svn: 253934
2015-11-23 23:18:20 +00:00
Sanjoy Das 5abfbb9246 [RuntimeDyld] Avoid unused-private-field warning; NFC
Fixes the no asserts -Werror,-Wunused-private-field build.

llvm-svn: 253933
2015-11-23 22:59:36 +00:00
NAKAMURA Takumi a70cdf5166 clang-c/Index.h: Move \brief. [-Wdocumentation]
llvm-svn: 253932
2015-11-23 22:51:26 +00:00
Dan Gohman 192dddc595 [WebAssembly] Don't print the types of memory_size and grow_memory
This matches the current spec, for now.

llvm-svn: 253931
2015-11-23 22:37:29 +00:00
Xinliang David Li c667683d2e [PGO] In llvm-profdata text dump, add comment lines as annotations
llvm-svn: 253930
2015-11-23 22:31:22 +00:00
Daniel Jasper 5a59152fd0 Fix test failure introduced by r253859. I believe that the new behavior
in r253859 makes sense in many cases and thus, I have fixed the
implementation of calculateChangedRanges instead. It had a FIXME anyway
saying that it was unecessarily using shiftedCodePosition which
resulted in O(N^2) runtime.

llvm-svn: 253929
2015-11-23 22:28:56 +00:00
Krzysztof Parzyszek d5d083ccd4 Revert r253923.
Per Eric's request.

llvm-svn: 253928
2015-11-23 22:19:57 +00:00
Andy Ayers 9f7501896e findDeadCallerSavedReg needs to pay attention to calling convention
Caller saved regs differ between SysV and Win64. Use the tail call available set to scavenge from.

Refactor register info to create new helper to get at tail call GPRs. Added a new test case for windows. Fixed up a number of X64 tests since now RCX is preferred over RDX on SysV.

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

llvm-svn: 253927
2015-11-23 22:17:44 +00:00
Samuel Antao 798f11cfb7 Preserve exceptions information during calls code generation.
This patch changes the generation of CGFunctionInfo to contain 
the FunctionProtoType if it is available. This enables the code 
generation for call instructions to look into this type for 
exception information and therefore generate better quality 
IR - it will not create invoke instructions for functions that 
are know not to throw.

llvm-svn: 253926
2015-11-23 22:04:44 +00:00