platform/upstream/llvm.git
8 years agodd new OpenMP 4.5 schedule clause modifiers (monotonic/non-monotonic) feature
Jonathan Peyton [Thu, 25 Feb 2016 17:55:50 +0000 (17:55 +0000)]
dd new OpenMP 4.5 schedule clause modifiers (monotonic/non-monotonic) feature

The monotonic/non-monotonic flags are sent to the runtime via the sched_type by
setting the 30th (non-monotonic) or 29th (monotonic) bit in the sched_type.
Macros are added to probe if monotonic or non-monotonic is specified
(SCHEDULE_HAS_[NON]MONOTONIC & SCHEDULE_HAS_NO_MODIFIERS)
and also to to get the base sched_type (SCHEDULE_WITHOUT_MODIFIERS)

Currently, nothing is done with the modifiers.

Also, this patch adds some comments on the use of the enumerations in at least
 one place where it is subtle.

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

llvm-svn: 261906

8 years agoAdapt to LLVM head, again
Hongbin Zheng [Thu, 25 Feb 2016 17:54:42 +0000 (17:54 +0000)]
Adapt to LLVM head, again

llvm-svn: 261905

8 years agoIntroduce RegionInfoAnalysis, which compute Region Tree in the new PassManager. NFC
Hongbin Zheng [Thu, 25 Feb 2016 17:54:25 +0000 (17:54 +0000)]
Introduce RegionInfoAnalysis, which compute Region Tree in the new PassManager. NFC

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

llvm-svn: 261904

8 years agoIntroduce DominanceFrontierAnalysis to the new PassManager to compute DominanceFronti...
Hongbin Zheng [Thu, 25 Feb 2016 17:54:15 +0000 (17:54 +0000)]
Introduce DominanceFrontierAnalysis to the new PassManager to compute DominanceFrontier. NFC

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

llvm-svn: 261903

8 years agoIntroduce analysis pass to compute PostDominators in the new pass manager. NFC
Hongbin Zheng [Thu, 25 Feb 2016 17:54:07 +0000 (17:54 +0000)]
Introduce analysis pass to compute PostDominators in the new pass manager. NFC

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

llvm-svn: 261902

8 years agoFix PythonDataObjectsTests for python 2
Pavel Labath [Thu, 25 Feb 2016 17:41:59 +0000 (17:41 +0000)]
Fix PythonDataObjectsTests for python 2

Summary:
the python2 branch seems erroneous as it expected the object to be both a "String" and "Bytes".
Fix the expectation.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 261901

8 years ago[powerpc] reactivate ignore_lib4.cc on powerpc64le
Bill Seurer [Thu, 25 Feb 2016 17:41:41 +0000 (17:41 +0000)]
[powerpc] reactivate ignore_lib4.cc on powerpc64le

The test case compiler-rt/test/tsan/ignore_lib4.cc fails on powerpc64
big endian but not little endian.

llvm-svn: 261900

8 years agoAdd update_test.py script.
Michael Kruse [Thu, 25 Feb 2016 17:12:12 +0000 (17:12 +0000)]
Add update_test.py script.

The script updates a lit test case that uses FileCheck using the actual
output of the 'RUN:'-lines program. Useful when updating test cases due
expected output changes and diff'ing expected and actual output.

llvm-svn: 261899

8 years ago[sanitizer] Fix third parameter in COMMON_INTERCEPTOR_WRITE_RANGE in recv and recvfro...
Maxim Ostapenko [Thu, 25 Feb 2016 17:07:38 +0000 (17:07 +0000)]
[sanitizer] Fix third parameter in COMMON_INTERCEPTOR_WRITE_RANGE in recv and recvfrom interceptors.

Pass res instead of len as third parameter to COMMON_INTERCEPTOR_WRITE_RANGE,
because otherwise we can write to unrelated memory (in MSan) or get wrong report (in ASan).

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

llvm-svn: 261898

8 years agoRevert r261814, "check-clang-tools: Introduce the feature target-headers", correspond...
NAKAMURA Takumi [Thu, 25 Feb 2016 16:59:59 +0000 (16:59 +0000)]
Revert r261814, "check-clang-tools: Introduce the feature target-headers", corresponding to r261893.

llvm-svn: 261897

8 years agoUpdate the status of a N4089 and a couple issues
Marshall Clow [Thu, 25 Feb 2016 16:55:58 +0000 (16:55 +0000)]
Update the status of a N4089 and a couple issues

llvm-svn: 261896

8 years agoARM: disallow pc as a base register in Thumb2 memory ops.
Tim Northover [Thu, 25 Feb 2016 16:54:52 +0000 (16:54 +0000)]
ARM: disallow pc as a base register in Thumb2 memory ops.

These should all be deferring to the "OP (literal)" variant according to the
ARM ARM.

llvm-svn: 261895

8 years agoAnother chunk of N4089
Marshall Clow [Thu, 25 Feb 2016 16:50:51 +0000 (16:50 +0000)]
Another chunk of N4089

llvm-svn: 261894

8 years ago[clang-tidy] Adding headers needed in modernize-deprecated-headers tests
Alexander Kornienko [Thu, 25 Feb 2016 16:46:54 +0000 (16:46 +0000)]
[clang-tidy] Adding headers needed in modernize-deprecated-headers tests

llvm-svn: 261893

8 years agoRevert "Adapt to LLVM head. NFC"
Hongbin Zheng [Thu, 25 Feb 2016 16:46:17 +0000 (16:46 +0000)]
Revert "Adapt to LLVM head. NFC"

This reverts commit 4d3753b9646a69c00d234ccd6e91dc3d0ea5d643.

llvm-svn: 261892

8 years agoRevert "Introduce analysis pass to compute PostDominators in the new pass manager...
Hongbin Zheng [Thu, 25 Feb 2016 16:45:53 +0000 (16:45 +0000)]
Revert "Introduce analysis pass to compute PostDominators in the new pass manager. NFC"

This reverts commit a3e5cc6a51ab5ad88d1760c63284294a4e34c018.

llvm-svn: 261891

8 years agoRevert "Introduce DominanceFrontierAnalysis to the new PassManager to compute Dominan...
Hongbin Zheng [Thu, 25 Feb 2016 16:45:46 +0000 (16:45 +0000)]
Revert "Introduce DominanceFrontierAnalysis to the new PassManager to compute DominanceFrontier. NFC"

This reverts commit 109c38b2226a87b0be73fa7a0a8c1a81df20aeb2.

llvm-svn: 261890

8 years agoRevert "Introduce RegionInfoAnalysis, which compute Region Tree in the new PassManage...
Hongbin Zheng [Thu, 25 Feb 2016 16:45:37 +0000 (16:45 +0000)]
Revert "Introduce RegionInfoAnalysis, which compute Region Tree in the new PassManager. NFC"

This reverts commit 8228b4d374edeb4cc0c5fddf6e1ab876918ee126.

llvm-svn: 261889

8 years agorangify; NFCI
Sanjay Patel [Thu, 25 Feb 2016 16:44:27 +0000 (16:44 +0000)]
rangify; NFCI

llvm-svn: 261888

8 years agoAdd FieldNames to __NSConstantString_tag
Ben Langmuir [Thu, 25 Feb 2016 16:36:26 +0000 (16:36 +0000)]
Add FieldNames to __NSConstantString_tag

Since consumers of the AST may expect fields to be named.

Patch by Brad King!

llvm-svn: 261887

8 years agoAdapt to LLVM head. NFC
Hongbin Zheng [Thu, 25 Feb 2016 16:36:09 +0000 (16:36 +0000)]
Adapt to LLVM head. NFC

llvm-svn: 261886

8 years ago[AArch64] Clean up callee-save CFI emission. NFC.
Geoff Berry [Thu, 25 Feb 2016 16:36:08 +0000 (16:36 +0000)]
[AArch64] Clean up callee-save CFI emission. NFC.

Summary:
Avoid special case for FP, LR CFI emission and just allow general
AArch64FrameLowering::emitCalleeSavedFrameMoves() to handle them.  Also,
stop recalculating the stack offsets in emitCalleeSavedFrameMoves()
since we can just reuse the previously calculated offset stored in the
MachineFrameInfo.

Depends on D17000

Reviewers: t.p.northover, rengolin, mcrosier, jmolloy

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

llvm-svn: 261885

8 years agoIntroduce RegionInfoAnalysis, which compute Region Tree in the new PassManager. NFC
Hongbin Zheng [Thu, 25 Feb 2016 16:33:26 +0000 (16:33 +0000)]
Introduce RegionInfoAnalysis, which compute Region Tree in the new PassManager. NFC

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

llvm-svn: 261884

8 years agoIntroduce DominanceFrontierAnalysis to the new PassManager to compute DominanceFronti...
Hongbin Zheng [Thu, 25 Feb 2016 16:33:15 +0000 (16:33 +0000)]
Introduce DominanceFrontierAnalysis to the new PassManager to compute DominanceFrontier. NFC

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

llvm-svn: 261883

8 years agoIntroduce analysis pass to compute PostDominators in the new pass manager. NFC
Hongbin Zheng [Thu, 25 Feb 2016 16:33:06 +0000 (16:33 +0000)]
Introduce analysis pass to compute PostDominators in the new pass manager. NFC

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

llvm-svn: 261882

8 years agoAdd support for weak symbols in LTO.
Rafael Espindola [Thu, 25 Feb 2016 16:25:41 +0000 (16:25 +0000)]
Add support for weak symbols in LTO.

llvm-svn: 261881

8 years agoRemove unnecessary prefix.
Rafael Espindola [Thu, 25 Feb 2016 16:20:00 +0000 (16:20 +0000)]
Remove unnecessary prefix.

llvm-svn: 261880

8 years ago[ELF][MIPS] Add STO_MIPS_PLT flag to the symbols require pointer equality
Simon Atanasyan [Thu, 25 Feb 2016 16:19:15 +0000 (16:19 +0000)]
[ELF][MIPS] Add STO_MIPS_PLT flag to the symbols require pointer equality

On MIPS we need to mark symbol which has a PLT entry and requires
pointer equality by STO_MIPS_PLT flag. That is necessary to help
dynamic linker distinguish such symbols and MIPS lazy-binding stubs.

https://sourceware.org/ml/binutils/2008-07/txt00000.txt

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

llvm-svn: 261879

8 years ago[AMDGPU] Disassembler: Support for all VOP1 instructions.
Nikolay Haustov [Thu, 25 Feb 2016 16:09:14 +0000 (16:09 +0000)]
[AMDGPU] Disassembler: Support for all VOP1 instructions.

Support all instructions with VOP1 encoding with 32 or 64-bit operands for VI subtarget:

VGPR_32 and VReg_64 operand register classes
VS_32 and VS_64 operand register classes with inline and literal constants
Tests for VOP1 instructions.

Patch by: skolton

Reviewers: arsenm, tstellarAMD

Review: http://reviews.llvm.org/D17194
llvm-svn: 261878

8 years agodon't repeat names in documentation comments; NFC
Sanjay Patel [Thu, 25 Feb 2016 15:55:28 +0000 (15:55 +0000)]
don't repeat names in documentation comments; NFC

llvm-svn: 261877

8 years agoUse inline local variable declaration. NFC.
Michael Kruse [Thu, 25 Feb 2016 15:52:43 +0000 (15:52 +0000)]
Use inline local variable declaration. NFC.

llvm-svn: 261876

8 years agoNo, really - test the constructor
Marshall Clow [Thu, 25 Feb 2016 15:27:13 +0000 (15:27 +0000)]
No, really - test the constructor

llvm-svn: 261875

8 years agoAdd test to ensure that the converting constructor in N4089 is present and working
Marshall Clow [Thu, 25 Feb 2016 15:25:29 +0000 (15:25 +0000)]
Add test to ensure that the converting constructor in N4089 is present and working

llvm-svn: 261874

8 years agowww: Fix typo
Tobias Grosser [Thu, 25 Feb 2016 15:21:02 +0000 (15:21 +0000)]
www: Fix typo

Reported-by: Hongbin Zheng
llvm-svn: 261873

8 years agoReplace a compiler-specific approach to determining the presence of a getDecl() membe...
Aaron Ballman [Thu, 25 Feb 2016 15:14:09 +0000 (15:14 +0000)]
Replace a compiler-specific approach to determining the presence of a getDecl() member function with one that does not require compiler-specific workarounds; NFC.

llvm-svn: 261872

8 years agoGC empty directory.
Joerg Sonnenberger [Thu, 25 Feb 2016 15:00:14 +0000 (15:00 +0000)]
GC empty directory.

llvm-svn: 261871

8 years ago[asan] Disable recvfrom test failing on the bots.
Maxim Ostapenko [Thu, 25 Feb 2016 14:58:07 +0000 (14:58 +0000)]
[asan] Disable recvfrom test failing on the bots.

llvm-svn: 261870

8 years ago[clang-tidy] update links to Google Code Style in docs
Haojian Wu [Thu, 25 Feb 2016 14:31:10 +0000 (14:31 +0000)]
[clang-tidy] update links to Google Code Style in docs

Summary: Because of the recent Google Code shutdown links to the Google Code Style up there are no longer relevant.

Reviewers: alexfh, hokein

Subscribers: cfe-commits

Patch by Kirill Bobyrev!

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

llvm-svn: 261868

8 years agoAdd Polly GSoC projects
Tobias Grosser [Thu, 25 Feb 2016 14:17:11 +0000 (14:17 +0000)]
Add Polly GSoC projects

These projects are just some first thoughts. Feel free to updated / add ideas
for further projects.

llvm-svn: 261867

8 years agoSupport calls with known ModRef function behaviour
Johannes Doerfert [Thu, 25 Feb 2016 14:08:48 +0000 (14:08 +0000)]
Support calls with known ModRef function behaviour

  Check the ModRefBehaviour of functions in order to decide whether or
  not a call instruction might be acceptable.

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

llvm-svn: 261866

8 years agoFix DomTree preservation for generated subregions.
Michael Kruse [Thu, 25 Feb 2016 14:08:48 +0000 (14:08 +0000)]
Fix DomTree preservation for generated subregions.

The generated dedicated subregion exit block was assumed to have the same
dominance relation as the original exit block. This is incorrect if the exit
block receives other edges than only from the subregion, which results in that
e.g. the subregion's entry block does not dominate the exit block.

llvm-svn: 261865

8 years agoSimplify code [NFC]
Johannes Doerfert [Thu, 25 Feb 2016 14:07:49 +0000 (14:07 +0000)]
Simplify code [NFC]

llvm-svn: 261864

8 years agoTry to build alias checks even when non-affine accesses are allowed
Johannes Doerfert [Thu, 25 Feb 2016 14:06:11 +0000 (14:06 +0000)]
Try to build alias checks even when non-affine accesses are allowed

  From now on we bail only if a non-trivial alias group contains a non-affine
  access, not when we discover aliasing and non-affine accesses are allowed.

llvm-svn: 261863

8 years agoAVX512F: Add GATHER/SCATTER assembler Intel syntax tests for knl/skx/avx . Change...
Igor Breger [Thu, 25 Feb 2016 13:30:17 +0000 (13:30 +0000)]
AVX512F: Add GATHER/SCATTER assembler Intel syntax tests for knl/skx/avx . Change memory operand parser handling.

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

llvm-svn: 261862

8 years agoImprove readability and performance of ClangExpressionParser::FindFunctionInModule
Aidan Dodds [Thu, 25 Feb 2016 13:07:04 +0000 (13:07 +0000)]
Improve readability and performance of ClangExpressionParser::FindFunctionInModule

Committed on behalf of: Luke Drummond

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

llvm-svn: 261861

8 years ago[mips][microMIPS] Implement DINSU, DINSM, DINS instructions
Hrvoje Varga [Thu, 25 Feb 2016 12:53:29 +0000 (12:53 +0000)]
[mips][microMIPS] Implement DINSU, DINSM, DINS instructions
Differential Revision: http://reviews.llvm.org/D16181

llvm-svn: 261860

8 years agoAdd support for handling absolute symbols in ELF
Tamas Berghammer [Thu, 25 Feb 2016 12:23:43 +0000 (12:23 +0000)]
Add support for handling absolute symbols in ELF

Most address represented in lldb as section plus offset and handling of
absolute addresses is problematic in several location because of lack
of necessary information (e.g. Target) or because of performance issues.

This CL change the way ObjectFileELF handle the absolute symbols with
creating a pseudo section for each symbol. With this change all existing
code designed to work with addresses in the form of section plus offset
will work with absolute symbols as well.

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

llvm-svn: 261859

8 years agoHandle the case when a variable is only valid in part of the enclosing scope
Tamas Berghammer [Thu, 25 Feb 2016 12:23:37 +0000 (12:23 +0000)]
Handle the case when a variable is only valid in part of the enclosing scope

DWARF stores this information in the DW_AT_start_scope attribute. This
CL add support for this attribute and also changes the functions
displaying frame variables to only display the variables currently in
scope.

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

llvm-svn: 261858

8 years ago[AMDGPU] Assembler: Simplify handling of optional operands
Nikolay Haustov [Thu, 25 Feb 2016 10:58:54 +0000 (10:58 +0000)]
[AMDGPU] Assembler: Simplify handling of optional operands

Resubmit with index problem fixed. Verified with valgrind.

Prepare to support DPP encodings.

For DPP encodings, we want row_mask/bank_mask/bound_ctrl to be optional operands.
However this means that when parsing instruction which has no mnemonic prefix,
we cannot add both default values for VOP3 and for DPP optional operands
to OperandVector - neither instructions would match. So add default values
for optional operands to MCInst during conversion instead.

Mark more operands as IsOptional = 1 in .td files.
Do not add default values for optional operands to OperandVector in AMDGPUAsmParser.
Add default values for optional operands during conversion using new helper addOptionalImmOperand.
Change to cvtVOP3_2_mod to check instruction flag instead of presence of modifiers. In the future, cvtVOP3* functions can be combined into one.
Separate cvtFlat and cvtFlatAtomic.
Fix CNDMASK_B32 definition to have no modifiers.

Review: http://reviews.llvm.org/D17445
llvm-svn: 261856

8 years ago[asan] Disable recvfrom testcase on Android due to buildbot failure.
Maxim Ostapenko [Thu, 25 Feb 2016 10:55:52 +0000 (10:55 +0000)]
[asan] Disable recvfrom testcase on Android due to buildbot failure.

Trying to fix following error on Android:

FAIL: AddressSanitizer-arm-android :: TestCases/Linux/recvfrom.cc (47 of 350)
...
Command Output (stderr):
--
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/TestCases/Linux/recvfrom.cc:22:22: error: variable has incomplete type 'struct sockaddr_in'
  struct sockaddr_in serveraddr; // server's addr
                     ^
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/TestCases/Linux/recvfrom.cc:22:10: note: forward declaration of 'sockaddr_in'
  struct sockaddr_in serveraddr; // server's addr
         ^
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/TestCases/Linux/recvfrom.cc:29:38: error: use of undeclared identifier 'INADDR_ANY'
  serveraddr.sin_addr.s_addr = htonl(INADDR_ANY);
                                     ^
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/TestCases/Linux/recvfrom.cc:30:25: error: use of undeclared identifier 'htons'
  serveraddr.sin_port = htons(kPortNum);
                        ^
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/TestCases/Linux/recvfrom.cc:45:22: error: variable has incomplete type 'struct sockaddr_in'
  struct sockaddr_in serveraddr; // server's addr
                     ^
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/TestCases/Linux/recvfrom.cc:45:10: note: forward declaration of 'sockaddr_in'
  struct sockaddr_in serveraddr; // server's addr
         ^
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/TestCases/Linux/recvfrom.cc:69:25: error: use of undeclared identifier 'htons'
  serveraddr.sin_port = htons(kPortNum);

llvm-svn: 261855

8 years ago[PM] Add the IR unit type to the pass manager's logging and make all of
Chandler Carruth [Thu, 25 Feb 2016 10:27:39 +0000 (10:27 +0000)]
[PM] Add the IR unit type to the pass manager's logging and make all of
the testing more more explicit.

This will currently fail on platforms without support for getTypeName.
While an assert failure seems too harsh, I'm hoping we're OK with the
regression test failure, and I'd like to find out about what platforms
actually exist in this state if there are any so we can get
implementations in place for them.

But if we just can't fix all the host compilers to have a reasonably
portable variant of getTypeName and are worried about xfailing this test
on those platforms, I can add the horrible regular expression magic to
make the tests support "unknown" here as well.

llvm-svn: 261853

8 years ago[sanitizer] Disable recv and recvfrom interceptors on Windows.
Maxim Ostapenko [Thu, 25 Feb 2016 09:36:20 +0000 (09:36 +0000)]
[sanitizer] Disable recv and recvfrom interceptors on Windows.

Trying to fix sanitizer-windows buildbot by disabling new interceptors on Windows.

llvm-svn: 261844

8 years ago[X86][SSE3] Added combine support for MOVDDUP/MOVSHDUP/MOVSLDUP target shuffles
Simon Pilgrim [Thu, 25 Feb 2016 09:12:12 +0000 (09:12 +0000)]
[X86][SSE3] Added combine support for MOVDDUP/MOVSHDUP/MOVSLDUP target shuffles

Now that PerformShuffleCombine can handle unary shuffles.

llvm-svn: 261843

8 years agoRevert r260064, "Disable llvm/test/tools/llvm-profdata/value-prof.proftext on win32...
NAKAMURA Takumi [Thu, 25 Feb 2016 08:50:26 +0000 (08:50 +0000)]
Revert r260064, "Disable llvm/test/tools/llvm-profdata/value-prof.proftext on win32 for now. Investigating."

It seems unreproducible any more for me.

llvm-svn: 261842

8 years ago[sanitizer] Move recvmsg and recv interceptors to sanitizer_common.
Maxim Ostapenko [Thu, 25 Feb 2016 08:44:25 +0000 (08:44 +0000)]
[sanitizer] Move recvmsg and recv interceptors to sanitizer_common.

This patch moves recv and recvfrom interceptors from MSan and TSan to
sanitizer_common to enable them in ASan.

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

llvm-svn: 261841

8 years ago[ELF] - Referencing __start or __stop should keep the section from GC.
George Rimar [Thu, 25 Feb 2016 08:40:26 +0000 (08:40 +0000)]
[ELF] - Referencing __start or __stop should keep the section from GC.

This fixes the https://llvm.org/bugs/show_bug.cgi?id=22906 bug.

In GNU Binutils, a reference to start or stop is sufficient to
prevent the section from being garbage collected.
Patch implements the same behavior for lld.

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

llvm-svn: 261840

8 years agoRevert r261742, "[AMDGPU] Assembler: Simplify handling of optional operands"
NAKAMURA Takumi [Thu, 25 Feb 2016 08:35:27 +0000 (08:35 +0000)]
Revert r261742, "[AMDGPU] Assembler: Simplify handling of optional operands"

It brought undefined behavior.

llvm-svn: 261839

8 years ago[ELF2] - Basic implementation of -r/--relocatable
George Rimar [Thu, 25 Feb 2016 08:23:37 +0000 (08:23 +0000)]
[ELF2] - Basic implementation of -r/--relocatable

-r, -relocatable - Generate relocatable output

Currently does not have support for files containing
relocation sections with entries that refer to local
symbols (like rel[a].eh_frame which refer to sections
and not to symbols)

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

llvm-svn: 261838

8 years ago[Compiler-rt][MSan]Fix shmat testcase: Pass SHMLBA-alligned address to shmat
Mohit K. Bhakkad [Thu, 25 Feb 2016 08:07:44 +0000 (08:07 +0000)]
[Compiler-rt][MSan]Fix shmat testcase: Pass SHMLBA-alligned address to shmat

Reviewers: samsonov

Subscribers: jaydeep, sagar, llvm-commits

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

llvm-svn: 261837

8 years agoPM: Implement a basic loop pass manager
Justin Bogner [Thu, 25 Feb 2016 07:23:08 +0000 (07:23 +0000)]
PM: Implement a basic loop pass manager

This creates the new-style LoopPassManager and wires it up with dummy
and print passes.

This version doesn't support modifying the loop nest at all. It will
be far easier to discuss and evaluate the approaches to that with this
in place so that the boilerplate is out of the way.

llvm-svn: 261831

8 years ago[Sema] Remove assert in TreeTransform<Derived>::TransformObjCObjectType.
Akira Hatanaka [Thu, 25 Feb 2016 07:08:33 +0000 (07:08 +0000)]
[Sema] Remove assert in TreeTransform<Derived>::TransformObjCObjectType.

The assert isn't correct since TypeLoc::ObjCObjectTypeLoc doesn't
indicate whether the type is a dependent type. The function returns
false for a type like "<SomeProtocol>" which is a synonym for
"id<SomeProtocol>".

rdar://problem/23838912

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

llvm-svn: 261829

8 years agoOptimized loading (zextload) of i1 value from memory.
Elena Demikhovsky [Thu, 25 Feb 2016 07:05:12 +0000 (07:05 +0000)]
Optimized loading (zextload) of i1 value from memory.
This patch is a partial revert of https://llvm.org/svn/llvm-project/llvm/trunk@237793.
Extra "and" causes performance degradation.

We assume that i1 is stored in zero-extended form. And store operation is responsible for zeroing upper bits.

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

llvm-svn: 261828

8 years ago[Support] Don't check for ICC directly and rely on the __GNUC__ check
Chandler Carruth [Thu, 25 Feb 2016 06:13:01 +0000 (06:13 +0000)]
[Support] Don't check for ICC directly and rely on the __GNUC__ check
(which they emulate). This way we don't use that path when compiled with
ICC on Windows where it mimics MSVC's behavior and supports __FUNCSIG__.

Thanks for David Majnemer again for spotting this better pattern!

llvm-svn: 261827

8 years ago[OPENMP 4.5] Codegen for member decls in 'lastprivate' clause.
Alexey Bataev [Thu, 25 Feb 2016 05:25:57 +0000 (05:25 +0000)]
[OPENMP 4.5] Codegen for member decls in 'lastprivate' clause.

OpenMP 4.5 allows to privatize non-static member decls in non-static
member functions. Patch captures such decls by reference in general (for
bitfields, by value) and then operates with this capture. For bitfields,
at the end of codegen for lastprivates original bitfield is updated with the value of captured copy.

llvm-svn: 261824

8 years agoTwek fix for PR24473 (r261506) - Preserve the template arguments as written
Faisal Vali [Thu, 25 Feb 2016 05:09:30 +0000 (05:09 +0000)]
Twek fix for PR24473 (r261506) - Preserve the template arguments as written
(within the DeclRefExpr Node) when creating AST nodes that reference specializations of static data member templates.  While we pass the template args through for all non-instance members, they should only be relevant (i.e. non-null) for variable template ids (assertion added for that assumption)

Also preserve the FoundDecl that refers to the canonical Decl (the  primary VarTemplateDecl for a variable template specialization) that we are referencing in our DeclRefExpr. Not sure why this was not being done for non-variable template-ids.

No functionality change - so no tests added.

Thanks to Richard Smith for drawing my attention to this!

llvm-svn: 261823

8 years ago[ELF][MIPS] Enumerate absolute MIPS relocations in the isRelRelative
Simon Atanasyan [Thu, 25 Feb 2016 05:03:52 +0000 (05:03 +0000)]
[ELF][MIPS] Enumerate absolute MIPS relocations in the isRelRelative

This commit does two related thing. At first, it enumerates supported
absolute MIPS relocations in the `MipsTargetInfo<ELFT>::isRelRelative`
method. In that case the code is shorter and the case switch does not
tend to grow. At second, it prevents R_MIPS_COPY and PLT creation for
relative relocations. For almost all relative MIPS relocations like
R_MIPS_PC19_S2, R_MIPS_PCHI16 etc it does not have a sence. The only
exception is R_MIPS_PC32. GNU linker creates a copy relocation or PLT
entry for it. But I could not find any real test case uses R_MIPS_PC32
with DSO defined symbol as a target. So for now I prefer to skip this
case to simplify the LLD code.

llvm-svn: 261822

8 years agobuiltins: adjust the clobbers list for android __clear_cache
Saleem Abdulrasool [Thu, 25 Feb 2016 04:04:37 +0000 (04:04 +0000)]
builtins: adjust the clobbers list for android __clear_cache

Adjust the clobbers list.  This use to work with older versions of gcc, but now
will error on newer versions (tested against 5.3) (as well as clang).

Patch by Tee Hao Wei!

llvm-svn: 261821

8 years ago[OPENMP 4.5] Support fielddecls in 'shared' clause.
Alexey Bataev [Thu, 25 Feb 2016 03:59:29 +0000 (03:59 +0000)]
[OPENMP 4.5] Support fielddecls in 'shared' clause.

OpenMP 4.5 allows to use non-static data members of current class in
non-static member functions in different kind of clauses. Patch adds
support for data members in 'shared' clause.

llvm-svn: 261820

8 years ago[Support] Add a fancy helper function to get a static name for a type.
Chandler Carruth [Thu, 25 Feb 2016 03:58:21 +0000 (03:58 +0000)]
[Support] Add a fancy helper function to get a static name for a type.

This extracts the type name from __PRETTY_FUNCTION__ for compilers that
support it (I've opted Clang, GCC, and ICC into this as I've tested that
they work) and from __FUNCSIG__ which is very similar on MSVC. The
routine falls back gracefully on a stub "UNKNOWN_TYPE" string with
compilers or formats it doesn't understand.

This should be enough for a lot of common cases in LLVM where the real
goal is just to log or print a type name as a debugging aid, and save
a ton of boilerplate in the process. Notably, I'm planning to use this
to remove all the getName() boiler plate from the new pass manager.

The design and implementation is based on a bunch of advice and
discussion with Richard Smith and experimenting with most versions of
Clang and GCC. David Majnemer also provided excellent advice on how best
to do this with MSVC. Richard also checked that ICC does something
reasonable and I'll watch the build bots for other compilers. It'd be
great if someone could contribute logic for xlC and/or other toolchains.

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

llvm-svn: 261819

8 years ago[OpenCL] Add Sema checks for types
Xiuli Pan [Thu, 25 Feb 2016 03:34:20 +0000 (03:34 +0000)]
[OpenCL] Add Sema checks for types

Summary:
Add Sema checks for opencl type: image, pipe....
This patch is partitioned from http://reviews.llvm.org/D16047

Reviewers: Anastasia, yaxunl

Subscribers: pekka.jaaskelainen, cfe-commits

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

llvm-svn: 261818

8 years agoFix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in source...
Eugene Zelenko [Thu, 25 Feb 2016 02:08:17 +0000 (02:08 +0000)]
Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in source/Commands/CommandObjectType.cpp; other minor fixes.

llvm-svn: 261817

8 years agocheck-clang-tools: Introduce the feature "target-headers".
NAKAMURA Takumi [Thu, 25 Feb 2016 01:12:57 +0000 (01:12 +0000)]
check-clang-tools: Introduce the feature "target-headers".

For now, it just detects that host is non-Windows and target is msvc.

FIXME: It should be probable for cross compilations. Detect whether target's headers would be available.
llvm-svn: 261814

8 years agoIR: Make the X / undef -> undef fold match the comment
Justin Bogner [Thu, 25 Feb 2016 01:02:18 +0000 (01:02 +0000)]
IR: Make the X / undef -> undef fold match the comment

The constant folding for sdiv and udiv has a big discrepancy between the
comments and the code, which looks like a typo. Currently, we're folding
X / undef pretty inconsistently:

  0 / undef -> undef
  C / undef -> 0
  undef / undef -> 0

Whereas the comments state we do X / undef -> undef. The logic that
returns zero is actually commented as doing undef / X -> 0, despite that
the LHS isn't undef in many of the cases that hit it.

llvm-svn: 261813

8 years agoFix "target modules add -s <filename>" to work if the file doesn't exist locally...
Greg Clayton [Thu, 25 Feb 2016 00:56:47 +0000 (00:56 +0000)]
Fix "target modules add -s <filename>" to work if the file doesn't exist locally on the current machine.

<rdar://problem/24807382>

llvm-svn: 261812

8 years ago[clang-tidy] Another attempt to fix MSVC build
Alexander Kornienko [Thu, 25 Feb 2016 00:39:11 +0000 (00:39 +0000)]
[clang-tidy] Another attempt to fix MSVC build

llvm-svn: 261811

8 years agoXFail TestInlines.py on Windows with clang.
Adrian McCarthy [Thu, 25 Feb 2016 00:24:07 +0000 (00:24 +0000)]
XFail TestInlines.py on Windows with clang.

Test expects the breakpoint to resolve to three locations, but clang on windows yields only 2.

llvm.org/pr26710

llvm-svn: 261810

8 years ago[CodeGenPrepare] Remove load-based heuristic
Junmo Park [Thu, 25 Feb 2016 00:23:27 +0000 (00:23 +0000)]
[CodeGenPrepare] Remove load-based heuristic

Summary:
Both the hardware and LLVM have changed since 2012.
Now, load-based heuristic don't show big differences any more on OoO cores.

There is no notable regressons and improvements on spec2000/2006. (Cortex-A57, Core i5).

Reviewers: spatel, zansari

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

llvm-svn: 261809

8 years agoGet register context for the 32-bit process in a WoW64 process minidump
Adrian McCarthy [Thu, 25 Feb 2016 00:23:27 +0000 (00:23 +0000)]
Get register context for the 32-bit process in a WoW64 process minidump

32-bit processes on 64-bit Windows run in a layer called WoW64 (Windows-on-Windows64). If you capture a mini dump of such a process from a 32-bit debugger, you end up with a register context for the 64-bit WoW64 process rather than the 32-bit one you probably care about.

This detects WoW64 by looking to see if there's a module named wow64.dll loaded. For such processes, it then looks in the 64-bit Thread Environment Block (TEB) to locate a copy of the 32-bit CONTEXT record that the plugin needs for the register context.

Added some rudimentary tests.  I'd like to improve these later once we figure out how to get the exception information from these mini dumps.

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

llvm-svn: 261808

8 years agoMove test/CodeGen/Generic/pr26652.ll to test/CodeGen/X86/pr26652.ll and test it only...
Cong Hou [Thu, 25 Feb 2016 00:12:18 +0000 (00:12 +0000)]
Move test/CodeGen/Generic/pr26652.ll to test/CodeGen/X86/pr26652.ll and test it only on X86.

llvm-svn: 261807

8 years agoTrying to fix MSVC build
Alexander Kornienko [Wed, 24 Feb 2016 23:48:24 +0000 (23:48 +0000)]
Trying to fix MSVC build

llvm-svn: 261806

8 years agofix typo
Sanjay Patel [Wed, 24 Feb 2016 23:44:19 +0000 (23:44 +0000)]
fix typo

llvm-svn: 261805

8 years agoDetecte vector reduction operations just before instruction selection.
Cong Hou [Wed, 24 Feb 2016 23:40:36 +0000 (23:40 +0000)]
Detecte vector reduction operations just before instruction selection.

(This is the second attemp to commit this patch, after fixing pr26652 & pr26653).

This patch detects vector reductions before instruction selection. Vector
reductions are vectorized reduction operations, and for such operations we have
freedom to reorganize the elements of the result as long as the reduction of them
stay unchanged. This will enable some reduction pattern recognition during
instruction combine such as SAD/dot-product on X86. A flag is added to
SDNodeFlags to mark those vector reduction nodes to be checked during instruction
combine.

To detect those vector reductions, we search def-use chains starting from the
given instruction, and check if all uses fall into two categories:

1. Reduction with another vector.
2. Reduction on all elements.

in which 2 is detected by recognizing the pattern that the loop vectorizer
generates to reduce all elements in the vector outside of the loop, which
includes several ShuffleVector and one ExtractElement instructions.

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

llvm-svn: 261804

8 years agoFix assertion failure on MaybeODRUseExprs.
Manman Ren [Wed, 24 Feb 2016 23:05:43 +0000 (23:05 +0000)]
Fix assertion failure on MaybeODRUseExprs.

In VisitNonTypeTemplateParamDecl, before SubstExpr with the default argument,
we should create a ConstantEvaluated ExpressionEvaluationContext. Without this,
it is possible to use a PotentiallyEvaluated ExpressionEvaluationContext; and
MaybeODRUseExprs will not be cleared when popping the context, causing
assertion failure.

This is similar to how we handle the context before SubstExpr with the
default argument, in SubstDefaultTemplateArgument.

Part of PR13986.
rdar://24480205

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

llvm-svn: 261803

8 years agoMake test more portable.
Rafael Espindola [Wed, 24 Feb 2016 22:47:41 +0000 (22:47 +0000)]
Make test more portable.

We just need to show that an error is printed, so no need to check for a
system dependent message.

llvm-svn: 261802

8 years ago[CMake] Fix a really simple, silly bug from r261797
Chris Bieneman [Wed, 24 Feb 2016 22:42:47 +0000 (22:42 +0000)]
[CMake] Fix a really simple, silly bug from r261797

This should fix bots with CMake older than 2.8.12.

llvm-svn: 261801

8 years agoxfail case sensitivity test on Linux.
Zachary Turner [Wed, 24 Feb 2016 22:41:04 +0000 (22:41 +0000)]
xfail case sensitivity test on Linux.

There are two tests in this file.  One which only runs on Windows
and tests that you can set a breakpoint with mismatched case.  And
another that only runs on non-Windows and tests that you cannot set
a breakpoint with mismatched case.  This latter test is failing on
non Windows platforms for some reason.  It could be that the test
is just written incorrectly, as I think the actual functionality
actually works correctly on non-Windows platforms.

llvm-svn: 261800

8 years agoadd tests to show missing bitcasted logic transform
Sanjay Patel [Wed, 24 Feb 2016 22:31:18 +0000 (22:31 +0000)]
add tests to show missing bitcasted logic transform

llvm-svn: 261799

8 years agoMinor cleanup of Sema::CheckEnableIf. NFC.
George Burgess IV [Wed, 24 Feb 2016 22:31:14 +0000 (22:31 +0000)]
Minor cleanup of Sema::CheckEnableIf. NFC.

llvm-svn: 261798

8 years ago[CMake] Default CMAKE_MACOSX_RPATH to On, this is the default with CMP0042
Chris Bieneman [Wed, 24 Feb 2016 22:29:42 +0000 (22:29 +0000)]
[CMake] Default CMAKE_MACOSX_RPATH to On, this is the default with CMP0042

Summary: Building the sanitizer libraries without rpaths causes all sorts of problems when you try to use them. This simple fix should make it all work.

Reviewers: samsonov, zaks.anna

Subscribers: llvm-commits

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

llvm-svn: 261797

8 years agoAdd capability to push/pop DFI in MCStreamer. NFC
Amaury Sechet [Wed, 24 Feb 2016 22:25:18 +0000 (22:25 +0000)]
Add capability to push/pop DFI in MCStreamer. NFC

Summary: This is extracted from D17555

Reviewers: davidxl, reames, sanjoy, MatzeB, pete

Subscribers: llvm-commits

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

llvm-svn: 261796

8 years agoUpdate the website with lots of new info about building / testing.
Zachary Turner [Wed, 24 Feb 2016 22:19:23 +0000 (22:19 +0000)]
Update the website with lots of new info about building / testing.

llvm-svn: 261795

8 years ago[asan] Do not instrument globals in the special "LLVM" sections
Anna Zaks [Wed, 24 Feb 2016 22:12:18 +0000 (22:12 +0000)]
[asan] Do not instrument globals in the special "LLVM" sections

llvm-svn: 261794

8 years agoIntroduce ScopStmt::getRegionNode(). NFC.
Michael Kruse [Wed, 24 Feb 2016 22:08:28 +0000 (22:08 +0000)]
Introduce ScopStmt::getRegionNode(). NFC.

Replace an inline ternary operator pattern.

llvm-svn: 261793

8 years agoIntroduce ScopStmt::getEntryBlock(). NFC.
Michael Kruse [Wed, 24 Feb 2016 22:08:24 +0000 (22:08 +0000)]
Introduce ScopStmt::getEntryBlock(). NFC.

This replaces an ungly inline ternary operator pattern.

llvm-svn: 261792

8 years agoIntroduce Scop::getStmtFor. NFC.
Michael Kruse [Wed, 24 Feb 2016 22:08:19 +0000 (22:08 +0000)]
Introduce Scop::getStmtFor. NFC.

Replace Scop::getStmtForBasicBlock and Scop::getStmtForRegionNode, and
add overloads for llvm::Instruction and llvm::RegionNode.

getStmtFor and overloads become the common interface to get the Stmt
that contains something. Named after LoopInfo::getLoopFor and
RegionInfo::getRegionFor.

llvm-svn: 261791

8 years agoAdd assertions checking def dominates use. NFC.
Michael Kruse [Wed, 24 Feb 2016 22:08:14 +0000 (22:08 +0000)]
Add assertions checking def dominates use. NFC.

This is also be caught by the function verifier, but disconnected from
the place that produced it. Catch it already at creation to be able to
reason more directly about the cause.

llvm-svn: 261790

8 years agoAdd assertion to MemoryAccess::addIncoming. NFC.
Michael Kruse [Wed, 24 Feb 2016 22:08:11 +0000 (22:08 +0000)]
Add assertion to MemoryAccess::addIncoming. NFC.

MemoryAccess::addIncoming exists to remember which values come from that
statement in PHI writes, relevant for subregions that have multiple
exiting edges to an exit block. The exit block can be separated from the
exiting block by regions simplifications. It should not be called for
any read accesses.

llvm-svn: 261789

8 years agoUse inline variable declaration. NFC.
Michael Kruse [Wed, 24 Feb 2016 22:08:08 +0000 (22:08 +0000)]
Use inline variable declaration. NFC.

llvm-svn: 261788

8 years agoReplace std::auto_ptr with std::unique_ptr. NFC.
Michael Kruse [Wed, 24 Feb 2016 22:08:05 +0000 (22:08 +0000)]
Replace std::auto_ptr with std::unique_ptr. NFC.

std::auto_ptr has been deprecated in C++11, which some compilers warn
about.

llvm-svn: 261787

8 years agoTidy test case. NFC.
Michael Kruse [Wed, 24 Feb 2016 22:08:02 +0000 (22:08 +0000)]
Tidy test case. NFC.

The test style guide defines that opt should get its input from stdin.
(instead by file argument to avoid that the file name appears in its
output)

CHECK-FORCED is not recognized by FileCheck; remove it.

llvm-svn: 261786