platform/upstream/llvm.git
9 years agoRevert r223049, r223050 and r223051 while investigating test failures.
Hans Wennborg [Mon, 1 Dec 2014 17:36:43 +0000 (17:36 +0000)]
Revert r223049, r223050 and r223051 while investigating test failures.

I didn't foresee affecting the Clang test suite :/

llvm-svn: 223054

9 years agoSimplifyCFG: Omit range checks for switch lookup tables when default is unreachable
Hans Wennborg [Mon, 1 Dec 2014 17:08:38 +0000 (17:08 +0000)]
SimplifyCFG: Omit range checks for switch lookup tables when default is unreachable

They would get optimized away later, but we might as well not emit them.

llvm-svn: 223051

9 years agoSimplifyCFG: don't remove unreachable default switch destinations
Hans Wennborg [Mon, 1 Dec 2014 17:08:35 +0000 (17:08 +0000)]
SimplifyCFG: don't remove unreachable default switch destinations

An unreachable default destination can be exploited by other optimizations, and
SDag lowering is now prepared to handle them efficiently.

For example, branches to the unreachable destination will be optimized away,
such as in the case of range checks for switch lookup tables.

On 64-bit Linux, this reduces the size of a clang bootstrap by 80 kB (and
Chromium by 30 kB).

llvm-svn: 223050

9 years agoSelectionDAG switch lowering: Replace unreachable default with most popular case.
Hans Wennborg [Mon, 1 Dec 2014 17:08:32 +0000 (17:08 +0000)]
SelectionDAG switch lowering: Replace unreachable default with most popular case.

This can significantly reduce the size of the switch, allowing for more
efficient lowering.

I also worked with the idea of exploiting unreachable defaults by
omitting the range check for jump tables, but always ended up with a
non-neglible binary size increase. It might be worth looking into some more.

llvm-svn: 223049

9 years agoUpdate R600 address space map to include generic
Matt Arsenault [Mon, 1 Dec 2014 16:46:03 +0000 (16:46 +0000)]
Update R600 address space map to include generic

llvm-svn: 223046

9 years agoPartial revert of r222986.
Rafael Espindola [Mon, 1 Dec 2014 16:32:20 +0000 (16:32 +0000)]
Partial revert of r222986.

The explicit set of destination types is not fully redundant when lazy loading
since the TypeFinder will not find types used only in function bodies.

This keeps the logic to drop the name of mapped types since it still helps
with avoiding further renaming.

llvm-svn: 223043

9 years agoR600/SI: Various instruction format bit test cleanups
Matt Arsenault [Mon, 1 Dec 2014 15:52:46 +0000 (15:52 +0000)]
R600/SI: Various instruction format bit test cleanups

- Fix missing SALU format bits
- Remove unused isSALUInstr
- Add isVALU
- Switch isDS to use a bit like the others
- Move SIInstrInfo::is* functions to header
- Reorder so they are approximately sorted by type (SALU, VALU, memory)

llvm-svn: 223038

9 years agoMake the function pointer a template argument instead of a runtime value.
Samuel Benzaquen [Mon, 1 Dec 2014 14:46:14 +0000 (14:46 +0000)]
Make the function pointer a template argument instead of a runtime value.

Summary:
Speed up the variadic matchers by removing one indirect call.
Making the function pointer a template arguments allows the compiler to
inline the call instead of doing an runtime call by pointer.
Also, optimize the allOf() case to avoid redundant kind checks.
This speeds up our clang-tidy benchmark by ~2%

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 223029

9 years ago[OPENMP] Formating and code improvement for codegen of 'omp critical' directive.
Alexey Bataev [Mon, 1 Dec 2014 11:32:38 +0000 (11:32 +0000)]
[OPENMP] Formating and code improvement for codegen of 'omp critical' directive.
No functional changes, only code improvements.

llvm-svn: 223010

9 years agoThe andi16, addiusp and jraddiusp micromips instructions were missing dedicated decod...
Vladimir Medic [Mon, 1 Dec 2014 11:12:04 +0000 (11:12 +0000)]
The andi16, addiusp and jraddiusp micromips instructions were missing dedicated decoder methods in MipsDisassembler.cpp to properly decode immediate operands. These methods are added together with corresponding tests.

llvm-svn: 223006

9 years ago[msan] Add compile-time checks for missing origins.
Evgeniy Stepanov [Mon, 1 Dec 2014 09:53:51 +0000 (09:53 +0000)]
[msan] Add compile-time checks for missing origins.

This change makes MemorySanitizer instrumentation a bit more strict
about instructions that have no origin id assigned to them.

This would have caught the bug that was fixed in r222918.

No functional change.

llvm-svn: 222997

9 years ago[PowerPC] Fix unwind info with dynamic stack realignment
Jay Foad [Mon, 1 Dec 2014 09:42:32 +0000 (09:42 +0000)]
[PowerPC] Fix unwind info with dynamic stack realignment

Summary:
PowerPC DWARF unwind info defined CFA as SP + offset even in a function
where the stack had been dynamically realigned. This clearly doesn't
work because the offset from SP to CFA is not a constant. Fix it by
defining CFA as BP instead.

This was causing the AddressSanitizer null_deref test to fail 50% of
the time, depending on whether SP happened to be 32-byte aligned on
entry to a particular function or not.

Reviewers: willschm, uweigand, hfinkel

Reviewed By: hfinkel

Subscribers: llvm-commits

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

llvm-svn: 222996

9 years agoRevert "Remove threshold for lifetime marker insertion of named temporaries"
Arnaud A. de Grandmaison [Mon, 1 Dec 2014 09:30:16 +0000 (09:30 +0000)]
Revert "Remove threshold for lifetime marker insertion of named temporaries"

Revert r222993 while I investigate some MemorySanitizer failures.

llvm-svn: 222995

9 years agoRemoved extra whitespace. (Testing commit access). NFC.
Sonam Kumari [Mon, 1 Dec 2014 09:27:46 +0000 (09:27 +0000)]
Removed extra whitespace. (Testing commit access). NFC.

llvm-svn: 222994

9 years agoRemove threshold for lifetime marker insertion of named temporaries
Arnaud A. de Grandmaison [Mon, 1 Dec 2014 09:13:54 +0000 (09:13 +0000)]
Remove threshold for lifetime marker insertion of named temporaries

Now that TailRecursionElimination has been fixed with r222354, the
threshold on size for lifetime marker insertion can be removed. This
only affects named temporary though, as the patch for unnamed temporaries
is still in progress.

llvm-svn: 222993

9 years agoAdd post-decode checking of HVC instruction.
Charlie Turner [Mon, 1 Dec 2014 08:50:27 +0000 (08:50 +0000)]
Add post-decode checking of HVC instruction.

Add checkDecodedInstruction for post-decode checking of instructions, to catch
the corner cases like HVC that don't fit into the general pattern. Needed to
check for an invalid condition field in instruction encoding despite HVC not
taking a predicate.

Patch by Matthew Wahab.

Change-Id: I48e28de981d7a9e43569594da3c45fb478b4f795
llvm-svn: 222992

9 years ago[asan] Change dynamic alloca instrumentation to only consider allocas that are domina...
Yury Gribov [Mon, 1 Dec 2014 08:47:58 +0000 (08:47 +0000)]
[asan] Change dynamic alloca instrumentation to only consider allocas that are dominating all exits from function.

Reviewed in http://reviews.llvm.org/D6412

llvm-svn: 222991

9 years agoAdd Thumb HVC and ERET virtualisation extension instructions.
Charlie Turner [Mon, 1 Dec 2014 08:39:19 +0000 (08:39 +0000)]
Add Thumb HVC and ERET virtualisation extension instructions.

Patch by Matthew Wahab.

Change-Id: I131f71c1150d5fa797066a18e09d526c19bf9016
llvm-svn: 222990

9 years agoAdd ARM ERET and HVC virtualisation extension instructions.
Charlie Turner [Mon, 1 Dec 2014 08:33:28 +0000 (08:33 +0000)]
Add ARM ERET and HVC virtualisation extension instructions.

Patch by Matthew Wahab.

Change-Id: Iad75f078fbaa4ecc7d7a4820ad9b3930679cbbbb
llvm-svn: 222989

9 years agoFix capitalization. NFC.
Akira Hatanaka [Mon, 1 Dec 2014 06:14:52 +0000 (06:14 +0000)]
Fix capitalization. NFC.

llvm-svn: 222988

9 years ago[stack protector] Set edge weights for newly created basic blocks.
Akira Hatanaka [Mon, 1 Dec 2014 04:27:03 +0000 (04:27 +0000)]
[stack protector] Set edge weights for newly created basic blocks.

This commit fixes a bug in stack protector pass where edge weights were not set
when new basic blocks were added to lists of successor basic blocks.

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

llvm-svn: 222987

9 years agoChange how we keep track of which types are in the dest module.
Rafael Espindola [Mon, 1 Dec 2014 04:15:59 +0000 (04:15 +0000)]
Change how we keep track of which types are in the dest module.

Instead of keeping an explicit set, just drop the names of types we choose
to map to some other type.

This has the advantage that the name of the unused will not cause the context
to rename types on module read.

llvm-svn: 222986

9 years agoAdd a test showing what the linker IdentifiedStructTypes is for.
Rafael Espindola [Mon, 1 Dec 2014 03:20:57 +0000 (03:20 +0000)]
Add a test showing what the linker IdentifiedStructTypes is for.

Without this it could just be deleted and all tests would pass.

llvm-svn: 222985

9 years agoRelax an assert a bit to avoid a crash on unreachable code.
Rafael Espindola [Mon, 1 Dec 2014 02:55:24 +0000 (02:55 +0000)]
Relax an assert a bit to avoid a crash on unreachable code.

Patch by Duncan Exon Smith with a small tweak by me.

llvm-svn: 222984

9 years ago[Core] Add flag to check if RoundTripPasses need to be run.
Shankar Easwaran [Mon, 1 Dec 2014 01:04:11 +0000 (01:04 +0000)]
[Core] Add flag to check if RoundTripPasses need to be run.

This would allow other flavor specific contexts to override the default value,
if they want to optionally run the round trip passes.

There is some information lost like the original file owner of the atom with
RoundTripPasses. The Gnu flavor needs this information inorder to implement
LinkerScript matching and for other diagnostic outputs such as Map files.

The flag also can be used to record information in the Atom if the information
to the Writer needs to be conveyed through References too.

llvm-svn: 222983

9 years ago[ELF] Fix layout of output sections.
Shankar Easwaran [Sun, 30 Nov 2014 22:36:29 +0000 (22:36 +0000)]
[ELF] Fix layout of output sections.

The AtomSections were improperly merging sections from various input files. This
patch fixes the problem, with an updated test that was provided by Simon.

Thanks to Simon Atanasyan for catching this issue.

llvm-svn: 222982

9 years ago[clang-tidy] google-explicit-constructor: don't match in template instantiations
Alexander Kornienko [Sun, 30 Nov 2014 19:41:41 +0000 (19:41 +0000)]
[clang-tidy] google-explicit-constructor: don't match in template instantiations

This helps avoiding false positives related to the recently added
std::initializer_list<> handling.

llvm-svn: 222981

9 years agoDrop unused enum value
Tobias Grosser [Sun, 30 Nov 2014 15:57:07 +0000 (15:57 +0000)]
Drop unused enum value

llvm-svn: 222980

9 years agoRemove Polly's IndVarSimplify pass
Tobias Grosser [Sun, 30 Nov 2014 14:33:41 +0000 (14:33 +0000)]
Remove Polly's IndVarSimplify pass

Polly had a copy of this pass to create the canonical induction variables
necessary for the non-scev-based code generation. As we now always use SCEV
based code generation, canonical induction variables are not needed any more.

llvm-svn: 222979

9 years agoRemove -polly-codegen-scev option and related code
Tobias Grosser [Sun, 30 Nov 2014 14:33:31 +0000 (14:33 +0000)]
Remove -polly-codegen-scev option and related code

SCEV based code generation has been the default for two weeks after having
been tested for a long time. We now drop the support the non-scev-based code
generation.

llvm-svn: 222978

9 years agocmake: Add polly libraries to LLVMExports
Tobias Grosser [Sun, 30 Nov 2014 12:45:44 +0000 (12:45 +0000)]
cmake: Add polly libraries to LLVMExports

This fixes LINK_POLLY_INTO_TOOLS=ON builds, which previously failed with:

CMake Error: install(EXPORT "LLVMExports" ...) includes target "opt" which
requires target "Polly" that is not in the export set.

CMake Error: install(EXPORT "LLVMExports" ...) includes target "bugpoint" which
requires target "Polly" that is not in the export set.

llvm-svn: 222977

9 years ago[PowerPC] Add asm support for cache-inhibited ld/st instructions
Hal Finkel [Sun, 30 Nov 2014 10:15:56 +0000 (10:15 +0000)]
[PowerPC] Add asm support for cache-inhibited ld/st instructions

Add assembler support for the fixed-point cache-inhibited load/store
instructions. These are hypervisor-level only, so don't get too excited ;)

Fixes PR21650.

llvm-svn: 222976

9 years ago[ELF] Rename align2 to alignment.
Shankar Easwaran [Sun, 30 Nov 2014 04:17:06 +0000 (04:17 +0000)]
[ELF] Rename align2 to alignment.

No change in functionality.

llvm-svn: 222975

9 years ago[ELF] Fix creation of segments.
Shankar Easwaran [Sun, 30 Nov 2014 04:01:14 +0000 (04:01 +0000)]
[ELF] Fix creation of segments.

Linker was creating a separate output segment in some cases if input sections
had huge alignments. This patch fixes the issue.

llvm-svn: 222974

9 years ago[ELF] Create input and output section names
Shankar Easwaran [Sun, 30 Nov 2014 03:43:38 +0000 (03:43 +0000)]
[ELF] Create input and output section names

No change in functionality.

llvm-svn: 222973

9 years ago[ELF] Rename MergedSection to OutputSection.
Shankar Easwaran [Sun, 30 Nov 2014 03:18:08 +0000 (03:18 +0000)]
[ELF] Rename MergedSection to OutputSection.

No change in functionality.

llvm-svn: 222972

9 years agoRevert r222957 "Replace std::map<K, V*> with std::map<K, V> to handle ownership and...
Craig Topper [Sun, 30 Nov 2014 01:20:17 +0000 (01:20 +0000)]
Revert r222957 "Replace std::map<K, V*> with std::map<K, V> to handle ownership and deletion of the values."

Upon further review I think the MultiClass is being copied into the map instead of being moved due to the copy constructor on the nested Record type. This ultimately got exposed when the vector in DefPrototype vector was changed to hold unique_ptrs in another commit. This caused gcc 4.7 to fail due to the use of the copy constructor on unique_ptr with the error pointing back to one of the insert calls from this commit. Not sure why clang was able to build.

This reverts commit 710cdf729f84b428bf41aa8d32dbdb35fff79fde.

llvm-svn: 222971

9 years agoRevert r222965 "Make MultiClass::DefPrototypes own their Records to fix memory leaks."
Hans Wennborg [Sun, 30 Nov 2014 00:43:50 +0000 (00:43 +0000)]
Revert r222965 "Make MultiClass::DefPrototypes own their Records to fix memory leaks."

The bots started failing with the error below. I suspect this revision was the cause.

FAILED: /home/bb/bin/g++47   -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wno-comment -std=c++11 -ffunction-sections -fdata-sections -O3 -DNDEBUG -Ilib/TableGen -I/home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/lib/TableGen -Iinclude -I/home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/include    -fno-exceptions -fno-rtti -MMD -MT lib/TableGen/CMakeFiles/LLVMTableGen.dir/TGParser.cpp.o -MF "lib/TableGen/CMakeFiles/LLVMTableGen.dir/TGParser.cpp.o.d" -o lib/TableGen/CMakeFiles/LLVMTableGen.dir/TGParser.cpp.o -c /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/lib/TableGen/TGParser.cpp
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_tempbuf.h:62:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_algo.h:64,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/algorithm:63,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/include/llvm/ADT/StringRef.h:13,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/lib/TableGen/TGLexer.h:17,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/lib/TableGen/TGParser.h:17,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/lib/TableGen/TGParser.cpp:14:
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_construct.h: In instantiation of 'void std::_Construct(_T1*, _Args&& ...) [with _T1 = std::unique_ptr<llvm::Record>; _Args = {const std::unique_ptr<llvm::Record, std::default_delete<llvm::Record> >&}]':
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_uninitialized.h:77:3:   required from 'static _ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const std::unique_ptr<llvm::Record>*, std::vector<std::unique_ptr<llvm::Record> > >; _ForwardIterator = std::unique_ptr<llvm::Record>*; bool _TrivialValueTypes = false]'
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_uninitialized.h:119:41:   required from '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const std::unique_ptr<llvm::Record>*, std::vector<std::unique_ptr<llvm::Record> > >; _ForwardIterator = std::unique_ptr<llvm::Record>*]'
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_uninitialized.h:260:63:   required from '_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = __gnu_cxx::__normal_iterator<const std::unique_ptr<llvm::Record>*, std::vector<std::unique_ptr<llvm::Record> > >; _ForwardIterator = std::unique_ptr<llvm::Record>*; _Tp = std::unique_ptr<llvm::Record>]'
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_vector.h:310:9:   required from 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::unique_ptr<llvm::Record>; _Alloc = std::allocator<std::unique_ptr<llvm::Record> >]'
/home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/include/llvm/TableGen/Record.h:1664:8:   required from 'constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U1 = std::basic_string<char>&; _U2 = llvm::MultiClass; <template-parameter-2-3> = void; _T1 = std::basic_string<char>; _T2 = llvm::MultiClass]'
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_pair.h:273:72:   required from 'constexpr std::pair<typename std::__decay_and_strip<_T1>::__type, typename std::__decay_and_strip<_T2>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = std::basic_string<char>&; _T2 = llvm::MultiClass; typename std::__decay_and_strip<_T2>::__type = llvm::MultiClass; typename std::__decay_and_strip<_T1>::__type = std::basic_string<char>]'
/home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/lib/TableGen/TGParser.cpp:2295:78:   required from here
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_construct.h:77:7: error: use of deleted function 'std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = llvm::Record; _Dp = std::default_delete<llvm::Record>]'
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/memory:86:0,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/include/llvm/ADT/STLExtras.h:25,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:14,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/include/llvm/Support/SourceMgr.h:19,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/lib/TableGen/TGParser.h:19,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/lib/TableGen/TGParser.cpp:14:
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/unique_ptr.h:262:7: error: declared here
ninja: build stopped: subcommand failed.

llvm-svn: 222970

9 years agoclang/test/CodeGenOpenCL/opencl_types.cl: Appease i686-msvc.
NAKAMURA Takumi [Sun, 30 Nov 2014 00:32:02 +0000 (00:32 +0000)]
clang/test/CodeGenOpenCL/opencl_types.cl: Appease i686-msvc.

llvm-svn: 222969

9 years agoQualify one more make_unique call.
Hans Wennborg [Sun, 30 Nov 2014 00:31:49 +0000 (00:31 +0000)]
Qualify one more make_unique call.

The previous patch had effect, but missed this one. It seems MSVC
gets ADL-confused by the calls where the first argument is a function call?

llvm-svn: 222968

9 years agoSpeculatively qualify some llvm::make_unique calls trying to please MSVC
Hans Wennborg [Sun, 30 Nov 2014 00:24:43 +0000 (00:24 +0000)]
Speculatively qualify some llvm::make_unique calls trying to please MSVC

It was failing with this kind of error:

C:\b\build\slave\CrWinClang\build\src\third_party\llvm\lib\TableGen\TGParser.cpp(1243) : error C2668: 'llvm::make_unique' : ambiguous call to overloaded function

        C:\b\build\slave\CrWinClang\build\src\third_party\llvm\include\llvm/ADT/STLExtras.h(408): could be 'std::unique_ptr<llvm::Record,std::default_delete<_Ty>> llvm::make_unique<llvm::Record,std::string,llvm::SMLoc&,llvm::RecordKeeper&,bool>(std::string &&,llvm::SMLoc &,llvm::RecordKeeper &,bool &&)'
        with
        [
            _Ty=llvm::Record
        ]
        C:\b\depot_tools\win_toolchain\vs2013_files\win8sdk\bin\..\..\VC\include\memory(1637): or       'std::unique_ptr<llvm::Record,std::default_delete<_Ty>> std::make_unique<llvm::Record,std::string,llvm::SMLoc&,llvm::RecordKeeper&,bool>(std::string &&,llvm::SMLoc &,llvm::RecordKeeper &,bool &&)' [found using argument-dependent lookup]
        with
        [
            _Ty=llvm::Record
        ]
        while trying to match the argument list '(std::string, llvm::SMLoc, llvm::RecordKeeper, bool)'

llvm-svn: 222967

9 years agoUse an unsigned type because there seems to be no reason for it to be signed.
Craig Topper [Sun, 30 Nov 2014 00:24:32 +0000 (00:24 +0000)]
Use an unsigned type because there seems to be no reason for it to be signed.

llvm-svn: 222966

9 years agoMake MultiClass::DefPrototypes own their Records to fix memory leaks.
Craig Topper [Sun, 30 Nov 2014 00:19:28 +0000 (00:19 +0000)]
Make MultiClass::DefPrototypes own their Records to fix memory leaks.

llvm-svn: 222965

9 years agoFix typo.
Nico Weber [Sat, 29 Nov 2014 23:57:35 +0000 (23:57 +0000)]
Fix typo.

llvm-svn: 222964

9 years agoFix grammar error in err_bad_reinterpret_cast_reference error message.
Nathan Sidwell [Sat, 29 Nov 2014 22:51:47 +0000 (22:51 +0000)]
Fix grammar error in err_bad_reinterpret_cast_reference error message.

llvm-svn: 222963

9 years agoSwitch lowering: reformat some for loops etc. NFC
Hans Wennborg [Sat, 29 Nov 2014 21:24:12 +0000 (21:24 +0000)]
Switch lowering: reformat some for loops etc. NFC

llvm-svn: 222962

9 years agoSwitch lowering: Fix broken 'Figure out which block is next' code
Hans Wennborg [Sat, 29 Nov 2014 21:17:05 +0000 (21:17 +0000)]
Switch lowering: Fix broken 'Figure out which block is next' code

This doesn't seem to have worked in a long time, but other optimizations
would clean it up.

llvm-svn: 222961

9 years agoTarget triple OS detection tidyup. NFC
Simon Pilgrim [Sat, 29 Nov 2014 19:18:21 +0000 (19:18 +0000)]
Target triple OS detection tidyup. NFC

Use Triple::isOS*() helpers where possible.

llvm-svn: 222960

9 years agoRemove some unnecessary vector::reserve/assign calls.
David Blaikie [Sat, 29 Nov 2014 18:13:42 +0000 (18:13 +0000)]
Remove some unnecessary vector::reserve/assign calls.

llvm-svn: 222959

9 years agoRemove indirection of vector<T*> in favor of deque<T>
David Blaikie [Sat, 29 Nov 2014 18:13:39 +0000 (18:13 +0000)]
Remove indirection of vector<T*> in favor of deque<T>

llvm-svn: 222958

9 years agoReplace std::map<K, V*> with std::map<K, V> to handle ownership and deletion of the...
Craig Topper [Sat, 29 Nov 2014 18:12:59 +0000 (18:12 +0000)]
Replace std::map<K, V*> with std::map<K, V> to handle ownership and deletion of the values.

llvm-svn: 222957

9 years agoTweak clang/test/CodeGenOpenCL/opencl_types.cl to appease msvc since r222941.
NAKAMURA Takumi [Sat, 29 Nov 2014 17:27:07 +0000 (17:27 +0000)]
Tweak clang/test/CodeGenOpenCL/opencl_types.cl to appease msvc since r222941.

llvm-svn: 222956

9 years agoRemove 'else' after 'return'. Fix formatting of a 'switch' statement.
Craig Topper [Sat, 29 Nov 2014 16:05:27 +0000 (16:05 +0000)]
Remove 'else' after 'return'. Fix formatting of a 'switch' statement.

llvm-svn: 222955

9 years agoAdd a HasSuppressionType method into SuppressionContext
Kuba Brecka [Sat, 29 Nov 2014 14:18:05 +0000 (14:18 +0000)]
Add a HasSuppressionType method into SuppressionContext

Extending SuppressionContext to add a HasSuppressionType method that tells whether a certain suppression type is currently used or not. It's a step to implement issue suppressions for ASan, see http://reviews.llvm.org/D6280.

Reviewed at http://reviews.llvm.org/D6443

llvm-svn: 222954

9 years ago[mips][microMIPS] Implement NOP aliases
Jozef Kolek [Sat, 29 Nov 2014 13:29:24 +0000 (13:29 +0000)]
[mips][microMIPS] Implement NOP aliases

This patch implements microMIPS 16-bit (MOVE16 $0, $0) and
32-bit (SLL $0, $0, 0) NOP aliases.

http://reviews.llvm.org/D6440

llvm-svn: 222953

9 years agoAdd support for 32-bit i386 binaries.
Jason Molenda [Sat, 29 Nov 2014 09:17:40 +0000 (09:17 +0000)]
Add support for 32-bit i386 binaries.

llvm-svn: 222952

9 years agoThe finishing touches on getting the compact unwind dumping completed
Jason Molenda [Sat, 29 Nov 2014 07:05:07 +0000 (07:05 +0000)]
The finishing touches on getting the compact unwind dumping completed
for x86_64.  i386, arm, arm64 aren't handled yet but those are minor
variations on this format.

This commit also adds code to read the symbol table out of the
binary and read the LC_FUNCTION_STARTS to augment the symbol table
with the start addresses of all the functions - and print the
function names when showing the unwind info.

llvm-svn: 222951

9 years agoUse deque<T> rather than vector<T*> since it provides the same invalidation semantics...
David Blaikie [Sat, 29 Nov 2014 07:04:51 +0000 (07:04 +0000)]
Use deque<T> rather than vector<T*> since it provides the same invalidation semantics (at least when removal is not needed) without the extra indirection/ownership complexity

Order matters for this container, it seems (using a forward_list and
replacing the original push_backs with emplace_fronts caused test
failures). I didn't look too deeply into why.

(& in retrospect, I might go back & change some of the forward_lists I
introduced to deques anyway - since most don't require removal, deque is
a more memory-friendly data structure (moderate locality while not
invalidating pointers))

llvm-svn: 222950

9 years agoConstify some things in preparation for CodeGenSubRegIndex to be stored by value...
David Blaikie [Sat, 29 Nov 2014 07:04:49 +0000 (07:04 +0000)]
Constify some things in preparation for CodeGenSubRegIndex to be stored by value in their container, removing the indirection

llvm-svn: 222949

9 years agoMake RecordKeeper::addClass/addDef take unique_ptrs instead of creating one internally.
Craig Topper [Sat, 29 Nov 2014 05:52:51 +0000 (05:52 +0000)]
Make RecordKeeper::addClass/addDef take unique_ptrs instead of creating one internally.

llvm-svn: 222948

9 years agoUse unique_ptr to remove some explicit deletes on some error case returns. At least...
Craig Topper [Sat, 29 Nov 2014 05:31:10 +0000 (05:31 +0000)]
Use unique_ptr to remove some explicit deletes on some error case returns. At least one spot of weird ownership passing that needs some future cleanup.

llvm-svn: 222947

9 years agoDebugIR: Remove empty directories from SVN
Duncan P. N. Exon Smith [Sat, 29 Nov 2014 03:17:43 +0000 (03:17 +0000)]
DebugIR: Remove empty directories from SVN

llvm-svn: 222946

9 years agoDebugIR: Delete -debug-ir
Duncan P. N. Exon Smith [Sat, 29 Nov 2014 03:15:47 +0000 (03:15 +0000)]
DebugIR: Delete -debug-ir

llvm-svn: 222945

9 years agoSupport: remove some variable names
Saleem Abdulrasool [Sat, 29 Nov 2014 00:10:26 +0000 (00:10 +0000)]
Support: remove some variable names

If built with -Wunused-variable, clang objects to the declarations due to the
unused variable; drop the names.  NFC.

llvm-svn: 222944

9 years agoRevert "Simplify some more ownership using forward_list<T> rather than vector<unique_...
Duncan P. N. Exon Smith [Fri, 28 Nov 2014 23:00:22 +0000 (23:00 +0000)]
Revert "Simplify some more ownership using forward_list<T> rather than vector<unique_ptr<T>>"

This reverts commit r222935 and its follow-up r222938 ("Push unique_ptr
a bit further through some APIs and simplify some cleanup"), since it
causes bot failures (at least on Darwin):

http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental/1391/

llvm-svn: 222943

9 years agoR600/SI: Fix assertion on sign extend of 3 vectors
Matt Arsenault [Fri, 28 Nov 2014 22:51:38 +0000 (22:51 +0000)]
R600/SI: Fix assertion on sign extend of 3 vectors

This was trying to create an MVT with 3x vectors which
created an invalid EVT

llvm-svn: 222942

9 years agoAST: Consider pseudo-struct builtin types as substitutable
David Majnemer [Fri, 28 Nov 2014 22:22:46 +0000 (22:22 +0000)]
AST: Consider pseudo-struct builtin types as substitutable

We didn't consider types like ObjCSel as a substitution candidate.

This fixes PR21688.

llvm-svn: 222941

9 years agoReapply "Use std::map<K, V> rather than std::map<K, std::unique_ptr<V>>""
David Blaikie [Fri, 28 Nov 2014 22:15:06 +0000 (22:15 +0000)]
Reapply "Use std::map<K, V> rather than std::map<K, std::unique_ptr<V>>""

Just avoid using std::map::emplace since it's not implemented in
libstdc++ 4.7.

Reapplies r222937, reverted in r222939.

llvm-svn: 222940

9 years agoRevert "Use std::map<K, V> rather than std::map<K, std::unique_ptr<V>>"
David Blaikie [Fri, 28 Nov 2014 22:01:06 +0000 (22:01 +0000)]
Revert "Use std::map<K, V> rather than std::map<K, std::unique_ptr<V>>"

Seems libstdc++ on some buildbots is lacking std::map::emplace, which is
weird... reverting while I look into it.

This reverts commit r222937.

llvm-svn: 222939

9 years agoPush unique_ptr a bit further through some APIs and simplify some cleanup
David Blaikie [Fri, 28 Nov 2014 21:59:58 +0000 (21:59 +0000)]
Push unique_ptr a bit further through some APIs and simplify some cleanup

llvm-svn: 222938

9 years agoUse std::map<K, V> rather than std::map<K, std::unique_ptr<V>>
David Blaikie [Fri, 28 Nov 2014 21:37:54 +0000 (21:37 +0000)]
Use std::map<K, V> rather than std::map<K, std::unique_ptr<V>>

Pointers and references to map elements are never invalidated (except on
removal, which isn't used here) so there's no need for the indirection
unless there's polymorphism at work.

A little const correctness had to be fixed, since the indirection
allowed some benign const violations.

llvm-svn: 222937

9 years agoRevert "Masked Vector Load and Store Intrinsics."
Duncan P. N. Exon Smith [Fri, 28 Nov 2014 21:29:14 +0000 (21:29 +0000)]
Revert "Masked Vector Load and Store Intrinsics."

This reverts commit r222632 (and follow-up r222636), which caused a host
of LNT failures on an internal bot.  I'll respond to the commit on the
list with a reproduction of one of the failures.

Conflicts:
lib/Target/X86/X86TargetTransformInfo.cpp

llvm-svn: 222936

9 years agoSimplify some more ownership using forward_list<T> rather than vector<unique_ptr<T>>
David Blaikie [Fri, 28 Nov 2014 21:20:24 +0000 (21:20 +0000)]
Simplify some more ownership using forward_list<T> rather than vector<unique_ptr<T>>

llvm-svn: 222935

9 years agoForgotten formatting from previous commit
David Blaikie [Fri, 28 Nov 2014 21:20:22 +0000 (21:20 +0000)]
Forgotten formatting from previous commit

llvm-svn: 222934

9 years agoAdd additional arguments for -mfpu options
Richard Barton [Fri, 28 Nov 2014 20:39:59 +0000 (20:39 +0000)]
Add additional arguments for -mfpu options

Add neon-vfpv3 to allow specifying both at the same time. This is not an
option that GCC supports, but follows the same track and should be
non-controversial.

Change-Id: Id9ec157c835937d7d11ad0f49dbe5171fac17658
llvm-svn: 222933

9 years agoAdd -mfpu=neon-vfpv4
Richard Barton [Fri, 28 Nov 2014 20:39:54 +0000 (20:39 +0000)]
Add -mfpu=neon-vfpv4

This enables user to architecturally specify ARMv7A + VFPv4 + NEON.

Change-Id: I779b01fef5c47e5e4ac702ae24ed2f76a0e4c63f
llvm-svn: 222932

9 years agoSimplify ownership by using forward_list<T> rather than vector<unique_ptr<T>>
David Blaikie [Fri, 28 Nov 2014 20:35:57 +0000 (20:35 +0000)]
Simplify ownership by using forward_list<T> rather than vector<unique_ptr<T>>

Since the elements were not polymorphic, the unique_ptr was only used to
avoid pointer invalidation on container resizes - might as well skip the
indirection and use a container with suitable invalidation semantics.

llvm-svn: 222931

9 years agoFix a few memory leaks in CodeGenRegBank.
Craig Topper [Fri, 28 Nov 2014 20:30:39 +0000 (20:30 +0000)]
Fix a few memory leaks in CodeGenRegBank.

llvm-svn: 222930

9 years agoUse unique_ptr to simplify deletion.
Craig Topper [Fri, 28 Nov 2014 20:30:37 +0000 (20:30 +0000)]
Use unique_ptr to simplify deletion.

llvm-svn: 222929

9 years agoInstCombine: FoldOrOfICmps harder
David Majnemer [Fri, 28 Nov 2014 19:58:29 +0000 (19:58 +0000)]
InstCombine: FoldOrOfICmps harder

We may be in a situation where the icmps might not be near each other in
a tree of or instructions.  Try to dig out related compare instructions
and see if they combine.

N.B.  This won't fire on deep trees of compares because rewritting the
tree might end up creating a net increase of IR.  We may have to resort
to something more sophisticated if this is a real problem.

llvm-svn: 222928

9 years ago[LICM] Store sink and indirectbr instructions
Bruno Cardoso Lopes [Fri, 28 Nov 2014 19:47:46 +0000 (19:47 +0000)]
[LICM] Store sink and indirectbr instructions

Loop simplify skips exit-block insertion when exits contain indirectbr
instructions. This leads to an assertion in LICM when trying to sink
stores out of non-dedicated loop exits containing indirectbr
instructions. This patch fix this issue by re-checking for dedicated
exits in LICM prior to store sink attempts.

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

rdar://problem/18943047

llvm-svn: 222927

9 years ago[SwitchLowering] Handle multiple destinations on condensed case stmts
Bruno Cardoso Lopes [Fri, 28 Nov 2014 19:47:33 +0000 (19:47 +0000)]
[SwitchLowering] Handle multiple destinations on condensed case stmts

Switch cases statements with sequential values that branch to the same
destination BB may often be handled together in a single new source BB.
In this scenario we need to remove remaining incoming values from PHI
instructions in the destination BB, as to match the number of source
branches.

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

rdar://problem/19040894

llvm-svn: 222926

9 years agoEnable FeatureFastUAMem for btver2
Sanjay Patel [Fri, 28 Nov 2014 18:40:18 +0000 (18:40 +0000)]
Enable FeatureFastUAMem for btver2

Allow unaligned 16-byte memop codegen for btver2. No functional changes for any other subtargets.

Replace the existing supposed small memcpy test with an actual test of a small memcpy.
The previous test wasn't using FileCheck either.

This patch should allow us to close PR21541 ( http://llvm.org/bugs/show_bug.cgi?id=21541 ).

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

llvm-svn: 222925

9 years ago[clang-tidy] More tests for the google-explicit-constructor check
Alexander Kornienko [Fri, 28 Nov 2014 17:31:51 +0000 (17:31 +0000)]
[clang-tidy] More tests for the google-explicit-constructor check

llvm-svn: 222924

9 years agoAdd back r222727 with a fix.
Rafael Espindola [Fri, 28 Nov 2014 16:41:24 +0000 (16:41 +0000)]
Add back r222727 with a fix.

The original patch would fail when:

* A dst opaque type (%A) is matched with a src type (%A).
* A src opaque (%E) type is then speculatively matched with %A and the
  speculation fails afterward.
* When rolling back the speculation we would cancel the source %A to dest
  %A mapping.

The fix is to keep an explicit list of which resolutions are speculative.

Original message:

Fix overly aggressive type merging.

If we find out that two types are *not* isomorphic, we learn nothing about
opaque sub types in both the source and destination.

llvm-svn: 222923

9 years agoAdd an assert and use a range loop. NFC.
Rafael Espindola [Fri, 28 Nov 2014 16:26:14 +0000 (16:26 +0000)]
Add an assert and use a range loop. NFC.

llvm-svn: 222922

9 years agoAdd a testcase reduced from clang lto bootstrap on OS X.
Rafael Espindola [Fri, 28 Nov 2014 15:45:31 +0000 (15:45 +0000)]
Add a testcase reduced from clang lto bootstrap on OS X.

llvm-svn: 222921

9 years agoFix wrong encoding of MRSBanked.
Charlie Turner [Fri, 28 Nov 2014 15:01:06 +0000 (15:01 +0000)]
Fix wrong encoding of MRSBanked.

Patch by Matthew Wahab.

Change-Id: Ia2a001ca2760028ea360fe77b56f203a219eefbc
llvm-svn: 222920

9 years ago[Msan] Generalize mapping facilities to add FreeBSD support
Viktor Kutuzov [Fri, 28 Nov 2014 11:42:55 +0000 (11:42 +0000)]
[Msan] Generalize mapping facilities to add FreeBSD support
Differential Revision: http://reviews.llvm.org/D6387

llvm-svn: 222919

9 years ago[msan] Fix origin propagation for select of floats.
Evgeniy Stepanov [Fri, 28 Nov 2014 11:17:58 +0000 (11:17 +0000)]
[msan] Fix origin propagation for select of floats.

MSan does not assign origin for instrumentation temps (i.e. the ones that do
not come from the application code), but "select" instrumentation erroneously
tried to use one of those.

https://code.google.com/p/memory-sanitizer/issues/detail?id=78

llvm-svn: 222918

9 years agoTest all <build attribute, value> pairs.
Charlie Turner [Fri, 28 Nov 2014 11:14:47 +0000 (11:14 +0000)]
Test all <build attribute, value> pairs.

Add more tests to make sure the encoding/decoding of build attributes works
correctly for all permissible values of build attributes. For cases where there
are an infinite number of such values, a representative subset has been settled
for.

Change-Id: I2643c9624c211b2d56405306e16eec2d487bc5d6
llvm-svn: 222917

9 years agoRemoved extra line from a comment to test first commit. NFC.
Ankur Garg [Fri, 28 Nov 2014 10:38:18 +0000 (10:38 +0000)]
Removed extra line from a comment to test first commit. NFC.

llvm-svn: 222916

9 years ago[asan] Remove the local copy of Android ucontext.h.
Evgeniy Stepanov [Fri, 28 Nov 2014 10:37:44 +0000 (10:37 +0000)]
[asan] Remove the local copy of Android ucontext.h.

This header is present in the r10c release of the NDK.

llvm-svn: 222915

9 years ago[OPENMP] Additional processing of 'omp atomic write' directive.
Alexey Bataev [Fri, 28 Nov 2014 07:21:40 +0000 (07:21 +0000)]
[OPENMP] Additional processing of 'omp atomic write' directive.
According to OpenMP standard, Section 2.12.6, atomic Construct, '#pragma omp atomic write' is allowed to be used only for expression statements of form 'x = expr;', where x is a lvalue expression and expr is an expression with scalar type. Patch adds checks for it.

llvm-svn: 222913

9 years agoFix another memory leak in TableGen AsmMatcher by deleting CodeGenInstAliases.
Craig Topper [Fri, 28 Nov 2014 05:01:21 +0000 (05:01 +0000)]
Fix another memory leak in TableGen AsmMatcher by deleting CodeGenInstAliases.

llvm-svn: 222912

9 years agoAdd missing 'override' keyword.
Craig Topper [Fri, 28 Nov 2014 03:58:26 +0000 (03:58 +0000)]
Add missing 'override' keyword.

llvm-svn: 222911

9 years agoAdd support for UNWIND_X86_64_MODE_STACK_IND entries.
Jason Molenda [Fri, 28 Nov 2014 03:54:13 +0000 (03:54 +0000)]
Add support for UNWIND_X86_64_MODE_STACK_IND entries.
Correct the function offset computations in UNWIND_SECOND_LEVEL_REGULAR
tables.  A few other small fixes.

llvm-svn: 222910

9 years agoUse unique_ptr to fix some memory leaks in Tablegen AsmMatcherEmitter.
Craig Topper [Fri, 28 Nov 2014 03:53:02 +0000 (03:53 +0000)]
Use unique_ptr to fix some memory leaks in Tablegen AsmMatcherEmitter.

llvm-svn: 222909

9 years agoUse range-based for loops and const-correct a few things.
Craig Topper [Fri, 28 Nov 2014 03:53:00 +0000 (03:53 +0000)]
Use range-based for loops and const-correct a few things.

llvm-svn: 222908

9 years agoDo not incorrectly set the inverted flag.
Hongbin Zheng [Fri, 28 Nov 2014 03:26:06 +0000 (03:26 +0000)]
Do not incorrectly set the inverted flag.

In TempScopInfo::buildCondition we extract the conditions to guard the
BB *in addition of* loop bounds. This means we should only consider the
conditions in the paths (in CFG) that do not contain cycles (loops).

At the same time, we set the invert flag if the FalseBB of the current
branch dominates our target BB to indicate that we reach the target BB
with an inverted condition from the current branch.

In this case, the path from the FalseBB contains a cycle if the FalseBB
is the target of a backedge. The conditions implied by such a path should
not be consider. We can identify such a case by checking if the TrueBB
also dominates our target BB, which means we can also reach our target
BB from the TrueBB, without going through the backedge.

llvm-svn: 222907