platform/upstream/llvm.git
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

7 years agoFix comment and remove incorrect linker flags in test configuration
Eric Fiselier [Thu, 20 Apr 2017 20:22:19 +0000 (20:22 +0000)]
Fix comment and remove incorrect linker flags in test configuration

llvm-svn: 300881

7 years agoRemove stray ^S. NFC.
Benjamin Kramer [Thu, 20 Apr 2017 20:03:36 +0000 (20:03 +0000)]
Remove stray ^S. NFC.

llvm-svn: 300880

7 years ago[DWARF] Fix a couple of typos
Paul Robinson [Thu, 20 Apr 2017 20:03:03 +0000 (20:03 +0000)]
[DWARF] Fix a couple of typos

llvm-svn: 300879

7 years agoARM: handle post-indexed NEON ops where the offset isn't the access width.
Tim Northover [Thu, 20 Apr 2017 19:54:02 +0000 (19:54 +0000)]
ARM: handle post-indexed NEON ops where the offset isn't the access width.

Before, we assumed that any ConstantInt offset was precisely the access width,
so we could use the "[rN]!" form. ISelLowering only ever created that kind, but
further simplification during combining could lead to unexpected constants and
incorrect codegen.

Should fix PR32658.

llvm-svn: 300878

7 years agoVarStreamArrayIterator needed non-const operator* overload.
Adrian McCarthy [Thu, 20 Apr 2017 19:34:06 +0000 (19:34 +0000)]
VarStreamArrayIterator needed non-const operator* overload.

Without this change, the operator-> provided by iterator_facade lost type
qualifiers.

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

llvm-svn: 300877

7 years ago[InstCombine] Remove redundant code from SimplifyDemandedBits handling for Or. The...
Craig Topper [Thu, 20 Apr 2017 19:31:22 +0000 (19:31 +0000)]
[InstCombine] Remove redundant code from SimplifyDemandedBits handling for Or. The code above it is equivalent if you work through the bitwise math.

llvm-svn: 300876

7 years ago[DWARF] Versioning for DWARF constants; verify FORMs
Paul Robinson [Thu, 20 Apr 2017 19:16:51 +0000 (19:16 +0000)]
[DWARF] Versioning for DWARF constants; verify FORMs

Associate the version-when-defined with definitions of standard DWARF
constants.  Identify the "vendor" for DWARF extensions.
Use this information to verify FORMs in .debug_abbrev are defined as
of the DWARF version specified in the associated unit.
Removed two tests that had specified DWARF v1 (which essentially does
not exist).

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

llvm-svn: 300875

7 years ago[DeLICM] Use Known information when comparing Existing.Written and Proposed.Written.
Michael Kruse [Thu, 20 Apr 2017 19:16:39 +0000 (19:16 +0000)]
[DeLICM] Use Known information when comparing Existing.Written and Proposed.Written.

This change only affects unit tests, but no functional changes are
expected on LLVM-IR, as no Known information is yet extracted and
consequently this functionality is only triggered through unit tests.

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

llvm-svn: 300874

7 years ago[Driver] Add a missing -no-canonical-prefixes to test.
Benjamin Kramer [Thu, 20 Apr 2017 19:06:24 +0000 (19:06 +0000)]
[Driver] Add a missing -no-canonical-prefixes to test.

llvm-svn: 300873

7 years ago[go bindings] Rmove duplicated conversion function definitions after r300843.
Benjamin Kramer [Thu, 20 Apr 2017 19:06:11 +0000 (19:06 +0000)]
[go bindings] Rmove duplicated conversion function definitions after r300843.

llvm-svn: 300872

7 years ago[AArch64] Improve scheduling of logical operations on Falkor.
Chad Rosier [Thu, 20 Apr 2017 18:50:21 +0000 (18:50 +0000)]
[AArch64] Improve scheduling of logical operations on Falkor.

llvm-svn: 300871

7 years ago[Thumb-1] Fix corner cases for compressed jump tables
Weiming Zhao [Thu, 20 Apr 2017 18:37:14 +0000 (18:37 +0000)]
[Thumb-1] Fix corner cases for compressed jump tables

Summary:
When synthesized TBB/TBH is expanded, we need to avoid the case of:
   BaseReg is redefined after the load of branching target. E.g.:

    %R2 = tLEApcrelJT <jt#1>
    %R1 =  tLDRr %R1, %R2    ==> %R2 = tLEApcrelJT <jt#1>
    %R2 = tLDRspi %SP, 12        %R2 = tLDRspi %SP, 12
    tBR_JTr %R1                  tTBB_JT %R2, %R1
`
Reviewers: jmolloy

Reviewed By: jmolloy

Subscribers: llvm-commits, rengolin

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

llvm-svn: 300870

7 years ago[CodeExtractor] Remove a bunch of unneeded constructors.
Davide Italiano [Thu, 20 Apr 2017 18:33:40 +0000 (18:33 +0000)]
[CodeExtractor] Remove a bunch of unneeded constructors.

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

llvm-svn: 300869

7 years ago[Recycler] Add asan/msan annotations.
Benjamin Kramer [Thu, 20 Apr 2017 18:29:37 +0000 (18:29 +0000)]
[Recycler] Add asan/msan annotations.

This enables use after free and uninit memory checking for memory
returned by a recycler. SelectionDAG currently relies on the opcode of a
free'd node being ISD::DELETED_NODE, so poke a hole in the asan poison
for SDNode opcodes. This means that we won't find some issues, but only
in SDag.

llvm-svn: 300868

7 years agoFix use-after-frees on memory allocated in a Recycler.
Benjamin Kramer [Thu, 20 Apr 2017 18:29:14 +0000 (18:29 +0000)]
Fix use-after-frees on memory allocated in a Recycler.

This will become asan errors once the patch lands that poisons the
memory after free. The x86 change is a hack, but I don't see how to
solve this properly at the moment.

llvm-svn: 300867

7 years agoFixing outdated comment [NFC]
Artyom Skrobov [Thu, 20 Apr 2017 18:20:02 +0000 (18:20 +0000)]
Fixing outdated comment [NFC]

Since r32105 back in 2006, RegisterPass doesn't support
passes without a default constructor.

llvm-svn: 300866

7 years agoFix formatting of constrained FP intrinsic documentation
Andrew Kaylor [Thu, 20 Apr 2017 18:18:36 +0000 (18:18 +0000)]
Fix formatting of constrained FP intrinsic documentation

llvm-svn: 300865

7 years agoCodeGen: Let frame index value type match alloca addr space
Yaxun Liu [Thu, 20 Apr 2017 18:15:34 +0000 (18:15 +0000)]
CodeGen: Let frame index value type match alloca addr space

Recently alloca address space has been added to data layout. Due to this
change, pointer returned by alloca may have different size as pointer in
address space 0.

However, currently the value type of frame index is assumed to be of the
same size as pointer in address space 0.

This patch fixes that.

Most targets assume alloca returning pointer in address space 0, which
is the default alloca address space. Therefore it is NFC for them.

AMDGCN target with amdgiz environment requires this change since it
assumes alloca returning pointer to addr space 5 and its size is 32,
which is different from the size of pointer in addr space 0 which is 64.

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

llvm-svn: 300864

7 years agoRemove duplicate AttributeList::removeAttributes implementation
Reid Kleckner [Thu, 20 Apr 2017 18:08:36 +0000 (18:08 +0000)]
Remove duplicate AttributeList::removeAttributes implementation

Have the AttributeList overload delegate to the AttrBuilder one.
Simplify the AttrBuilder overload by avoiding getSlotAttributes, which
creates temporary AttributeLists.

Simplify `AttrBuilder::removeAttributes(AttributeList, unsigned)` by
using getAttributes instead of manually iterating over slots.

Extracted from https://reviews.llvm.org/D32262

NFC

llvm-svn: 300863

7 years agoChanged a use of APInt::getSignBit to APInt::getSignMask.
Sean Callanan [Thu, 20 Apr 2017 18:07:51 +0000 (18:07 +0000)]
Changed a use of APInt::getSignBit to APInt::getSignMask.

llvm-svn: 300862

7 years ago[scudo] Remove GetActuallyAllocatedSize calls from the fast path
Kostya Kortchinsky [Thu, 20 Apr 2017 18:07:17 +0000 (18:07 +0000)]
[scudo] Remove GetActuallyAllocatedSize calls from the fast path

Summary:
GetActuallyAllocatedSize is actually expensive. In order to avoid calling this
function in the malloc/free fast path, we change the Scudo chunk header to
store the size of the chunk, if from the Primary, or the amount of unused
bytes if from the Secondary. This way, we only have to call the culprit
function for Secondary backed allocations (and still in realloc).

The performance gain on a singly threaded pure malloc/free benchmark exercising
the Primary allocator is above 5%.

Reviewers: alekseyshl, kcc, dvyukov

Reviewed By: dvyukov

Subscribers: llvm-commits

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

llvm-svn: 300861

7 years ago[DAGCombiner] use more local variables in isAlias(); NFCI
Sanjay Patel [Thu, 20 Apr 2017 18:02:27 +0000 (18:02 +0000)]
[DAGCombiner] use more local variables in isAlias(); NFCI

llvm-svn: 300860

7 years ago[WebAssembly] Add known failures for wasm object file backend
Sam Clegg [Thu, 20 Apr 2017 17:18:15 +0000 (17:18 +0000)]
[WebAssembly] Add known failures for wasm object file backend

Subscribers: jfb, dschuff

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

llvm-svn: 300859

7 years agoDon't pass FPOpFusion::Strict to the backend
Adam Nemet [Thu, 20 Apr 2017 17:09:35 +0000 (17:09 +0000)]
Don't pass FPOpFusion::Strict to the backend

This restores the behavior prior to D31167 where the code-gen default was
FPC_On which mapped to FPOpFusion::Standard.  After merging the FE
state (on/off) and the code-gen state (on/fast/off), the default became off to
match the front-end.

In other words, the front-end controls when to fuse along the language
standards and the backend shouldn't override this by splitting fused
intrinsics as FPOpFusion::Strict would imply.

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

llvm-svn: 300858

7 years agoResubmit "[BitVector] Add operator<<= and operator>>=."
Zachary Turner [Thu, 20 Apr 2017 16:56:54 +0000 (16:56 +0000)]
Resubmit "[BitVector] Add operator<<= and operator>>=."

This was failing due to the use of assigning a Mask to an
unsigned, rather than to a BitWord.  But most systems do not
have sizeof(unsigned) == sizeof(unsigned long), so the mask
was getting truncated.

llvm-svn: 300857

7 years ago[APInt] Rename getSignBit to getSignMask
Craig Topper [Thu, 20 Apr 2017 16:56:25 +0000 (16:56 +0000)]
[APInt] Rename getSignBit to getSignMask

getSignBit is a static function that creates an APInt with only the sign bit set. getSignMask seems like a better name to convey its functionality. In fact several places use it and then store in an APInt named SignMask.

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

llvm-svn: 300856

7 years ago[SVE] Fix mismatched sign comparison warning in unit test from r300842.
Amara Emerson [Thu, 20 Apr 2017 16:54:49 +0000 (16:54 +0000)]
[SVE] Fix mismatched sign comparison warning in unit test from r300842.

llvm-svn: 300855

7 years ago[DAGCombiner] fix variable names in isAlias(); NFCI
Sanjay Patel [Thu, 20 Apr 2017 16:36:37 +0000 (16:36 +0000)]
[DAGCombiner] fix variable names in isAlias(); NFCI

We started with zero-based params and switched to one-based locals...
Also, variables start with a capital and functions do not.

llvm-svn: 300854

7 years agoResurrect LLDB Standalone build on NetBSD
Kamil Rytarowski [Thu, 20 Apr 2017 16:35:36 +0000 (16:35 +0000)]
Resurrect LLDB Standalone build on NetBSD

Include CheckIncludeFile for check_include_file() in CMake.

Detect <sys/event.h> in CMake.
This header is available on NetBSD.

llvm-svn: 300853

7 years agoRevert "[BitVector] Add operator<<= and operator>>=."
Zachary Turner [Thu, 20 Apr 2017 16:35:22 +0000 (16:35 +0000)]
Revert "[BitVector] Add operator<<= and operator>>=."

This is causing test failures on Linux / BSD systems.  Reverting
while I investigate.

llvm-svn: 300852

7 years ago[APInt] Add isSubsetOf method that can check if one APInt is a subset of another...
Craig Topper [Thu, 20 Apr 2017 16:17:13 +0000 (16:17 +0000)]
[APInt] Add isSubsetOf method that can check if one APInt is a subset of another without creating temporary APInts

This question comes up in many places in SimplifyDemandedBits. This makes it easy to ask without allocating additional temporary APInts.

The BitVector class provides a similar functionality through its (IMHO badly named) test(const BitVector&) method. Though its output polarity is reversed.

I've provided one example use case in this patch. I plan to do more as a follow up.

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

llvm-svn: 300851

7 years ago[DAGCombiner] give names to repeated calcs in isAlias(); NFCI
Sanjay Patel [Thu, 20 Apr 2017 16:15:08 +0000 (16:15 +0000)]
[DAGCombiner] give names to repeated calcs in isAlias(); NFCI

llvm-svn: 300850

7 years agoIn SimplifyDemandedUseBits, use computeKnownBits directly to handle Constants
Craig Topper [Thu, 20 Apr 2017 16:14:58 +0000 (16:14 +0000)]
In SimplifyDemandedUseBits, use computeKnownBits directly to handle Constants

Currently we don't explicitly process ConstantDataSequential, ConstantAggregateZero, or ConstantVector, or Undef before applying the Depth limit. Instead they occur after the depth check in the non-instruction path.

For the constant types that we do handle, the code is replicated from computeKnownBits.

This patch fixes the missing constant handling and the reduces the amount of code by just using computeKnownBits directly for any type of Constant.

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

llvm-svn: 300849

7 years ago[BitVector] Add operator<<= and operator>>=.
Zachary Turner [Thu, 20 Apr 2017 15:57:58 +0000 (15:57 +0000)]
[BitVector] Add operator<<= and operator>>=.

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

llvm-svn: 300848

7 years ago[globalisel] Enable tracing the legalizer with --debug-only=legalize-mir
Daniel Sanders [Thu, 20 Apr 2017 15:46:12 +0000 (15:46 +0000)]
[globalisel] Enable tracing the legalizer with --debug-only=legalize-mir

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

Reviewed By: kristof.beyls

Subscribers: dberris, igorb, llvm-commits

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

llvm-svn: 300847

7 years ago[scudo] Minor changes and refactoring
Kostya Kortchinsky [Thu, 20 Apr 2017 15:11:00 +0000 (15:11 +0000)]
[scudo] Minor changes and refactoring

Summary:
This is part of D31947 that is being split into several smaller changes.

This one deals with all the minor changes, more specifically:
- Rename some variables and functions to make their purpose clearer;
- Reorder some code;
- Mark the hot termination incurring checks as `UNLIKELY`; if they happen, the
  program will die anyway;
- Add a `getScudoChunk` method;
- Add an `eraseHeader` method to ScudoChunk that will clear a header with 0s;
- Add a parameter to `allocate` to know if the allocated chunk should be filled
  with zeros. This allows `calloc` to not have to call
  `GetActuallyAllocatedSize`; more changes to get rid of this function on the
  hot paths will follow;
- reallocate was missing a check to verify that the pointer is properly
  aligned on `MinAlignment`;
- The `Stats` in the secondary have to be protected by a mutex as the `Add`
  and `Sub` methods are actually not atomic;
- The software CRC32 function was moved to the header to allow for inlining.

Reviewers: dvyukov, alekseyshl, kcc

Reviewed By: dvyukov

Subscribers: llvm-commits

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

llvm-svn: 300846

7 years ago[Utility] Placate another GCC warning.
Davide Italiano [Thu, 20 Apr 2017 14:45:33 +0000 (14:45 +0000)]
[Utility] Placate another GCC warning.

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

llvm-svn: 300845

7 years agoIntroduce LLVMDIBuilderRef
Amaury Sechet [Thu, 20 Apr 2017 14:22:47 +0000 (14:22 +0000)]
Introduce LLVMDIBuilderRef

Summary:
This patch adds a definition of `LLVMDIBuilderRef` that represents an `llvm::DIBuilder`.

Authored by Harlan Haskins

Reviewers: deadalnix, aprantl, probinson, dblaikie, echristo, whitequark

Reviewed By: deadalnix, whitequark

Subscribers: CodaFi, loladiro

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

llvm-svn: 300843

7 years ago[MVT][SVE] Scalable vector MVTs (3/3)
Amara Emerson [Thu, 20 Apr 2017 13:54:09 +0000 (13:54 +0000)]
[MVT][SVE] Scalable vector MVTs (3/3)

Adds MVT::ElementCount to represent the length of a
vector which may be scalable, then adds helper functions
that work with it.

Patch by Graham Hunter.

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

llvm-svn: 300842

7 years agoDelete unused IncompleteFormat variable, NFCi.
Krasimir Georgiev [Thu, 20 Apr 2017 13:37:27 +0000 (13:37 +0000)]
Delete unused IncompleteFormat variable, NFCi.

llvm-svn: 300841

7 years ago[MVT][SVE] Scalable vector MVTs (2/3)
Amara Emerson [Thu, 20 Apr 2017 13:36:58 +0000 (13:36 +0000)]
[MVT][SVE] Scalable vector MVTs (2/3)
Adds scalable vector machine value types, and updates
the switch statements required for tablegen.

Patch by Graham Hunter.

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

llvm-svn: 300840