platform/upstream/llvm.git
7 years ago[Mips] Document Mips Backend Relocation Principles
Joel Jones [Fri, 21 Apr 2017 14:49:27 +0000 (14:49 +0000)]
[Mips] Document Mips Backend Relocation Principles

This revision documents the combination of C++ and table-gen code that
handles relocations and addresses.

Thanks for Simon Dardis for the careful reviews.

Differential Revision: https://reviews.llvm.org/D31628

llvm-svn: 300986

7 years ago[clang-format] Replace IncompleteFormat by a struct with Line
Krasimir Georgiev [Fri, 21 Apr 2017 14:35:20 +0000 (14:35 +0000)]
[clang-format] Replace IncompleteFormat by a struct with Line

Summary: This patch replaces the boolean IncompleteFormat that is used to notify the client if an unrecoverable syntax error occurred by a struct that also contains a line number.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D32298

llvm-svn: 300985

7 years ago[AArch64][Falkor] Refine resource needs of STRQ with register offset.
Chad Rosier [Fri, 21 Apr 2017 14:33:13 +0000 (14:33 +0000)]
[AArch64][Falkor] Refine resource needs of STRQ with register offset.

llvm-svn: 300984

7 years ago[clang-format] Clang-tidy cleanup of NamespaceEndCommentFixerTest.cpp, NFC
Krasimir Georgiev [Fri, 21 Apr 2017 14:30:01 +0000 (14:30 +0000)]
[clang-format] Clang-tidy cleanup of NamespaceEndCommentFixerTest.cpp, NFC

llvm-svn: 300983

7 years ago[clang-format] Clang-tidy cleanup of CleanupTest.cpp, NFC
Krasimir Georgiev [Fri, 21 Apr 2017 14:21:21 +0000 (14:21 +0000)]
[clang-format] Clang-tidy cleanup of CleanupTest.cpp, NFC

llvm-svn: 300982

7 years ago[PR32667] -Wdocumentation should allow @param/@returns for fields/variables
Alex Lorenz [Fri, 21 Apr 2017 14:17:49 +0000 (14:17 +0000)]
[PR32667] -Wdocumentation should allow @param/@returns for fields/variables
that have a function/block pointer type

This commit improves the -Wdocumentation warning by making sure that @param and
@returns commands won't trigger warnings when used for fields, variables,
or properties whose type is a function/block pointer type. The
function/block pointer type must be specified directly with the declaration,
and when a typedef is used the warning is still emitted.

In the future we might also want to handle the std::function type as well.

rdar://24978538

llvm-svn: 300981

7 years ago[LV] Model if-converted phi node costs
Matthew Simpson [Fri, 21 Apr 2017 14:14:54 +0000 (14:14 +0000)]
[LV] Model if-converted phi node costs

Phi nodes in non-header blocks are converted to select instructions after
if-conversion. This patch updates the cost model to account for the selects.

Differential Revision: https://reviews.llvm.org/D31906

llvm-svn: 300980

7 years agoRevert r300964 + r300970 - [globalisel][tablegen] Import SelectionDAG's rule predicat...
Daniel Sanders [Fri, 21 Apr 2017 14:09:20 +0000 (14:09 +0000)]
Revert r300964 + r300970 - [globalisel][tablegen] Import SelectionDAG's rule predicates and support the equivalent in GIRule.

It's causing llvm-clang-x86_64-expensive-checks-win to fail to compile and I
haven't worked out why. Reverting to make it green while I figure it out.

llvm-svn: 300978

7 years ago[InstCombine] prefer xor with -1 because 'not' is easier to understand (PR32706)
Sanjay Patel [Fri, 21 Apr 2017 14:03:54 +0000 (14:03 +0000)]
[InstCombine] prefer xor with -1 because 'not' is easier to understand (PR32706)

This matches the demanded bits behavior in the DAG and should fix:
https://bugs.llvm.org/show_bug.cgi?id=32706

Differential Revision: https://reviews.llvm.org/D32255

llvm-svn: 300977

7 years ago[AArch64][Falkor] Refine loads/stores that require an extra LD pipe.
Chad Rosier [Fri, 21 Apr 2017 13:55:41 +0000 (13:55 +0000)]
[AArch64][Falkor] Refine loads/stores that require an extra LD pipe.

llvm-svn: 300976

7 years ago[AArch64][Falkor] Fix number of microops for WriteSTIdx missed in r300892.
Chad Rosier [Fri, 21 Apr 2017 13:37:01 +0000 (13:37 +0000)]
[AArch64][Falkor] Fix number of microops for WriteSTIdx missed in r300892.

llvm-svn: 300975

7 years ago[AArch64] Fix a few missed pre/post-inc in Falkor.
Chad Rosier [Fri, 21 Apr 2017 13:36:57 +0000 (13:36 +0000)]
[AArch64] Fix a few missed pre/post-inc in Falkor.

llvm-svn: 300974

7 years ago[ARM] GlobalISel: Add support for G_TRUNC
Diana Picus [Fri, 21 Apr 2017 13:16:50 +0000 (13:16 +0000)]
[ARM] GlobalISel: Add support for G_TRUNC

Select them as copies. We only select if both the source and the
destination are on the same register bank, so this shouldn't cause any
trouble.

llvm-svn: 300971

7 years ago[globalisel][tablegen] Try again to fix builds on old MSVC's after r300964
Daniel Sanders [Fri, 21 Apr 2017 12:51:43 +0000 (12:51 +0000)]
[globalisel][tablegen] Try again to fix builds on old MSVC's after r300964

This should fix llvm-clang-x86_64-expensive-checks-win

I reproduced the error using the following code:
namespace llvm {
// Moving this out of the llvm namespace fixes the error.
template<unsigned NumBits> class PredicateBitsetImpl {};
}
namespace {
const unsigned MAX_SUBTARGET_PREDICATES = 11;
// This works on Clang but is broken on MSVC
//     using PredicateBitset = PredicateBitsetImpl<MAX_SUBTARGET_PREDICATES>;
// Some versions emit a syntax error here ("error C2061: syntax error: identifier
// 'PredicateBitsetImpl'") but others accept it and only emit the C3646 below.
//
// This works on Clang and MSVC
using PredicateBitset = llvm::PredicateBitsetImpl<MAX_SUBTARGET_PREDICATES>;

class Foo {
private:
    PredicateBitset A; // error C3646: 'A': unknown override specifier
};
}

llvm-svn: 300970

7 years agoAdd support for openSUSE ARM Triples
Ismail Donmez [Fri, 21 Apr 2017 12:26:43 +0000 (12:26 +0000)]
Add support for openSUSE ARM Triples

Summary: Add support for armv6hl-suse-linux-gnueabi and armv7hl-suse-linux-gnueabi triples used by openSUSE/SUSE.

Reviewers: cfe-commits, rovka, compnerd, rengolin

Reviewed By: rengolin

Subscribers: aemerson, rengolin, bkramer, chandlerc

Differential Revision: https://reviews.llvm.org/D32347

llvm-svn: 300969

7 years agoRevert: r300966 - [globalisel][tablegen] Attempt to fix builds on old MSVC's after...
Daniel Sanders [Fri, 21 Apr 2017 12:08:25 +0000 (12:08 +0000)]
Revert: r300966 - [globalisel][tablegen] Attempt to fix builds on old MSVC's after r300964

It didn't fix the builder.

llvm-svn: 300968

7 years ago[ARM] GlobalISel: Make struct arguments fail elegantly
Diana Picus [Fri, 21 Apr 2017 11:53:01 +0000 (11:53 +0000)]
[ARM] GlobalISel: Make struct arguments fail elegantly

The condition in isSupportedType didn't handle struct/array arguments
properly. Fix the check and add a test to make sure we use the fallback
path in this kind of situation. The test deals with some common cases
where the call lowering should error out. There are still some issues
here that need to be addressed (tail calls come to mind), but they can
be addressed in other patches.

llvm-svn: 300967

7 years ago[globalisel][tablegen] Attempt to fix builds on old MSVC's after r300964
Daniel Sanders [Fri, 21 Apr 2017 11:29:29 +0000 (11:29 +0000)]
[globalisel][tablegen] Attempt to fix builds on old MSVC's after r300964

This should fix llvm-clang-x86_64-expensive-checks-win

llvm-svn: 300966

7 years agoGICHelper: remove forgotten isl foreach declarations
Tobias Grosser [Fri, 21 Apr 2017 10:50:33 +0000 (10:50 +0000)]
GICHelper: remove forgotten isl foreach declarations

These should have been dropped in r300323.

Suggested-by: Michael Kruse <llvm@meinersbur.de>
llvm-svn: 300965

7 years ago[globalisel][tablegen] Import SelectionDAG's rule predicates and support the equivale...
Daniel Sanders [Fri, 21 Apr 2017 10:27:20 +0000 (10:27 +0000)]
[globalisel][tablegen] Import SelectionDAG's rule predicates and support the equivalent in GIRule.

Summary:
The SelectionDAG importer now imports rules with Predicate's attached via
Requires, PredicateControl, etc. These predicates are implemented as
bitset's to allow multiple predicates to be tested together. However,
unlike the MC layer subtarget features, each target only pays for it's own
predicates (e.g. AArch64 doesn't have 192 feature bits just because X86
needs a lot).

Both AArch64 and X86 derive at least one predicate from the MachineFunction
or Function so they must re-initialize AvailableFeatures before each
function. They also declare locals in <Target>InstructionSelector so that
computeAvailableFeatures() can use the code from SelectionDAG without
modification.

Reviewers: rovka, qcolombet, aditya_nandakumar, t.p.northover, ab

Reviewed By: rovka

Subscribers: aemerson, rengolin, dberris, kristof.beyls, llvm-commits, igorb

Differential Revision: https://reviews.llvm.org/D31418

llvm-svn: 300964

7 years agotypo
Clement Courbet [Fri, 21 Apr 2017 09:21:05 +0000 (09:21 +0000)]
typo

llvm-svn: 300963

7 years agoadd skylake
Clement Courbet [Fri, 21 Apr 2017 09:21:01 +0000 (09:21 +0000)]
add skylake

llvm-svn: 300962

7 years agoadd 32 bit tests
Clement Courbet [Fri, 21 Apr 2017 09:20:58 +0000 (09:20 +0000)]
add 32 bit tests

llvm-svn: 300961

7 years agouse repmovsb when optimizing forminsize
Clement Courbet [Fri, 21 Apr 2017 09:20:55 +0000 (09:20 +0000)]
use repmovsb when optimizing forminsize

llvm-svn: 300960

7 years agoRename FastString flag.
Clement Courbet [Fri, 21 Apr 2017 09:20:50 +0000 (09:20 +0000)]
Rename FastString flag.

llvm-svn: 300959

7 years agoadd more tests
Clement Courbet [Fri, 21 Apr 2017 09:20:44 +0000 (09:20 +0000)]
add more tests

llvm-svn: 300958

7 years agoX86 memcpy: use REPMOVSB instead of REPMOVS{Q,D,W} for inline copies
Clement Courbet [Fri, 21 Apr 2017 09:20:39 +0000 (09:20 +0000)]
X86 memcpy: use REPMOVSB instead of REPMOVS{Q,D,W} for inline copies
when the subtarget has fast strings.

This has two advantages:
  - Speed is improved. For example, on Haswell thoughput improvements increase
    linearly with size from 256 to 512 bytes, after which they plateau:
    (e.g. 1% for 260 bytes, 25% for 400 bytes, 40% for 508 bytes).
  - Code is much smaller (no need to handle boundaries).

llvm-svn: 300957

7 years ago[DWARF] - Refactoring: localize handling of relocations in a single place.
George Rimar [Fri, 21 Apr 2017 09:12:18 +0000 (09:12 +0000)]
[DWARF] - Refactoring: localize handling of relocations in a single place.

This is splitted from D32228,
currently DWARF parsers code has few places that applied relocations values manually.
These places has similar duplicated code. Patch introduces separate method that can be
used to obtain relocated value. That helps to reduce code and simplifies things.

Differential revision: https://reviews.llvm.org/D32284

llvm-svn: 300956

7 years agoRevert r300889, r300906, r300935, r300939
Diana Picus [Fri, 21 Apr 2017 08:21:56 +0000 (08:21 +0000)]
Revert r300889, r300906, r300935, r300939

At least one of the ARM bots is still broken:
Command Output (stderr):
--
/home/buildslave/buildslave/clang-cmake-armv7-a15-full/llvm/projects/compiler-rt/test/asan/TestCases/Posix/strchr.c:31:12: error: expected string not found in input
 // CHECK: strchr.c:[[@LINE-2]]
           ^
<stdin>:3:59: note: scanning from here
==16297==ERROR: AddressSanitizer: SEGV on unknown address 0xb5add000 (pc 0xb6dccaa4 bp 0xbe8c19c8 sp 0xbe8c1570 T0)
                                                          ^
<stdin>:3:59: note: with expression "@LINE-2" equal to "29"
==16297==ERROR: AddressSanitizer: SEGV on unknown address 0xb5add000 (pc 0xb6dccaa4 bp 0xbe8c19c8 sp 0xbe8c1570 T0)
                                                          ^
<stdin>:5:57: note: possible intended match here
 #0 0xb6dccaa3 in strlen /build/glibc-f8FFOS/glibc-2.23/string/../sysdeps/arm/armv6t2/strlen.S:82

Try to fix by reverting r300889 and subsequent fixes:
Revert "[asan] Fix test by removing "The signal is caused" check."
Revert "[asan] Fix test on ppc64le-linux by checking "UNKNOWN memory access""
Revert "[asan] Match BUS and SIGV to fix test on Darwin"
Revert "[asan] Optimize strchr for strict_string_checks=false"

llvm-svn: 300955

7 years agoDelete dead code
Clement Courbet [Fri, 21 Apr 2017 07:40:59 +0000 (07:40 +0000)]
Delete dead code

llvm-svn: 300952

7 years ago[Thumb1] The recently added tADCS and tSBCS pseudo-instructions were missing `Uses...
Artyom Skrobov [Fri, 21 Apr 2017 07:35:21 +0000 (07:35 +0000)]
[Thumb1] The recently added tADCS and tSBCS pseudo-instructions were missing `Uses = [CPSR]`

Summary: Thanks to Oliver Stannard for helping catch this.

Reviewers: olista01, efriedma

Subscribers: llvm-commits, rengolin

Differential Revision: https://reviews.llvm.org/D31815

llvm-svn: 300951

7 years ago[AsmWriter] Eliminate warning. NFC
Serguei Katkov [Fri, 21 Apr 2017 06:14:38 +0000 (06:14 +0000)]
[AsmWriter] Eliminate warning. NFC

This patch eliminates the following warning

lib/IR/AsmWriter.cpp:1128:57: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
                 (StrVal[1] >= '0' && StrVal[1] <= '9')) &&

Reviewers: timshen, rnk, davide
Reviewed By: davide
Subscribers: davide, llvm-commits
Differential Revision: https://reviews.llvm.org/D32337

llvm-svn: 300950

7 years ago[index] Take advantage of 'external_source_symbol' attribute for indexing purposes
Argyrios Kyrtzidis [Fri, 21 Apr 2017 05:42:46 +0000 (05:42 +0000)]
[index] Take advantage of 'external_source_symbol' attribute for indexing purposes

- Ignore decls marked as 'generated_declaration'
- Include the 'defined_in' in the USR for additional namespacing

llvm-svn: 300949

7 years ago[index] For 'transparent' tag typedefs, ignore their tag reference
Argyrios Kyrtzidis [Fri, 21 Apr 2017 05:42:40 +0000 (05:42 +0000)]
[index] For 'transparent' tag typedefs, ignore their tag reference

llvm-svn: 300948

7 years ago[MSSA] Clean up the updater a bit. NFC
George Burgess IV [Fri, 21 Apr 2017 04:54:52 +0000 (04:54 +0000)]
[MSSA] Clean up the updater a bit. NFC

- Mark an internal function static
- Remove the llvm namespace (just holding on to the `using namespace
  llvm;` Works on My Machine(TM))

llvm-svn: 300947

7 years ago[PartialInliner] Fix crash when inlining functions with unreachable blocks.
Davide Italiano [Fri, 21 Apr 2017 04:25:00 +0000 (04:25 +0000)]
[PartialInliner] Fix crash when inlining functions with unreachable blocks.

CodeExtractor looks up the dominator node corresponding to return blocks
when splitting them. If one of these blocks is unreachable, there's no
node in the Dom and CodeExtractor crashes because it doesn't check
for domtree node validity.
In theory, we could add just a check for skipping null DTNodes in
`splitReturnBlock` but the fix I propose here is slightly different. To the
best of my knowledge, unreachable blocks are irrelevant for the algorithm,
therefore we can just skip them when building the candidate set in the
constructor.

Differential Revision:  https://reviews.llvm.org/D32335

llvm-svn: 300946

7 years ago[BPI] Add multiplication by scalar operators to BranchProbability
Serguei Katkov [Fri, 21 Apr 2017 03:14:30 +0000 (03:14 +0000)]
[BPI] Add multiplication by scalar operators to BranchProbability

This patch just adds two operators to BranchProbability class:
(BP * scalar) and (BP *= scalar).

Reviewers: junbuml, chandlerc, sanjoy, vsk

Reviewed By: chandlerc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D32334

llvm-svn: 300945

7 years agoupdate XFAIL comments with more details
Eric Fiselier [Fri, 21 Apr 2017 03:09:40 +0000 (03:09 +0000)]
update XFAIL comments with more details

llvm-svn: 300944

7 years ago[AsmWriter/APFloat] FP constant printing: Avoid usage of locale dependent snprinf
Serguei Katkov [Fri, 21 Apr 2017 02:52:17 +0000 (02:52 +0000)]
[AsmWriter/APFloat] FP constant printing: Avoid usage of locale dependent snprinf

This should fix the bug https://bugs.llvm.org/show_bug.cgi?id=12906

To print the FP constant AsmWriter does the following:

  1) convert FP value to String (actually using snprintf function which is locale dependent).
  2) Convert String back to FP Value
  3) Compare original and got FP values. If they are not equal just dump as hex.

The problem happens on the 2nd step when APFloat does not expect group delimiter or
fraction delimiter other than period symbol and so on, which can be produced on the
first step if LLVM library is used in an environment with corresponding locale set.

To fix this issue the locale independent APFloat:toString function is used.
However it prints FP values slightly differently than snprintf does. Specifically
it suppress trailing zeros in significant, use capital E and so on.
It results in 117 test failures during make check.
To avoid this I've also updated APFloat.toString a bit to pass make check at least.

Reviewers: sberg, bogner, majnemer, sanjoy, timshen, rnk

Reviewed By: timshen, rnk

Subscribers: rnk, llvm-commits

Differential Revision: https://reviews.llvm.org/D32276

llvm-svn: 300943

7 years agoMark exception_ptr tests as XFAIL on Windows for now
Eric Fiselier [Fri, 21 Apr 2017 02:13:33 +0000 (02:13 +0000)]
Mark exception_ptr tests as XFAIL on Windows for now

llvm-svn: 300942

7 years agoXFAIL Windows test failures under test/libcxx
Eric Fiselier [Fri, 21 Apr 2017 01:48:02 +0000 (01:48 +0000)]
XFAIL Windows test failures under test/libcxx

This patch XFAIL's a number of tests under test/libcxx when on Windows.
These failures need more investigation or patches to either Clang or libc++
but for now we don't want them to prevent the bot from going green.

llvm-svn: 300941

7 years agoRevert r300932 and r300930.
Akira Hatanaka [Fri, 21 Apr 2017 01:31:50 +0000 (01:31 +0000)]
Revert r300932 and r300930.

It seems that r300930 was creating an infinite loop in dag-combine when
compling the following file:

MultiSource/Benchmarks/MiBench/consumer-typeset/z21.c

llvm-svn: 300940

7 years ago[asan] Fix test by removing "The signal is caused" check.
Vitaly Buka [Fri, 21 Apr 2017 01:16:58 +0000 (01:16 +0000)]
[asan] Fix test by removing "The signal is caused" check.

llvm-svn: 300939

7 years ago[modules] Properly look up the owning module for an instantiation of a merged template.
Richard Smith [Fri, 21 Apr 2017 01:15:13 +0000 (01:15 +0000)]
[modules] Properly look up the owning module for an instantiation of a merged template.

When looking for the template instantiation pattern of a templated entity,
consistently select the definition of the pattern if there is one. This means
we'll pick the same owning module when we start instantiating a template that
we'll later pick when determining which modules are visible during that
instantiation.

This reinstates r300650, reverted in r300659, with a fix for a regression
reported by Chandler after commit.

llvm-svn: 300938

7 years agoResolve unused local typedef warning in test.
Billy Robert O'Neal III [Fri, 21 Apr 2017 01:10:04 +0000 (01:10 +0000)]
Resolve unused local typedef warning in test.

llvm-svn: 300937

7 years ago[analyzer] Fix assert in ExprEngine::processSwitch
Alexander Shaposhnikov [Fri, 21 Apr 2017 01:05:26 +0000 (01:05 +0000)]
[analyzer] Fix assert in ExprEngine::processSwitch

This diff replaces getTypeSize(CondE->getType()))
with getIntWidth(CondE->getType())) in ExprEngine::processSwitch.
These calls are not equivalent for bool, see ASTContext.cpp
Add a test case.

Test plan:
make check-clang-analysis
make check-clang

Differential revision: https://reviews.llvm.org/D32328

llvm-svn: 300936

7 years ago[asan] Fix test on ppc64le-linux by checking "UNKNOWN memory access"
Vitaly Buka [Fri, 21 Apr 2017 00:48:43 +0000 (00:48 +0000)]
[asan] Fix test on ppc64le-linux by checking "UNKNOWN memory access"

llvm-svn: 300935

7 years agoFix 'verify-support' available feature
Eric Fiselier [Fri, 21 Apr 2017 00:43:07 +0000 (00:43 +0000)]
Fix 'verify-support' available feature

llvm-svn: 300934

7 years agoDisable LSan on ppc64, some tests are failing.
Alex Shlyapnikov [Fri, 21 Apr 2017 00:36:29 +0000 (00:36 +0000)]
Disable LSan on ppc64, some tests are failing.

llvm-svn: 300933

7 years ago[AArch64] Use suffix ULL to shift a 64-bit value.
Akira Hatanaka [Fri, 21 Apr 2017 00:35:27 +0000 (00:35 +0000)]
[AArch64] Use suffix ULL to shift a 64-bit value.

llvm-svn: 300932

7 years ago[CodeExtractor] Remove an unneeded level of indirection. NFCI.
Davide Italiano [Fri, 21 Apr 2017 00:21:09 +0000 (00:21 +0000)]
[CodeExtractor] Remove an unneeded level of indirection. NFCI.

llvm-svn: 300931

7 years ago[AArch64] Improve code generation for logical instructions taking
Akira Hatanaka [Fri, 21 Apr 2017 00:05:16 +0000 (00:05 +0000)]
[AArch64] Improve code generation for logical instructions taking
immediate operands.

This commit adds an AArch64 dag-combine that optimizes code generation
for logical instructions taking immediate operands. The optimization
uses demanded bits to change a logical instruction's immediate operand
so that the immediate can be folded into the immediate field of the
instruction.

This recommits r300913, which broke bots because I didn't fix a call to
ShrinkDemandedConstant in SIISelLowering.cpp after changing the APIs of
TargetLoweringOpt and TargetLowering.

rdar://problem/18231627

Differential Revision: https://reviews.llvm.org/D5591

llvm-svn: 300930

7 years agoRevert "Enable lsan test suite on Darwin x86_64 builds"
Ahmed Bougacha [Fri, 21 Apr 2017 00:00:59 +0000 (00:00 +0000)]
Revert "Enable lsan test suite on Darwin x86_64 builds"

This reverts commit r300897.

Most LSan/ASan tests are failing on darwin bots.

llvm-svn: 300929

7 years agoRevert r300746 (SCEV analysis for or instructions).
Eli Friedman [Thu, 20 Apr 2017 23:59:05 +0000 (23:59 +0000)]
Revert r300746 (SCEV analysis for or instructions).

There have been multiple reports of this causing problems: a
compile-time explosion on the LLVM testsuite, and a stack
overflow for an opencl kernel.

llvm-svn: 300928

7 years ago[InstCombine] Remove the zextOrTrunc from ShrinkDemandedConstant.
Craig Topper [Thu, 20 Apr 2017 23:58:27 +0000 (23:58 +0000)]
[InstCombine] Remove the zextOrTrunc from ShrinkDemandedConstant.

The demanded mask and the constant should always be the same width for all callers today.

Also stop copying the demanded mask as its passed in. We should avoid allocating memory unless we are going to do something. The final AND to create the new constant will take care of it.

llvm-svn: 300927

7 years ago[asan] move textdomain.c to Linux dir, as the test is Linux-specific
Kostya Serebryany [Thu, 20 Apr 2017 23:57:44 +0000 (23:57 +0000)]
[asan] move textdomain.c to Linux dir, as the test is Linux-specific

llvm-svn: 300926

7 years agoFix PR25874 - cxa_thread_atexit_test.pass.cpp has an incorrect XFAIL.
Eric Fiselier [Thu, 20 Apr 2017 23:40:35 +0000 (23:40 +0000)]
Fix PR25874 - cxa_thread_atexit_test.pass.cpp has an incorrect XFAIL.

llvm-svn: 300925

7 years agosanitizer: fix crash with textdomain(NULL) interceptor
Kostya Serebryany [Thu, 20 Apr 2017 23:38:10 +0000 (23:38 +0000)]
sanitizer: fix crash with textdomain(NULL) interceptor

Summary:
The textdomain function accepts a NULL parameter (and should then return the
current message domain). Add a check for this and include ASAN tests.

Link: https://github.com/google/sanitizers/issues/787
Reviewers: m.guseva, kcc

Reviewed By: kcc

Subscribers: kubamracek

Differential Revision: https://reviews.llvm.org/D32318

llvm-svn: 300924

7 years agoX86RegisterInfo: eliminateFrameIndex: Avoid code duplication; NFC
Matthias Braun [Thu, 20 Apr 2017 23:34:50 +0000 (23:34 +0000)]
X86RegisterInfo: eliminateFrameIndex: Avoid code duplication; NFC

X86RegisterInfo::eliminateFrameIndex() and
X86FrameLowering::getFrameIndexReference() both had logic to compute the
base register. This consolidates the code.

Also use MachineInstr::isReturn instead of manually enumerating tail
call instructions (return instructions were not included in the previous
list because they never reference frame indexes).

Differential Revision: https://reviews.llvm.org/D32206

llvm-svn: 300923

7 years agoX86RegisterInfo: eliminateFrameIndex: Force SP for AfterFPPop; NFC
Matthias Braun [Thu, 20 Apr 2017 23:34:46 +0000 (23:34 +0000)]
X86RegisterInfo: eliminateFrameIndex: Force SP for AfterFPPop; NFC

AfterFPPop is used for tailcall/tailjump instructions. We shouldn't ever
have frame-pointer/base-pointer relative addressing for those. After all
the frame/base pointer should already be restored to their previous
values at the return.

Make this fact explicit in preparation for an upcoming refactoring.

Differential Revision: https://reviews.llvm.org/D32205

llvm-svn: 300922

7 years ago[libc++] Default to vcruntime when targeting MSVC
Shoaib Meenai [Thu, 20 Apr 2017 23:33:49 +0000 (23:33 +0000)]
[libc++] Default to vcruntime when targeting MSVC

Summary:
libc++abi is never the right option for LIBCXX_TARGETING_MSVC, since it
targets the Itanium ABI, whereas MSVC uses the Microsoft ABI. Make the
default ABI be vcruntime when targeting MSVC even if libc++abi is
present in the tree.

Differential Revision: https://reviews.llvm.org/D32320

llvm-svn: 300921

7 years agoFix ATOMIC_<TYPE>_LOCK_FREE macros on Windows.
Eric Fiselier [Thu, 20 Apr 2017 23:22:46 +0000 (23:22 +0000)]
Fix ATOMIC_<TYPE>_LOCK_FREE macros on Windows.

Previously the ATOMIC_<TYPE>_LOCK_FREE macros were implemented
using __GCC_ATOMIC_<TYPE>_LOCK_FREE but GCC specific macros
are defined when -fms-compatibility is specified.

To avoid this Libc++ now tries to use the newly added
__CLANG_ATOMIC_<TYPE>_LOCK_FREE macros instead, and only falls
back to the GCC versions when the Clang ones aren't available.

llvm-svn: 300920

7 years agoUse __CLANG_ATOMIC_TYPE_LOCK_FREE macros in `stdatomic.h`
Eric Fiselier [Thu, 20 Apr 2017 23:07:38 +0000 (23:07 +0000)]
Use __CLANG_ATOMIC_TYPE_LOCK_FREE macros in `stdatomic.h`

Summary: This patch makes the header `stdatomic.h` work when `-fms-compatibility` is specified.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D32322

llvm-svn: 300919

7 years agoFix typo in comment
Sanjoy Das [Thu, 20 Apr 2017 23:07:00 +0000 (23:07 +0000)]
Fix typo in comment

llvm-svn: 300918

7 years ago[CMake] Enable ARM target in Fuchsia toolchain
Petr Hosek [Thu, 20 Apr 2017 23:06:53 +0000 (23:06 +0000)]
[CMake] Enable ARM target in Fuchsia toolchain

This is still used by some users of Fuchsia toolchain. Also include
llc and opt which is useful for development and testing.

Differential Revision: https://reviews.llvm.org/D32231

llvm-svn: 300917

7 years agoRevert "[AArch64] Improve code generation for logical instructions taking"
Akira Hatanaka [Thu, 20 Apr 2017 23:03:30 +0000 (23:03 +0000)]
Revert "[AArch64] Improve code generation for logical instructions taking"

This reverts r300913.

This broke bots.

llvm-svn: 300916

7 years ago[Simplify] Add testcase to show that merging conditional stores for triangles is...
Craig Topper [Thu, 20 Apr 2017 22:57:36 +0000 (22:57 +0000)]
[Simplify] Add testcase to show that merging conditional stores for triangles is sensitive to the order of the branch targets on the conditional branches. NFC

llvm-svn: 300915

7 years agoAdd __CLANG_ATOMIC_<TYPE>_LOCK_FREE macros for use in MSVC compatibility mode.
Eric Fiselier [Thu, 20 Apr 2017 22:53:57 +0000 (22:53 +0000)]
Add __CLANG_ATOMIC_<TYPE>_LOCK_FREE macros for use in MSVC compatibility mode.

Summary:
Libc++ currently implements the `ATOMIC_<TYPE>_LOCK_FREE` macros using the `__GCC_ATOMIC_<TYPE>_LOCK_FREE` macros. However these are not available when MSVC compatibility is enabled even though C11 `_Atomic` is.  This prevents libc++ from correctly implementing `ATOMIC_<TYPE>_LOCK_FREE`.

This patch adds an alternative spelling `__CLANG_ATOMIC_<TYPE>_LOCK_FREE` that is enabled with `-fms-compatibility`.

Reviewers: rsmith, aaron.ballman, majnemer, zturner, compnerd, jfb, rnk

Reviewed By: rsmith

Subscribers: BillyONeal, smeenai, jfb, cfe-commits, dschuff

Differential Revision: https://reviews.llvm.org/D32265

llvm-svn: 300914

7 years ago[AArch64] Improve code generation for logical instructions taking
Akira Hatanaka [Thu, 20 Apr 2017 22:47:56 +0000 (22:47 +0000)]
[AArch64] Improve code generation for logical instructions taking
immediate operands.

This commit adds an AArch64 dag-combine that optimizes code generation
for logical instructions taking immediate operands. The optimization
uses demanded bits to change a logical instruction's immediate operand
so that the immediate can be folded into the immediate field of the
instruction.

rdar://problem/18231627

Differential Revision: https://reviews.llvm.org/D5591

llvm-svn: 300913

7 years ago[InstCombine] function names start with lower-case letter; NFC
Sanjay Patel [Thu, 20 Apr 2017 22:37:01 +0000 (22:37 +0000)]
[InstCombine] function names start with lower-case letter; NFC

Forgot to make this fix with the signature change in r300911.

llvm-svn: 300912

7 years ago[InstCombine] allow shl+shr demanded bits folds with splat constants
Sanjay Patel [Thu, 20 Apr 2017 22:33:54 +0000 (22:33 +0000)]
[InstCombine] allow shl+shr demanded bits folds with splat constants

llvm-svn: 300911

7 years agoCOFF: Remove some undefined declarations. NFC.
Peter Collingbourne [Thu, 20 Apr 2017 22:23:36 +0000 (22:23 +0000)]
COFF: Remove some undefined declarations. NFC.

llvm-svn: 300910

7 years agoSema: protect against ObjC++ typo-correction failure
Saleem Abdulrasool [Thu, 20 Apr 2017 22:23:10 +0000 (22:23 +0000)]
Sema: protect against ObjC++ typo-correction failure

ObjC++ has two different types of "pointer" types (ObjCClassPointerType
and PointerType).  Both can be indirected through.  However, the former
is not a member expression.  Ensure that we do not try to rebuild the
MRE in that case.

llvm-svn: 300909

7 years agoParse: cleanup some bleeding whitespace
Saleem Abdulrasool [Thu, 20 Apr 2017 22:23:07 +0000 (22:23 +0000)]
Parse: cleanup some bleeding whitespace

Clean up some bleeding whitespace that I noticed.  NFC

llvm-svn: 300908

7 years ago[InstCombine] add tests for shl+shr demanded bits splat vector folds; NFC
Sanjay Patel [Thu, 20 Apr 2017 22:18:47 +0000 (22:18 +0000)]
[InstCombine] add tests for shl+shr demanded bits splat vector folds; NFC

llvm-svn: 300907

7 years ago[asan] Match BUS and SIGV to fix test on Darwin
Vitaly Buka [Thu, 20 Apr 2017 21:58:18 +0000 (21:58 +0000)]
[asan] Match BUS and SIGV to fix test on Darwin

llvm-svn: 300906

7 years agoAArch64: lower "fence singlethread" to a pure compiler barrier.
Tim Northover [Thu, 20 Apr 2017 21:57:45 +0000 (21:57 +0000)]
AArch64: lower "fence singlethread" to a pure compiler barrier.

Single-threaded fences aren't required to provide any synchronization with
other processing elements so there's no need for a DMB. They should still be a
barrier for compiler optimizations though.

llvm-svn: 300905

7 years agoARM: lower "fence singlethread" to a pure compiler barrier.
Tim Northover [Thu, 20 Apr 2017 21:56:52 +0000 (21:56 +0000)]
ARM: lower "fence singlethread" to a pure compiler barrier.

Single-threaded fences aren't required to provide any synchronization with
other processing elements so there's no need for a DMB. They should still be a
barrier for compiler optimizations though.

llvm-svn: 300904

7 years agoEnable LSan on PowerPC64.
Alex Shlyapnikov [Thu, 20 Apr 2017 21:56:36 +0000 (21:56 +0000)]
Enable LSan on PowerPC64.

Summary: Re-landing reverted D31995 with suppressions defined in D32303.

Reviewers: eugenis

Subscribers: nemanjai, llvm-commits

Differential Revision: https://reviews.llvm.org/D32314

llvm-svn: 300903

7 years agoAdd an example command to toggle between disassembly-only and source mode.
Jim Ingham [Thu, 20 Apr 2017 21:51:27 +0000 (21:51 +0000)]
Add an example command to toggle between disassembly-only and source mode.

Sometimes you are debugging in source, but you really only want to see
the disassembly.  That's easy to do but you have to set a few variables.
This command toggles between your old values, and a disassembly only mode.

llvm-svn: 300902

7 years ago[cfi] Add explicit -flto in create-derivers test.
Evgeniy Stepanov [Thu, 20 Apr 2017 21:44:37 +0000 (21:44 +0000)]
[cfi] Add explicit -flto in create-derivers test.

This is necessary to run the test suite in ThinLTO mode - otherwise
opt complains about an input file containing several modules.

llvm-svn: 300901

7 years ago[cfi] Move one test under cross-dso/icall.
Evgeniy Stepanov [Thu, 20 Apr 2017 21:44:35 +0000 (21:44 +0000)]
[cfi] Move one test under cross-dso/icall.

The test is using indirect calls.

llvm-svn: 300900

7 years agoUse basicblock split block utility function
Xinliang David Li [Thu, 20 Apr 2017 21:40:22 +0000 (21:40 +0000)]
Use basicblock split block utility function

Instead of calling BasicBlock::SplitBasicBlock directly in
CodeExtractor.

Differential Revision: https://reviews.llvm.org/D32308

llvm-svn: 300899

7 years ago[InstCombine] allow shl demanded bits folds with splat constants
Sanjay Patel [Thu, 20 Apr 2017 21:33:02 +0000 (21:33 +0000)]
[InstCombine] allow shl demanded bits folds with splat constants

More fixes are needed to enable the helper SimplifyShrShlDemandedBits().

llvm-svn: 300898

7 years agoEnable lsan test suite on Darwin x86_64 builds
Francis Ricci [Thu, 20 Apr 2017 21:27:25 +0000 (21:27 +0000)]
Enable lsan test suite on Darwin x86_64 builds

Reviewers: kubamracek, alekseyshl

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D32191

llvm-svn: 300897

7 years ago[InstCombine] Use APInt::intersects and APInt::isSubsetOf to improve a few more place...
Craig Topper [Thu, 20 Apr 2017 21:24:37 +0000 (21:24 +0000)]
[InstCombine] Use APInt::intersects and APInt::isSubsetOf to improve a few more places in SimplifyDemandedBits.

llvm-svn: 300896

7 years agoFix Python 2 vs 3 incompatability with dict.items() vs iteritems()
Eric Fiselier [Thu, 20 Apr 2017 21:23:58 +0000 (21:23 +0000)]
Fix Python 2 vs 3 incompatability with dict.items() vs iteritems()

llvm-svn: 300895

7 years agoEnable leak sanitizer builds for darwin
Francis Ricci [Thu, 20 Apr 2017 21:11:51 +0000 (21:11 +0000)]
Enable leak sanitizer builds for darwin

Summary:
Support for leak sanitizer on darwin has been added to
compiler-rt, this patch adds compiler support.

Reviewers: dexonsmith, compnerd

Subscribers: alekseyshl, kubamracek, cfe-commits

Differential Revision: https://reviews.llvm.org/D32192

llvm-svn: 300894

7 years ago[AArch64] Whitespace/ordering fixes for Falkor machine description. NFC.
Chad Rosier [Thu, 20 Apr 2017 21:11:17 +0000 (21:11 +0000)]
[AArch64] Whitespace/ordering fixes for Falkor machine description. NFC.

llvm-svn: 300893

7 years ago[AArch64] Refine Falkor machine description for pre/post-inc and stores.
Chad Rosier [Thu, 20 Apr 2017 21:11:09 +0000 (21:11 +0000)]
[AArch64] Refine Falkor machine description for pre/post-inc and stores.

llvm-svn: 300892

7 years agoBegin making git-clang-format python3 compatible.
Eric Fiselier [Thu, 20 Apr 2017 21:05:58 +0000 (21:05 +0000)]
Begin making git-clang-format python3 compatible.

This patch fixes most of the python3 incompatabilities
within git-clang-format while keeping the script python2 compatible.
There is still one remaining incompatability that prevents using Python3
which is the `str` vs `byte` type change. I plan to put those fixes
up for review separately.

This patch contains fixes for the following incompatabilities:

1) Use the new style Python3 `print` function. This requires importing
   __future__.print_function.

2) Fix incompatability between the Python3 octal prefix and the
   octal prefix Git uses.

3) Replace use of dict.iteritems() with dict.viewitems() because iteritems()
   has been removed in Python3. viewitems() reviews python 2.7 but that is
   also what the script is documented as requiring.

llvm-svn: 300891

7 years agomake detect_leaks=1 the default for the lsan test suite
Francis Ricci [Thu, 20 Apr 2017 21:00:02 +0000 (21:00 +0000)]
make detect_leaks=1 the default for the lsan test suite

Summary:
This already appears to be the case in all .cc test files,
it was probably left out of the .c test files accidentally. Make it a global
default, instead of manually adding it to each individual test.

This is needed to force leak detection for Darwin tests, where leak detection
is disabled by default.

Reviewers: m.ostapenko, kubamracek, alekseyshl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D32297

llvm-svn: 300890

7 years ago[asan] Optimize strchr for strict_string_checks=false
Vitaly Buka [Thu, 20 Apr 2017 20:59:37 +0000 (20:59 +0000)]
[asan] Optimize strchr for strict_string_checks=false

Summary:
strchr interceptor does not need to call strlen if strict_string_checks is not
enabled. Unnecessary strlen calls affect python parser performance.

Reviewers: eugenis, kcc

Subscribers: llvm-commits, kubamracek

Differential Revision: https://reviews.llvm.org/D32264

llvm-svn: 300889

7 years ago[InstCombine] allow ashr/lshr demanded bits folds with splat constants
Sanjay Patel [Thu, 20 Apr 2017 20:59:02 +0000 (20:59 +0000)]
[InstCombine] allow ashr/lshr demanded bits folds with splat constants

llvm-svn: 300888

7 years agoDefine standard suppressions for LSan, start with this one.
Alex Shlyapnikov [Thu, 20 Apr 2017 20:54:22 +0000 (20:54 +0000)]
Define standard suppressions for LSan, start with this one.

llvm-svn: 300887

7 years agoDefine a suppression for known leaks on pthread_exit call.
Alex Shlyapnikov [Thu, 20 Apr 2017 20:54:19 +0000 (20:54 +0000)]
Define a suppression for known leaks on pthread_exit call.

Summary: Refer to D32194 for the context.

Reviewers: eugenis

Subscribers: kubamracek, llvm-commits

Differential Revision: https://reviews.llvm.org/D32303

llvm-svn: 300886

7 years ago[InstCombine] Use APInt::isSubsetOf to simplify some code in SimplifyDemandedBits...
Craig Topper [Thu, 20 Apr 2017 20:47:35 +0000 (20:47 +0000)]
[InstCombine] Use APInt::isSubsetOf to simplify some code in SimplifyDemandedBits. NFC

This allows us to use less temporary APInt for And and Invert operations.

llvm-svn: 300885

7 years ago[InstCombine] add tests for demanded bits ashr/lshr splat constants; NFC
Sanjay Patel [Thu, 20 Apr 2017 20:44:54 +0000 (20:44 +0000)]
[InstCombine] add tests for demanded bits ashr/lshr splat constants; NFC

llvm-svn: 300884

7 years agoDon't emit locations that need a DW_OP_stack_value in DWARF 2 & 3.
Adrian Prantl [Thu, 20 Apr 2017 20:42:33 +0000 (20:42 +0000)]
Don't emit locations that need a DW_OP_stack_value in DWARF 2 & 3.

https://bugs.llvm.org/show_bug.cgi?id=32382

llvm-svn: 300883

7 years ago[Support] Make asan poisoning for recyclers more aggressive by also poisoning the...
Benjamin Kramer [Thu, 20 Apr 2017 20:28:18 +0000 (20:28 +0000)]
[Support] Make asan poisoning for recyclers more aggressive by also poisoning the 'next' pointer.

llvm-svn: 300882