6 years agoStop treating -static as overriding -fPIC: they are distinct.
James Y Knight [Fri, 21 Aug 2015 04:14:55 +0000 (04:14 +0000)]
Stop treating -static as overriding -fPIC: they are distinct.

For some reason, clang had been treating a command like:
 clang -static -fPIC foo.c
as if it should be compiled without the PIC relocation model.

This was incorrect: -static should be affecting only the linking
model, and -fPIC only the compilation.

This new behavior also matches GCC.

This is a follow-up from a review comment on r245447.

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

llvm-svn: 245667

6 years agoFix a few things with -Winfinite-recursion. NFC
Richard Trieu [Fri, 21 Aug 2015 03:43:09 +0000 (03:43 +0000)]
Fix a few things with -Winfinite-recursion.  NFC

Now that -Winfinite-recursion no longer uses recursive calls to before path
analysis, several bits of the code can be improved.  The main changes:

1) Early return when finding a path to the exit block without a recursive call
2) Moving the states vector into checkForRecursiveFunctionCall instead of
   passing it in by reference
3) Change checkForRecursiveFunctionCall to return a bool when the warning
   should be emitted.
4) Use the State vector instead of storing it in the Stack vector.

llvm-svn: 245666

6 years agounwind: fix invalid memory access
Saleem Abdulrasool [Fri, 21 Aug 2015 03:21:31 +0000 (03:21 +0000)]
unwind: fix invalid memory access

Fix out-of-bounds array access when setting arm float registers.

Patch by Leandro GraciĆ” Gil!

llvm-svn: 245665

6 years ago[modules] When we see a definition of a function for which we already have a
Richard Smith [Fri, 21 Aug 2015 03:04:33 +0000 (03:04 +0000)]
[modules] When we see a definition of a function for which we already have a
non-visible definition, skip the new definition to avoid ending up with a
function with multiple definitions.

llvm-svn: 245664

6 years ago[compiler-rt] Add libgcc compatibility aliases for __cmp{s,d,f}f2.
Josh Gao [Fri, 21 Aug 2015 02:51:17 +0000 (02:51 +0000)]
[compiler-rt] Add libgcc compatibility aliases for __cmp{s,d,f}f2.

Reviewers: compnerd

Subscribers: asl, llvm-commits

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

llvm-svn: 245663

6 years agoTransformUtils: Introduce module splitter.
Peter Collingbourne [Fri, 21 Aug 2015 02:48:20 +0000 (02:48 +0000)]
TransformUtils: Introduce module splitter.

The module splitter splits a module into linkable partitions. It will
be used to implement parallel LTO code generation.

This initial version of the splitter does not attempt to deal with the
somewhat subtle symbol visibility issues around module splitting. These
will be dealt with in a future change.

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

llvm-svn: 245662

6 years agoSparcAsmParser.cpp: Appease msc x86.
NAKAMURA Takumi [Fri, 21 Aug 2015 01:12:19 +0000 (01:12 +0000)]
SparcAsmParser.cpp: Appease msc x86.

llvm-svn: 245661

6 years agoImplement __aeabi_c{d,f}{cmpeq,cmple,rcmple}.
Josh Gao [Fri, 21 Aug 2015 00:25:37 +0000 (00:25 +0000)]
Implement __aeabi_c{d,f}{cmpeq,cmple,rcmple}.

Summary: Implement more missing ARM EABI runtime functions.

Reviewers: rengolin, compnerd

Subscribers: pirama, srhines, danalbert, aemerson, llvm-commits

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

llvm-svn: 245648

6 years agoAArch64: Fix testcase of r245640
Matthias Braun [Fri, 21 Aug 2015 00:23:19 +0000 (00:23 +0000)]
AArch64: Fix testcase of r245640

llvm-svn: 245647

6 years ago[Static Analyzer] Add checker to catch lightweight generics related type errors in...
Gabor Horvath [Fri, 21 Aug 2015 00:18:28 +0000 (00:18 +0000)]
[Static Analyzer] Add checker to catch lightweight generics related type errors in Objective-C.

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

llvm-svn: 245646

6 years agoThe llvm Triple for an armv6m now comes back as llvm::Triple::thumb.
Jason Molenda [Fri, 21 Aug 2015 00:13:37 +0000 (00:13 +0000)]
The llvm Triple for an armv6m now comes back as llvm::Triple::thumb.
This was breaking disassembly for arm machines that we force to be
thumb mode all the time because we were only checking for llvm::Triple::arm.

armv6m (ARM Cortex-M0)
armv7m (ARM Cortex-M3)
armv7em (ARM Cortex-M4)


llvm-svn: 245645

6 years ago[SLP] Add one more test case for propagating 'nontemporal' attributes.
Michael Zolotukhin [Fri, 21 Aug 2015 00:08:39 +0000 (00:08 +0000)]
[SLP] Add one more test case for propagating 'nontemporal' attributes.

llvm-svn: 245644

6 years agodelete more dead code from this testcase.
Adrian Prantl [Fri, 21 Aug 2015 00:02:04 +0000 (00:02 +0000)]
delete more dead code from this testcase.

llvm-svn: 245643

6 years agoFurther reduce the IR in this testcase based on a further reduction
Adrian Prantl [Thu, 20 Aug 2015 23:59:39 +0000 (23:59 +0000)]
Further reduce the IR in this testcase based on a further reduction
of the original source by David Blaikie (thanks!).

llvm-svn: 245642

6 years agoAArch64: Fix cmp;ccmp ordering
Matthias Braun [Thu, 20 Aug 2015 23:33:34 +0000 (23:33 +0000)]
AArch64: Fix cmp;ccmp ordering

When producing conditional compare sequences for or operations we need
to negate the operands and the finally tested flags. The thing is if we negate
the finally tested flags this equals a logical negation of all previously
emitted expressions. There was a case missing where we have to order OR
expressions so they get emitted first.

This fixes http://llvm.org/PR24459

llvm-svn: 245641

6 years agoAArch64: Do not create CCMP on multiple users.
Matthias Braun [Thu, 20 Aug 2015 23:33:31 +0000 (23:33 +0000)]
AArch64: Do not create CCMP on multiple users.

Create CMP;CCMP sequences from and/or trees does not gain us anything if
the and/or tree is materialized to a GP register anyway. While most of
the code already checked for hasOneUse() there was one important case

llvm-svn: 245640

6 years agoMake UriParser to support [$HOSTNAME] notation.
Oleksiy Vyalov [Thu, 20 Aug 2015 23:09:34 +0000 (23:09 +0000)]
Make UriParser to support [$HOSTNAME] notation.


llvm-svn: 245639

6 years ago[InstSimplify] add nuw %x, C2 must be at least C2
David Majnemer [Thu, 20 Aug 2015 23:01:41 +0000 (23:01 +0000)]
[InstSimplify] add nuw %x, C2 must be at least C2

Use the fact that add nuw always creates a larger bit pattern when
trying to simplify comparisons.

llvm-svn: 245638

6 years ago[Static Analyzer] Made it easier to test new checkers using the test suite.
Gabor Horvath [Thu, 20 Aug 2015 22:59:49 +0000 (22:59 +0000)]
[Static Analyzer] Made it easier to test new checkers using the test suite.

llvm-svn: 245637

6 years ago[WebAssembly] Mark more operators as Expand.
Dan Gohman [Thu, 20 Aug 2015 22:57:13 +0000 (22:57 +0000)]
[WebAssembly] Mark more operators as Expand.

llvm-svn: 245636

6 years ago[InstCombine] Transform A & (L - 1) u< L --> L != 0
Sanjoy Das [Thu, 20 Aug 2015 22:31:55 +0000 (22:31 +0000)]
[InstCombine] Transform A & (L - 1) u< L --> L != 0

This transform is never a pessimization at the IR level (since it
replaces an `icmp` with another), and has potentiall payoffs:

 1. It may make the `icmp` fold away or become loop invariant.
 2. It may make the `A & (L - 1)` computation dead.

This shows up in Java, in range checks generated by array accesses of
the form `a[i & (a.length - 1)]`.

Reviewers: reames, majnemer

Subscribers: llvm-commits

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

llvm-svn: 245635

6 years agoRun clang-format on DynamicLoaderWindowsDYLD.
Stephane Sezer [Thu, 20 Aug 2015 22:30:20 +0000 (22:30 +0000)]
Run clang-format on DynamicLoaderWindowsDYLD.

This uses the .clang-format at the root of the LLDB repo and is just a
mechanical change that precedes more work in this file.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 245634

6 years ago[SLP] Propagate 'nontemporal' attribute into vectorized instructions.
Michael Zolotukhin [Thu, 20 Aug 2015 22:28:15 +0000 (22:28 +0000)]
[SLP] Propagate 'nontemporal' attribute into vectorized instructions.

llvm-svn: 245633

6 years ago[LoopVectorize] Propagate 'nontemporal' attribute into vectorized instructions.
Michael Zolotukhin [Thu, 20 Aug 2015 22:27:38 +0000 (22:27 +0000)]
[LoopVectorize] Propagate 'nontemporal' attribute into vectorized instructions.

llvm-svn: 245632

6 years agoChange TestBSDArchives to expectedFailureWindows.
Zachary Turner [Thu, 20 Aug 2015 22:25:45 +0000 (22:25 +0000)]
Change TestBSDArchives to expectedFailureWindows.

llvm-svn: 245631

6 years ago[Windows] XFAIL tests that require calling a function in target.
Zachary Turner [Thu, 20 Aug 2015 22:09:35 +0000 (22:09 +0000)]
[Windows] XFAIL tests that require calling a function in target.

This has known issues on Windows.  Fixing this is tracked by

llvm-svn: 245630

6 years agoXFAIL breakpoint tests on Windows
Zachary Turner [Thu, 20 Aug 2015 22:09:08 +0000 (22:09 +0000)]
XFAIL breakpoint tests on Windows

llvm.org/pr24528 tracks fixing this test.

llvm-svn: 245629

6 years agoXFAIL TestBSDArchives.py on Windows
Zachary Turner [Thu, 20 Aug 2015 22:08:57 +0000 (22:08 +0000)]
XFAIL TestBSDArchives.py on Windows

llvm.org/pr24527 tracks this bug.  Makefile.rules does not know
how to build static libraries on Windows.

llvm-svn: 245628

6 years agoXFAIL TestAnonymous.test_expr_null_with_dwarf on Windows.
Zachary Turner [Thu, 20 Aug 2015 22:08:48 +0000 (22:08 +0000)]
XFAIL TestAnonymous.test_expr_null_with_dwarf on Windows.

This bug is tracked in llvm.org/pr21550, and also reproduces on
FreeBSD apparently.

llvm-svn: 245627

6 years ago[ProcessWindows] Fix rare crash on shutdown.
Zachary Turner [Thu, 20 Aug 2015 22:08:38 +0000 (22:08 +0000)]
[ProcessWindows] Fix rare crash on shutdown.

There might be an underlying race condition here that should be
figured out, but this at least prevents the crash for the time
being and doesn't appear to have any adverse effects.

llvm-svn: 245626

6 years agoUnderstand absolute base addresses in ProcessGDBRemote::GetLoadedModuleList.
Stephane Sezer [Thu, 20 Aug 2015 22:07:48 +0000 (22:07 +0000)]
Understand absolute base addresses in ProcessGDBRemote::GetLoadedModuleList.

This is useful when dealing with Windows remote that use only the
qXfer:libraries command which returns absolute base addresses, as
opposed to qXfer:libraries-svr4 which returns relative offsets for
module bases.

Reviewers: clayborg, zturner, ADodds

Subscribers: lldb-commits

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

llvm-svn: 245625

6 years ago[CMake] Turns out CMake was passing the space as part of the argument instead of...
Chris Bieneman [Thu, 20 Aug 2015 22:06:46 +0000 (22:06 +0000)]
[CMake] Turns out CMake was passing the space as part of the argument instead of separating two arguments.

llvm-svn: 245624

6 years agoRename Instruction::dropUnknownMetadata() to dropUnknownNonDebugMetadata()
Adrian Prantl [Thu, 20 Aug 2015 22:00:30 +0000 (22:00 +0000)]
Rename Instruction::dropUnknownMetadata() to dropUnknownNonDebugMetadata()
and make it always preserve debug locations, since all callers wanted this
behavior anyway.

This is addressing a post-commit review feedback for r245589.

NFC (inside the LLVM tree).

llvm-svn: 245622

6 years ago[analyzer] Fix for PR24112 (scan-build doesn't work with --use-analyzer="path to...
Anton Yartsev [Thu, 20 Aug 2015 21:52:39 +0000 (21:52 +0000)]
[analyzer] Fix for PR24112 (scan-build doesn't work with --use-analyzer="path to clang++.exe").

Don't derive the path_to_clang++ from the path_to_clang if the path_to_clang is really the path_to_clang++.

llvm-svn: 245621

6 years ago Revert the 64bit part of r245084; long double values were not changed by
Yaron Keren [Thu, 20 Aug 2015 21:51:46 +0000 (21:51 +0000)]
 Revert the 64bit part of r245084; long double values were not changed by
 it as they are already set correctly by X86_64TargetInfo and X86TargetInfo.

llvm-svn: 245620

6 years agoRevert r245344.
Evgeniy Stepanov [Thu, 20 Aug 2015 21:47:16 +0000 (21:47 +0000)]
Revert r245344.

That change is causing strange test failures on Fedora 22 (PR24503),
and it does not have any effect with Gold linker anyway (PR15823,

llvm-svn: 245619

6 years agoRevert the 32bit part of r245084; mingw values were correct before it.
Yaron Keren [Thu, 20 Aug 2015 21:36:14 +0000 (21:36 +0000)]
Revert the 32bit part of r245084; mingw values were correct before it.

llvm-svn: 245618

6 years agoDo not intersect with AssumedContext in calculateMinMaxAccess
Tobias Grosser [Thu, 20 Aug 2015 21:29:26 +0000 (21:29 +0000)]
Do not intersect with AssumedContext in calculateMinMaxAccess

Originally, we intersected the iteration space with the AssumedContext before
computing the minimal/maximal memory offset in our run-time alias checks. With
this patch we drop this intersection as the AssumedContext can - for larger or
more complex scops - become very complicated (contain many disjuncts). When
intersecting an object with many disjuncts with other objects, the number of
disjuncts in these other objects also increases quickly. As a result, the
compile time is unnecessarily increased. This patch now drops the intersection
with the assumed context to ensure we do not pay unnecessary compile time

With this patch we see -3.17% reduction in compile time for 3mm with default
flags and -17.87% when compiling 3mm with -DPOLYBENCH_USE_C99_PROTO flag. We
did not observe any regressions in LNT.

Contributed-by: Pratik Bhatu <cs12b1010@iith.ac.in>
Reviewers: grosser

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

llvm-svn: 245617

6 years agoDo not crash when static analysis encounters a FunctionDecl that has a delayed templa...
Aaron Ballman [Thu, 20 Aug 2015 21:27:35 +0000 (21:27 +0000)]
Do not crash when static analysis encounters a FunctionDecl that has a delayed template parse of its body.

llvm-svn: 245616

6 years ago[asan] Fix build issue from r245596
Adhemerval Zanella [Thu, 20 Aug 2015 21:06:26 +0000 (21:06 +0000)]
[asan] Fix build issue from r245596

This patch fixes the build issue for:

sanitizer_platform.h:88:4: error: #error "invalid SANITIZER_AARCH64_VMA size"

llvm-svn: 245614

6 years ago[X86] Look for scalar through one bitcast when lowering to VBROADCAST.
Ahmed Bougacha [Thu, 20 Aug 2015 21:02:39 +0000 (21:02 +0000)]
[X86] Look for scalar through one bitcast when lowering to VBROADCAST.

Fixes PR23464: one way to use the broadcast intrinsics is:


We don't currently fold this, but now that we use native IR for
the intrinsics (r245605), we can look through one bitcast to find
the broadcast scalar.

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

llvm-svn: 245613

6 years ago[X86] Add some broadcast-from-memory tests.
Ahmed Bougacha [Thu, 20 Aug 2015 20:59:41 +0000 (20:59 +0000)]
[X86] Add some broadcast-from-memory tests.

llvm-svn: 245612

6 years ago[NVPTX] truncating 64-bit to 32-bit is free
Jingyue Wu [Thu, 20 Aug 2015 20:59:02 +0000 (20:59 +0000)]
[NVPTX] truncating 64-bit to 32-bit is free

Add an LSR test that exercises isTruncateFree. Without this change, LSR creates
another indvar representing the truncated value.

Reviewers: jholewinski, eliben

Subscribers: jholewinski, llvm-commits

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

llvm-svn: 245611

6 years agoInline fake snprintf to avoid linkage issues on Windows.
Chaoren Lin [Thu, 20 Aug 2015 20:53:15 +0000 (20:53 +0000)]
Inline fake snprintf to avoid linkage issues on Windows.

dllexport doesn't work if linking against a static library with its own
copy of snprintf.

Reviewers: zturner

Subscribers: zturner, lldb-commits

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

llvm-svn: 245610

6 years agoPR24483: Delete some dead/incorrect code that triggered assertions.
Richard Smith [Thu, 20 Aug 2015 20:45:25 +0000 (20:45 +0000)]
PR24483: Delete some dead/incorrect code that triggered assertions.

llvm-svn: 245609

6 years agoFix some format strings in ProcessGDBRemote.cpp.
Stephane Sezer [Thu, 20 Aug 2015 20:43:29 +0000 (20:43 +0000)]
Fix some format strings in ProcessGDBRemote.cpp.

Summary: Size specifier should come after `%` not before.

Reviewers: clayborg, ADodds

Subscribers: lldb-commits

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

llvm-svn: 245608

6 years agoFix test on Windows to accept both gcc and gcc.exe.
Yaron Keren [Thu, 20 Aug 2015 20:37:58 +0000 (20:37 +0000)]
Fix test on Windows to accept both gcc and gcc.exe.

llvm-svn: 245607

6 years ago[X86] Replace avx2 broadcast intrinsics with native IR.
Ahmed Bougacha [Thu, 20 Aug 2015 20:36:19 +0000 (20:36 +0000)]
[X86] Replace avx2 broadcast intrinsics with native IR.

Since r245605, the clang headers don't use these anymore.
r245165 updated some of the tests already; update the others, add
an autoupgrade, remove the intrinsics, and cleanup the definitions.

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

llvm-svn: 245606

6 years ago[Headers][X86] Use __builtin_shufflevector in AVX2 broadcasts.
Ahmed Bougacha [Thu, 20 Aug 2015 20:27:21 +0000 (20:27 +0000)]
[Headers][X86] Use __builtin_shufflevector in AVX2 broadcasts.

This lets us optimize them better. We agreed to remove the intrinsics,
instead of combining them later, as, at -O0, we generate the expected
instructions. Plus, it's a nice cleanup.

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

llvm-svn: 245605

6 years ago[CMake] Simplifying logic for USES_TERMINAL on bootstrap targets.
Chris Bieneman [Thu, 20 Aug 2015 20:12:20 +0000 (20:12 +0000)]
[CMake] Simplifying logic for USES_TERMINAL on bootstrap targets.

In CMake variables that haven't been set are evaluated to empty strings, so we don't need to set the variables to empty strings.

llvm-svn: 245604

6 years ago[CMake] Exclude 'bootstrap' target from 'all' where possible.
Chris Bieneman [Thu, 20 Aug 2015 20:12:18 +0000 (20:12 +0000)]
[CMake] Exclude 'bootstrap' target from 'all' where possible.

EXCLUDE_FROM_ALL in ExternalProject is only available on CMake 3.1 and later.

llvm-svn: 245603

6 years agoUpdate z_Linux_asm.s to use platform macros
Jonathan Peyton [Thu, 20 Aug 2015 19:46:14 +0000 (19:46 +0000)]
Update z_Linux_asm.s to use platform macros

z_Linux_asm.s can use the KMP_OS_* / KMP_MIC macros instead of the predefined
compiler macro checks.  The macro logic to determine KMP_MIC is moved from
kmp_os.h to kmp_platform.h.

llvm-svn: 245602

6 years agoRemove completed items from TODO.TXT
Eric Fiselier [Thu, 20 Aug 2015 19:22:35 +0000 (19:22 +0000)]
Remove completed items from TODO.TXT

llvm-svn: 245601

6 years agoChange the test to use the new python script instead of the more verbose RUN line.
Aaron Ballman [Thu, 20 Aug 2015 19:21:07 +0000 (19:21 +0000)]
Change the test to use the new python script instead of the more verbose RUN line.

llvm-svn: 245600

6 years agoDo really not unroll the vector loop in combination with register tiling
Tobias Grosser [Thu, 20 Aug 2015 19:08:16 +0000 (19:08 +0000)]
Do really not unroll the vector loop in combination with register tiling

The previous commit lacked a test case for register tiling + pre-vectorization
and we obviously got it immediately wrong.

llvm-svn: 245599

6 years agoAdd option to control reduction detection
Tobias Grosser [Thu, 20 Aug 2015 19:08:11 +0000 (19:08 +0000)]
Add option to control reduction detection

llvm-svn: 245598

6 years agoFix formatting
Tobias Grosser [Thu, 20 Aug 2015 19:08:05 +0000 (19:08 +0000)]
Fix formatting

llvm-svn: 245597

6 years ago[asan] Enable ASan for AArch64/42-bit VMA
Adhemerval Zanella [Thu, 20 Aug 2015 18:49:40 +0000 (18:49 +0000)]
[asan] Enable ASan for AArch64/42-bit VMA

This patch adds support for asan on aarch64-linux with 42-bit VMA
(current default config for 64K pagesize kernels).  The support is
enabled by defining the SANITIZER_AARCH64_VMA to 42 at build time
for both clang/llvm and compiler-rt.  The default VMA is 39 bits.

For 42-bit VMA aarch64 uses SANITIZIER_CAN_USER_ALLOCATOR64.

llvm-svn: 245596

6 years ago[Sparc] Add '-EL' when invoking gcc to link little-endian binaries.
Douglas Katzman [Thu, 20 Aug 2015 18:32:26 +0000 (18:32 +0000)]
[Sparc] Add '-EL' when invoking gcc to link little-endian binaries.

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

llvm-svn: 245595

6 years ago[asan] Add ASAN support for AArch64 42-bit VMA
Adhemerval Zanella [Thu, 20 Aug 2015 18:30:40 +0000 (18:30 +0000)]
[asan] Add ASAN support for AArch64 42-bit VMA

This patch adds support for asan on aarch64-linux with 42-bit VMA
(current default config for 64K pagesize kernels).  The support is
enabled by defining the SANITIZER_AARCH64_VMA to 42 at build time
for both clang/llvm and compiler-rt.  The default VMA is 39 bits.

llvm-svn: 245594

6 years agoSimplify the SCoP creation and bookkeeping
Johannes Doerfert [Thu, 20 Aug 2015 18:30:08 +0000 (18:30 +0000)]
Simplify the SCoP creation and bookkeeping

  To avoid multiple exits and the resulting complicated conditions when
  creating a SCoP we now use the single hasFeasibleRuntimeContext()
  check to decide if a SCoP should be dismissed right after
  construction. If building runtime checks failed the assumed context is
  made infeasible, hence the optimized version will never be executed
  and the SCoP can be dismissed.

llvm-svn: 245593

6 years agoRevert r245496 "[CUDA] Add appropriate host/device attribute to builtins."
Artem Belevich [Thu, 20 Aug 2015 18:28:56 +0000 (18:28 +0000)]
Revert r245496 "[CUDA] Add appropriate host/device attribute to builtins."

It's breaking internal test.

llvm-svn: 245592

6 years ago[ValueTracking] computeOverflowForSignedAdd and isKnownNonNegative
Jingyue Wu [Thu, 20 Aug 2015 18:27:04 +0000 (18:27 +0000)]
[ValueTracking] computeOverflowForSignedAdd and isKnownNonNegative

Refactor, NFC

Extracts computeOverflowForSignedAdd and isKnownNonNegative from NaryReassociate to ValueTracking in case
others need it.

Reviewers: reames

Subscribers: majnemer, llvm-commits

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

llvm-svn: 245591

6 years ago[LVI] Avoid iterator invalidation in LazyValueInfoCache::threadEdge
Bruno Cardoso Lopes [Thu, 20 Aug 2015 18:24:54 +0000 (18:24 +0000)]
[LVI] Avoid iterator invalidation in LazyValueInfoCache::threadEdge

Do that by copying out the elements to another SmallPtrSet.
Follow up from r245309.

llvm-svn: 245590

6 years agoFix a bug that caused SimplifyCFG to drop DebugLocs.
Adrian Prantl [Thu, 20 Aug 2015 18:24:02 +0000 (18:24 +0000)]
Fix a bug that caused SimplifyCFG to drop DebugLocs.

Instruction::dropUnknownMetadata(KnownSet) is supposed to preserve all
metadata in KnownSet, but the condition for DebugLocs was inverted.

Most users of dropUnknownMetadata() actually worked around this by not
adding LLVMContext::MD_dbg to their list of KnowIDs.
This is now made explicit.

llvm-svn: 245589

6 years agoFix a debug location handling bug in GVN.
Adrian Prantl [Thu, 20 Aug 2015 18:23:56 +0000 (18:23 +0000)]
Fix a debug location handling bug in GVN.
Caught by the famous "DebugLoc describes the currect SubProgram" assertion.

When GVN is removing a nonlocal load it updates the debug location of the
SSA value it replaced the load with with the one of the load. In the
testcase this actually overwrites a valid debug location with an empty one.

In reality GVN has to make an arbitrary choice between two equally valid
debug locations. This patch changes to behavior to only update the
location if the value doesn't already have a debug location.

llvm-svn: 245588

6 years ago[clang-tidy] Mention check_clang_tidy.py instead of check_clang_tidy.sh in the docs.
Alexander Kornienko [Thu, 20 Aug 2015 18:16:13 +0000 (18:16 +0000)]
[clang-tidy] Mention check_clang_tidy.py instead of check_clang_tidy.sh in the docs.

llvm-svn: 245587

6 years ago[clang-tidy] Use check_clang_tidy.py instead of check_clang_tidy.sh by default.
Alexander Kornienko [Thu, 20 Aug 2015 18:11:13 +0000 (18:11 +0000)]
[clang-tidy] Use check_clang_tidy.py instead of check_clang_tidy.sh by default.

llvm-svn: 245586

6 years agoCheck feasibility for the runtime check context wrt. the domain.
Johannes Doerfert [Thu, 20 Aug 2015 18:06:30 +0000 (18:06 +0000)]
Check feasibility for the runtime check context wrt. the domain.

  If nothing is executed we can bail out early. Otherwise we can use the
  constraints that ensure at least one statement is executed for

llvm-svn: 245585

6 years agoLink ScopArrayInfo objects
Johannes Doerfert [Thu, 20 Aug 2015 18:04:22 +0000 (18:04 +0000)]
Link ScopArrayInfo objects

  We will record if a SAI is the base of another SAI or derived from it.
  This will allow to reason about indirect base pointers later on and
  allows a clearer picture of indirection also in the SCoP dump.

llvm-svn: 245584

6 years ago[clang-tidy] Use a python script instead of a shell script to run clang-tidy tests.
Alexander Kornienko [Thu, 20 Aug 2015 17:58:07 +0000 (17:58 +0000)]
[clang-tidy] Use a python script instead of a shell script to run clang-tidy tests.

Add check_clang_tidy.py script that is functionally identical to the
check_clang_tidy.py, but should also be functional on windows.

I've verified that the script works on linux. Would be nice if folks using
Windows could test the patch before I break windows bots ;)

Reviewers: chapuni, aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 245583

6 years ago[CMake] Fixing r245581 based on feedback from Filcab.
Chris Bieneman [Thu, 20 Aug 2015 17:46:58 +0000 (17:46 +0000)]
[CMake] Fixing r245581 based on feedback from Filcab.

llvm-svn: 245582

6 years ago[CMake] [OS X] Don't require command line tools installations for running compiler...
Chris Bieneman [Thu, 20 Aug 2015 17:35:56 +0000 (17:35 +0000)]
[CMake] [OS X] Don't require command line tools installations for running compiler-rt tests.

If you're on an Apple platform and /usr/include doesn't exist, we should set a sysroot flag when calling clang.

llvm-svn: 245581

6 years ago[CMake] Fix building unit tests on Darwin
Chris Bieneman [Thu, 20 Aug 2015 17:32:06 +0000 (17:32 +0000)]
[CMake] Fix building unit tests on Darwin

There are a number of issues with unit tests on Darwin. These patches address the following:
* Unit tests should be passed -arch (-m32/-m64 isn't sufficient)
* Unit tests should be passed ${DARWIN_osx_CFLAGS} because they're being built for OS X
* Test architectures should be filtered based on base system capabilities (i.e. don't try running x86_64h tests on pre-haswell hardware).

Reviewers: bogner, filcab, kubabrecka

Subscribers: llvm-commits

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

llvm-svn: 245580

6 years ago[LVer] Fix FIXME: hide addPHINodes, NFC
Adam Nemet [Thu, 20 Aug 2015 17:22:29 +0000 (17:22 +0000)]
[LVer] Fix FIXME: hide addPHINodes, NFC

Since Ashutosh made findDefsUsedOutsideOfLoop public, we can clean this

Now clients that don't compute DefsUsedOutsideOfLoop can just call
versionLoop() and computing DefsUsedOutsideOfLoop will happen
implicitly.  With that there is no reason to expose addPHINodes anymore.

Ashutosh, you can now drop the calls to findDefsUsedOutsideOfLoop and
addPHINodes in LVerLICM and things should just work.

llvm-svn: 245579

6 years ago[ARM] Don't try and custom lower a vNi64 SETCC.
James Molloy [Thu, 20 Aug 2015 16:33:44 +0000 (16:33 +0000)]
[ARM] Don't try and custom lower a vNi64 SETCC.

It won't go well. We've already marked 64-bit SETCCs as non-Custom, but it's just possible that a SETCC has a legal result type but an illegal operand type. If this happens, bail out before we create unselectable nodes.

Fixes PR24292. I tried to create a testcase but in 99% of cases we can't trigger this - not surprising that this bug has been latent since 2009.

llvm-svn: 245577

6 years agoFix symbol value computation when part of the expression is weak.
Rafael Espindola [Thu, 20 Aug 2015 16:18:30 +0000 (16:18 +0000)]
Fix symbol value computation when part of the expression is weak.

This matches the behaviour of the gnu assembler and is part of
fixing pr24486.

llvm-svn: 245576

6 years ago[Sparc]: correct the 'set' synthetic instruction
Douglas Katzman [Thu, 20 Aug 2015 16:16:16 +0000 (16:16 +0000)]
[Sparc]: correct the 'set' synthetic instruction

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

llvm-svn: 245575

6 years agoAdd a new clang-tidy check (misc-move-constructor-init) that diagnoses move construct...
Aaron Ballman [Thu, 20 Aug 2015 15:52:52 +0000 (15:52 +0000)]
Add a new clang-tidy check (misc-move-constructor-init) that diagnoses move constructor initializations that call copy constructors instead of move constructors.

llvm-svn: 245571

6 years agoOptimize bitwise even/odd test (-x&1 -> x&1) to not use negation.
Balaram Makam [Thu, 20 Aug 2015 15:35:00 +0000 (15:35 +0000)]
Optimize bitwise even/odd test (-x&1 -> x&1) to not use negation.

Summary: We know that -x & 1 is equivalent to x & 1, avoid using negation for testing if a negative integer is even or odd.

Reviewers: majnemer

Subscribers: junbuml, mssimpso, gberry, mcrosier, llvm-commits

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

llvm-svn: 245569

6 years agoTweak clang-tidy-diff.py to pass JSON argument correctly to clang-tidy on win32 arg...
NAKAMURA Takumi [Thu, 20 Aug 2015 15:04:46 +0000 (15:04 +0000)]
Tweak clang-tidy-diff.py to pass JSON argument correctly to clang-tidy on win32 arg parser.

  - Single quotation is not recognized.
  - Use """ to pass a double quotation.

It also reverts r211831.

llvm-svn: 245567

6 years agoTweak clang-tools-extra/test/clang-tidy/file-filter.cpp to pass on win32.
NAKAMURA Takumi [Thu, 20 Aug 2015 15:04:39 +0000 (15:04 +0000)]
Tweak clang-tools-extra/test/clang-tidy/file-filter.cpp to pass on win32.

FIXME: "-I %S/Inputs/file-filter/system/.." must be redundant.
On Win32, file-filter/system\system-header1.h precedes file-filter\header*.h due to code order between '/' and '\\'.

We should remove such a tweak to introduce the *right* path canonicalization.



Win32, tweaked:

It had been disabled since r220837.

llvm-svn: 245566

6 years agoclang-tools-extra/test/lit.cfg: Prune an obsolete feature, python27. Now we requires...
NAKAMURA Takumi [Thu, 20 Aug 2015 15:04:32 +0000 (15:04 +0000)]
clang-tools-extra/test/lit.cfg: Prune an obsolete feature, python27. Now we requires python>=2.7.

clang-tools-extra/test/clang-tidy/clang-tidy-diff.cpp was the only user.

llvm-svn: 245565

6 years agoAdd experimental support for trivial register tiling
Tobias Grosser [Thu, 20 Aug 2015 13:45:05 +0000 (13:45 +0000)]
Add experimental support for trivial register tiling

Register tiling in Polly is for now just an additional level of tiling which
is fully unrolled. It is disabled by default. To make this useful for more than
experiments, we still need a cost function as well as possibly further
optimizations that teach LLVM to actually put some of the values we got into
scalar registers.

llvm-svn: 245564

6 years agoAdd support for two-level tiling
Tobias Grosser [Thu, 20 Aug 2015 13:45:02 +0000 (13:45 +0000)]
Add support for two-level tiling

By default we only use one level of tiling for loops, but in general tiling
for multiple levels is trivial for us. Hence, we add a set of options that
allow people to play with a second level of tiling. If this is profitable for
some cases we can work on heuristics that allow us to identify these cases
and use two-level tiling for them.

llvm-svn: 245563

6 years agoSilence a "not all control paths return a value" warning; NFC.
Aaron Ballman [Thu, 20 Aug 2015 13:31:16 +0000 (13:31 +0000)]
Silence a "not all control paths return a value" warning; NFC.

llvm-svn: 245562

6 years ago[clang-tidy] Fix bug in modernize-loop-convert check.
Alexander Kornienko [Thu, 20 Aug 2015 13:18:23 +0000 (13:18 +0000)]
[clang-tidy] Fix bug in modernize-loop-convert check.


Patch by Angel Garcia!

llvm-svn: 245561

6 years agoFix crash with two typos in the arguments of a function
Olivier Goffart [Thu, 20 Aug 2015 13:11:14 +0000 (13:11 +0000)]
Fix crash with two typos in the arguments of a function

The problem is that the arguments are of TheCall are reset later
to the ones in Args, making TypoExpr put back. Some TypoExpr that have
already  been diagnosed and will assert later in Sema::getTypoExprState

llvm-svn: 245560

6 years agoFactor out check for tileable band node.
Tobias Grosser [Thu, 20 Aug 2015 12:32:45 +0000 (12:32 +0000)]
Factor out check for tileable band node.

llvm-svn: 245559

6 years agoIntroduce tileBand function to simplify code
Tobias Grosser [Thu, 20 Aug 2015 12:22:37 +0000 (12:22 +0000)]
Introduce tileBand function to simplify code

llvm-svn: 245558

6 years agoAdd some forgotten isl memory annotations
Tobias Grosser [Thu, 20 Aug 2015 12:16:23 +0000 (12:16 +0000)]
Add some forgotten isl memory annotations

llvm-svn: 245557

6 years ago[OPENMP 4.1] Allow to use 'uval' and 'ref' modifiers for reference types only.
Alexey Bataev [Thu, 20 Aug 2015 12:15:57 +0000 (12:15 +0000)]
[OPENMP 4.1] Allow to use 'uval' and 'ref' modifiers for reference types only.
Standard allows to use 'uval' and 'ref' modifiers in 'linear' clause for variables with reference types only. Added check for it and modified test.

llvm-svn: 245556

6 years agoIncrease timeout in TestCallWithTimeout to reduce flakyness
Pavel Labath [Thu, 20 Aug 2015 12:12:09 +0000 (12:12 +0000)]
Increase timeout in TestCallWithTimeout to reduce flakyness

The test was flaky on the android buildbot, because the 10ms test completed before we got a
chance to interrupt it. I increase the duration to 50ms to hopefully get more consistent results.

llvm-svn: 245555

6 years ago[mips][microMIPS] Add microMIPS32r6 and microMIPS64r6 tests for existing 16-bit ADDIU...
Zoran Jovanovic [Thu, 20 Aug 2015 11:51:49 +0000 (11:51 +0000)]
[mips][microMIPS] Add microMIPS32r6 and microMIPS64r6 tests for existing 16-bit ADDIUR1SP, ADDIUR2, ADDIUS5 and ADDIUSP instructions
Differential Revision: http://reviews.llvm.org/D10955

llvm-svn: 245554

6 years ago[X86] Fix FBLD and FBSTP
Marina Yatsina [Thu, 20 Aug 2015 11:51:24 +0000 (11:51 +0000)]
[X86] Fix FBLD and FBSTP

FBLD and FBSTP should receive TBYTE because it is defined as
FBLD m80

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

llvm-svn: 245553

6 years agoSkip TestCreateDuringInstructionStep on android aarch64
Pavel Labath [Thu, 20 Aug 2015 11:37:19 +0000 (11:37 +0000)]
Skip TestCreateDuringInstructionStep on android aarch64

we are unable to step through _M_start_thread due to atomic instruction sequences.

llvm-svn: 245552

6 years ago[X86] Fix bug in COMISD and COMISS definition in td files
Marina Yatsina [Thu, 20 Aug 2015 11:21:36 +0000 (11:21 +0000)]
[X86] Fix bug in COMISD and COMISS definition in td files

COMISD should receive QWORD because it is defined as
 (V)COMISD xmm1, xmm2/m64

COMISS should receive DWORD because it is defined as
 (V)COMISS xmm1, xmm2/m32

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

llvm-svn: 245551

6 years ago[OPENMP 4.1] Initial support for modifiers in 'linear' clause.
Alexey Bataev [Thu, 20 Aug 2015 10:54:39 +0000 (10:54 +0000)]
[OPENMP 4.1] Initial support for modifiers in 'linear' clause.

OpenMP 4.1 adds 3 optional modifiers to 'linear' clause.
Format of 'linear' clause has changed to:
linear(linear-list[ : linear-step])
where linear-list is one of the following
where modifier is one of the following:
 ref (C++)
 val (C/C++)
 uval (C++)
Patch adds parsing and sema analysis for these modifiers.

llvm-svn: 245550

6 years agoMake helper functions static. NFC.
Benjamin Kramer [Thu, 20 Aug 2015 09:57:22 +0000 (09:57 +0000)]
Make helper functions static. NFC.

llvm-svn: 245549

6 years ago[clang-tidy] Fold the meat of the UseNullPtrCheck into an anonymous namespace.
Benjamin Kramer [Thu, 20 Aug 2015 09:47:06 +0000 (09:47 +0000)]
[clang-tidy] Fold the meat of the UseNullPtrCheck into an anonymous namespace.

While convenient, RecursiveASTVisitor generates a ridiculous amount of dead
template code. Making it not visible from the outside lets the compiler
eliminate some of it, shrinking clang-tidy by ~140k.

llvm-svn: 245548