oota-llvm.git
8 years ago[CodeGen] Rename AtomicRMWExpansionKind to AtomicExpansionKind.
Ahmed Bougacha [Fri, 11 Sep 2015 17:08:17 +0000 (17:08 +0000)]
[CodeGen] Rename AtomicRMWExpansionKind to AtomicExpansionKind.

This lets us generalize its usage to the other atomic instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247428 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PR24785] Appease MSC18 to tweak optimizations.
NAKAMURA Takumi [Fri, 11 Sep 2015 17:08:02 +0000 (17:08 +0000)]
[PR24785] Appease MSC18 to tweak optimizations.

This brings a warning.

  cl : Command line warning D9035: option 'Og-' has been deprecated and will be removed in a future release

We should resolve PR11951 to remove this tweak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247427 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] mention more trophies
Kostya Serebryany [Fri, 11 Sep 2015 16:34:14 +0000 (16:34 +0000)]
[libFuzzer] mention more trophies

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247425 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips] Add missing disassembler tests for MIPS64-MIPS64R5.
Daniel Sanders [Fri, 11 Sep 2015 16:24:11 +0000 (16:24 +0000)]
[mips] Add missing disassembler tests for MIPS64-MIPS64R5.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247422 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips] Add missing MIPS32 - MIPS32R5 disassembler tests.
Daniel Sanders [Fri, 11 Sep 2015 15:28:19 +0000 (15:28 +0000)]
[mips] Add missing MIPS32 - MIPS32R5 disassembler tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247420 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips] Attempt to fix llvm-s390x-linux1
Daniel Sanders [Fri, 11 Sep 2015 14:57:54 +0000 (14:57 +0000)]
[mips] Attempt to fix llvm-s390x-linux1

It doesn't seem to like the '|&' in the test command.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247418 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips] Add missing MIPS-IV disassembler tests.
Daniel Sanders [Fri, 11 Sep 2015 14:54:58 +0000 (14:54 +0000)]
[mips] Add missing MIPS-IV disassembler tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247417 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips] Add missing MIPS-III disassembler tests.
Daniel Sanders [Fri, 11 Sep 2015 14:48:46 +0000 (14:48 +0000)]
[mips] Add missing MIPS-III disassembler tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247416 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTweak 2 x86 gold tests so they can run on non-x86 platforms
Arnaud A. de Grandmaison [Fri, 11 Sep 2015 14:45:34 +0000 (14:45 +0000)]
Tweak 2 x86 gold tests so they can run on non-x86 platforms

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247415 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips] Add missing MIPS-II disassembler tests.
Daniel Sanders [Fri, 11 Sep 2015 14:34:41 +0000 (14:34 +0000)]
[mips] Add missing MIPS-II disassembler tests.

These tests were found by llvm-mc-fuzzer (see http://reviews.llvm.org/D12723)
and were verified by checking the disassembler output is accepted by GAS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247414 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd #include llvm-config.h to Locale.cpp which depends on LLVM_ON_WIN32.
Yaron Keren [Fri, 11 Sep 2015 13:22:47 +0000 (13:22 +0000)]
Add #include llvm-config.h to Locale.cpp which depends on LLVM_ON_WIN32.
Source code was assuming that llvm-config.h would be included somehow but
up to r247253 that added #include "llvm/Support/Compiler.h" to StringRef.h
the config file was not actually included. The inclusion of llvm-config.h
caused a change of behaviour in tools/clang/test/Frontend/source-col-map.c:
previously it would output the original UTF-8 but now it outputs <U+03B1>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247409 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRe-commit r247405: [mips] Add missing MIPS-I disassembler tests.
Daniel Sanders [Fri, 11 Sep 2015 12:59:03 +0000 (12:59 +0000)]
Re-commit r247405: [mips] Add missing MIPS-I disassembler tests.

These tests were found by llvm-mc-fuzzer (see http://reviews.llvm.org/D12723)
and verified by checking the disassembler output is accepted by GAS.

The problematic tests from the previous commit have been moved to
valid-xfail.txt for now.

Also, give invalid instructions some coverage. invalid-xfail.txt contains
instructions that should be invalid but successfully disassemble.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247407 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert r247405: [mips] Add missing MIPS-I disassembler tests.
Daniel Sanders [Fri, 11 Sep 2015 12:42:38 +0000 (12:42 +0000)]
Revert r247405: [mips] Add missing MIPS-I disassembler tests.

A small number of the added tests have operands that change on each round trip.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247406 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips] Add missing MIPS-I disassembler tests.
Daniel Sanders [Fri, 11 Sep 2015 12:24:06 +0000 (12:24 +0000)]
[mips] Add missing MIPS-I disassembler tests.

These tests were found by llvm-mc-fuzzer (see http://reviews.llvm.org/D12723)
and verified by checking the disassembler output is accepted by GAS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247405 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPPCFrameLowering::emitEpilogue(): Avoid manipulating MBBI on iterator end.
NAKAMURA Takumi [Fri, 11 Sep 2015 08:20:56 +0000 (08:20 +0000)]
PPCFrameLowering::emitEpilogue(): Avoid manipulating MBBI on iterator end.

It caused crash in MachineInstr::hasPropertyInBundle() since r247237.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247395 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix llvm/test/tools/gold/X86/bad-alias.ll.
NAKAMURA Takumi [Fri, 11 Sep 2015 08:03:17 +0000 (08:03 +0000)]
Fix llvm/test/tools/gold/X86/bad-alias.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247391 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[dsymutil] Discard useless location attributes.
Frederic Riss [Fri, 11 Sep 2015 04:17:30 +0000 (04:17 +0000)]
[dsymutil] Discard useless location attributes.

When cloning the debug info for a function that hasn't been linked,
strip the DIEs from all location attributes that wouldn't contain any
meaningful information anyway.

This kind of situation can happen when a function got discarded by the
linker, but its debug information is still wanted in the final link
because it was marked as required as some other DIE dependency. The easiest
way to get into that situation is to have using directives. They get
linked unconditionally, but their targets might not always be present.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247386 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[dsymutil] Rename some variables NFC.
Frederic Riss [Fri, 11 Sep 2015 04:17:25 +0000 (04:17 +0000)]
[dsymutil] Rename some variables NFC.

lldb doesn't like having variables named as an existing type. In order to
ease debugging, rename those variables to avoid that conflict.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247385 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix the gold test cases after alias changes
David Blaikie [Fri, 11 Sep 2015 03:28:37 +0000 (03:28 +0000)]
Fix the gold test cases after alias changes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247381 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[opaque pointer type] Add textual IR support for explicit type parameter for global...
David Blaikie [Fri, 11 Sep 2015 03:22:04 +0000 (03:22 +0000)]
[opaque pointer type] Add textual IR support for explicit type parameter for global aliases

update.py:
import fileinput
import sys
import re

alias_match_prefix = r"(.*(?:=|:|^)\s*(?:external |)(?:(?:private|internal|linkonce|linkonce_odr|weak|weak_odr|common|appending|extern_weak|available_externally) )?(?:default |hidden |protected )?(?:dllimport |dllexport )?(?:unnamed_addr |)(?:thread_local(?:\([a-z]*\))? )?alias"
plain = re.compile(alias_match_prefix + r" (.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|addrspacecast|\[\[[a-zA-Z]|\{\{).*$)")
cast  = re.compile(alias_match_prefix + r") ((?:bitcast|inttoptr|addrspacecast)\s*\(.* to (.*?)(| addrspace\(\d+\) *)\*\)\s*(?:;.*)?$)")
gep   = re.compile(alias_match_prefix + r") ((?:getelementptr)\s*(?:inbounds)?\s*\((?P<type>.*), (?P=type)(?:\s*addrspace\(\d+\)\s*)?\* .*\)\s*(?:;.*)?$)")

def conv(line):
  m = re.match(cast, line)
  if m:
    return m.group(1) + " " + m.group(3) + ", " + m.group(2)
  m = re.match(gep, line)
  if m:
    return m.group(1) + " " + m.group(3) + ", " + m.group(2)
  m = re.match(plain, line)
  if m:
    return m.group(1) + ", " + m.group(2) + m.group(3) + "*" + m.group(4) + "\n"
  return line

for line in sys.stdin:
  sys.stdout.write(conv(line))

apply.sh:
for name in "$@"
do
  python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
  rm -f "$name.tmp"
done

The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247378 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[modules] Move ConvertUTF.h to a separate submodule that doesn't require C++.
Richard Smith [Fri, 11 Sep 2015 03:14:00 +0000 (03:14 +0000)]
[modules] Move ConvertUTF.h to a separate submodule that doesn't require C++.
The former setup once resulted in us ignoring the module for C compilations,
but Clang now errors on this if the header is included from C code (which it is).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247377 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFixed a bug that BranchProbability is not defined in BlockFrequency.cpp. NFC.
Cong Hou [Fri, 11 Sep 2015 02:47:30 +0000 (02:47 +0000)]
Fixed a bug that BranchProbability is not defined in BlockFrequency.cpp. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247376 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAsmWriter: Avoid O(N^2) processing of metadata
Duncan P. N. Exon Smith [Fri, 11 Sep 2015 01:34:59 +0000 (01:34 +0000)]
AsmWriter: Avoid O(N^2) processing of metadata

Fix embarrassing bugs I introduced to the `SlotTracker` in or around
r235785.  I had us iterating through every instruction in a function
(and hitting a map in the LLVMContext) for every basic block in the
function.

While there, completely avoid the call to
`SlotTracker::processFunctionMetadata()` from
`SlotTracker::processFunction()` if we've speculatively done this
already in `SlotTracker::processModule()` by checking
`ShouldInitializeAllMetadata` (this wasn't an algorithmic problem, but
it's touching the same line of code).

Fixes PR24699.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247372 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[InstCombineCalls] Use isKnownNonNullAt() to check nullness of passing argume...
Mehdi Amini [Fri, 11 Sep 2015 01:33:48 +0000 (01:33 +0000)]
Revert "[InstCombineCalls] Use isKnownNonNullAt() to check nullness of passing arguments at callsite"

This reverts commit r247356.

Breaks test/Transforms/InstCombine/pr8547.ll with:

Wrong types for attribute: byval inalloca nest noalias nocapture nonnull readnone readonly sret dereferenceable(1) dereferenceable_or_null(1)
  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 nonnull %conv2) #0
LLVM ERROR: Broken function found, compilation aborted!

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247371 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] perform fewer crossover operations compared to plain mutations
Kostya Serebryany [Fri, 11 Sep 2015 00:20:58 +0000 (00:20 +0000)]
[libFuzzer] perform fewer crossover operations compared to plain mutations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247364 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd .exe check to Execute to fix clang-modernize tests broken in r247358
Reid Kleckner [Thu, 10 Sep 2015 23:59:45 +0000 (23:59 +0000)]
Add .exe check to Execute to fix clang-modernize tests broken in r247358

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247361 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[modules] Add another .def file to our list of textual headers.
Richard Smith [Thu, 10 Sep 2015 23:30:27 +0000 (23:30 +0000)]
[modules] Add another .def file to our list of textual headers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247359 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoScanDirForExecutable on Windows fails to find executables with the "exe" extension...
Reid Kleckner [Thu, 10 Sep 2015 23:28:06 +0000 (23:28 +0000)]
ScanDirForExecutable on Windows fails to find executables with the "exe" extension in name

When the driver tries to locate a program by its name, e.g. a linker, it
scans the paths provided by the toolchain using the ScanDirForExecutable
function. If the lookup fails, the driver uses
llvm::sys::findProgramByName. Unlike llvm::sys::findProgramByName,
ScanDirForExecutable is not aware of file extensions. If the program has
the "exe" extension in its name, which is very common on Windows,
ScanDirForExecutable won't find it under the toolchain-provided paths.

This patch changes the Windows version of the "`can_execute`" function
called by ScanDirForExecutable to respect file extensions, similarly to
llvm::sys::findProgramByName.

Patch by Oleg Ranevskyy

Reviewers: rnk

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247358 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPass BranchProbability/BlockMass by value instead of const& as they are small. NFC.
Cong Hou [Thu, 10 Sep 2015 23:10:42 +0000 (23:10 +0000)]
Pass BranchProbability/BlockMass by value instead of const& as they are small. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247357 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombineCalls] Use isKnownNonNullAt() to check nullness of passing arguments...
Chen Li [Thu, 10 Sep 2015 23:04:49 +0000 (23:04 +0000)]
[InstCombineCalls] Use isKnownNonNullAt() to check nullness of passing arguments at callsite

Summary: This patch replaces isKnownNonNull() with isKnownNonNullAt() when checking nullness of passing arguments at callsite. In this way it can handle cases where the argument does not have nonnull attribute but has a dominating null check from the CFG.

Reviewers: reames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247356 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMark another method const. Sorry for missing this one the first time.
Rafael Espindola [Thu, 10 Sep 2015 22:46:38 +0000 (22:46 +0000)]
Mark another method const. Sorry for missing this one the first time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247354 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombineCalls] Use isKnownNonNullAt() to check nullness of gc.relocate return...
Chen Li [Thu, 10 Sep 2015 22:35:41 +0000 (22:35 +0000)]
[InstCombineCalls] Use isKnownNonNullAt() to check nullness of gc.relocate return value

Summary: This patch replaces isKnownNonNull() with isKnownNonNullAt() when checking nullness of gc.relocate return value. In this way it can handle cases where the relocated value does not have nonnull attribute but has a dominating null check from the CFG.

Reviewers: reames

Subscribers: llvm-commits, sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247353 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove gcc warning when comparing an unsigned var for >= 0
Filipe Cabecinhas [Thu, 10 Sep 2015 22:34:39 +0000 (22:34 +0000)]
Remove gcc warning when comparing an unsigned var for >= 0

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247352 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WinEH] Push and pop EBP for 32-bit funclets
Reid Kleckner [Thu, 10 Sep 2015 22:00:02 +0000 (22:00 +0000)]
[WinEH] Push and pop EBP for 32-bit funclets

The Win32 EH runtime caller does not preserve EBP, even though it does
preserve the CSRs (EBX, ESI, EDI) for us. The result was that each
finally funclet call would leave the frame pointer off by 12 bytes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247348 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Simplify debug printing
Matt Arsenault [Thu, 10 Sep 2015 21:51:19 +0000 (21:51 +0000)]
AMDGPU: Simplify debug printing

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247345 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Use StringRef value
Matt Arsenault [Thu, 10 Sep 2015 21:51:15 +0000 (21:51 +0000)]
AMDGPU: Use StringRef value

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247344 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SPARC] Switch to the Machine Scheduler.
James Y Knight [Thu, 10 Sep 2015 21:49:06 +0000 (21:49 +0000)]
[SPARC] Switch to the Machine Scheduler.

The (mostly-deprecated) SelectionDAG-based ILPListDAGScheduler scheduler
was making poor scheduling decisions, causing high register pressure and
extraneous register spills.

Switching to the newer machine scheduler generates better code -- even
without there being a machine model defined for SPARC yet.

(Actually committing the test changes too, this time, unlike r247315)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247343 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMark two methods const.
Rafael Espindola [Thu, 10 Sep 2015 21:48:36 +0000 (21:48 +0000)]
Mark two methods const.

While at it, optimize getOffset a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247342 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix SEH state numbering algorithm to handle cleanupendpads
Reid Kleckner [Thu, 10 Sep 2015 21:46:36 +0000 (21:46 +0000)]
Fix SEH state numbering algorithm to handle cleanupendpads

WinEHPrepare's new coloring algorithm really expects to see
cleanupendpads now, so Clang will start emitting them soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247341 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LV] Relax Small Size Reduction Type Requirement
Matthew Simpson [Thu, 10 Sep 2015 21:12:57 +0000 (21:12 +0000)]
[LV] Relax Small Size Reduction Type Requirement

This patch enables small size reductions in which the source types are smaller
than the reduction type (e.g., computing an i16 sum from the values in an i8
array). The previous behavior was to only allow small size reductions if the
source types and reduction type were the same. The change accounts for the fact
that the existing sign- and zero-extend instructions in these cases should
still be included in the cost model.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247337 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RuntimeDyld] Support non-zero addends for the MachO X86_64 SUBTRACTOR reloc.
Lang Hames [Thu, 10 Sep 2015 21:05:58 +0000 (21:05 +0000)]
[RuntimeDyld] Support non-zero addends for the MachO X86_64 SUBTRACTOR reloc.

This functionality was accidentally left out of r247119.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247336 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RuntimeDyld] Fix a bug in debugging output: all sections should be dumped
Lang Hames [Thu, 10 Sep 2015 20:44:36 +0000 (20:44 +0000)]
[RuntimeDyld] Fix a bug in debugging output: all sections should be dumped
before any relocations have been applied, and again after all relocations have
been applied.

Previously each section was dumped before and after relocations targetting it
were applied, but this only shows the impact of relocations that point to other
symbols in the same section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247335 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd an explicit 'inline' specifier to these static functions. GCC is
Chandler Carruth [Thu, 10 Sep 2015 20:34:57 +0000 (20:34 +0000)]
Add an explicit 'inline' specifier to these static functions. GCC is
warning on them having always_inline attribute for reasons I don't fully
understand -- static functions are just as inlinable as inline
functions in terms of linkage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247334 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoCorrect the return type of CreateCleanupEndPad
Reid Kleckner [Thu, 10 Sep 2015 20:07:25 +0000 (20:07 +0000)]
Correct the return type of CreateCleanupEndPad

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247331 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[SPARC] Switch to the Machine Scheduler."
James Y Knight [Thu, 10 Sep 2015 19:42:03 +0000 (19:42 +0000)]
Revert "[SPARC] Switch to the Machine Scheduler."

This reverts commit r247315.

Accidentally omitted test changes; will resubmit full change shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247328 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[IR] Conservatively mark 'catchpad' as accessing memory
David Majnemer [Thu, 10 Sep 2015 18:50:09 +0000 (18:50 +0000)]
[IR] Conservatively mark 'catchpad' as accessing memory

The exact semantics of 'catchpad' are really in the hands of the
personality routine so we shouldn't assume that they have no side
effects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247322 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] refactor the code to allow building libFuzzer on platforms that don't...
Kostya Serebryany [Thu, 10 Sep 2015 18:48:38 +0000 (18:48 +0000)]
[libFuzzer] refactor the code to allow building libFuzzer on platforms that don't have dfsan and don't support weak functions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247321 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CMake] Add lto subdirectory explicitly.
Chris Bieneman [Thu, 10 Sep 2015 18:22:33 +0000 (18:22 +0000)]
[CMake] Add lto subdirectory explicitly.

This is required because ExternalProject_Add requires all targets specified in the DEPENDS argument must exist before calling ExternalProject_Add.

I have a follow-up patch to clang that enables using the just-built libLTO in bootstrap builds, so we need to be able to add the LTO target as a dependency in clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247316 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SPARC] Switch to the Machine Scheduler.
James Y Knight [Thu, 10 Sep 2015 18:20:45 +0000 (18:20 +0000)]
[SPARC] Switch to the Machine Scheduler.

The (mostly-deprecated) SelectionDAG-based ILPListDAGScheduler scheduler
was making poor scheduling decisions, causing high register pressure and
extraneous register spills.

Switching to the newer machine scheduler generates better code -- even
without there being a machine model defined for SPARC yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247315 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SCEV] Consistently Handle Expressions That Cannot Be Divided
Matthew Simpson [Thu, 10 Sep 2015 18:12:47 +0000 (18:12 +0000)]
[SCEV] Consistently Handle Expressions That Cannot Be Divided

This patch addresses the issue of SCEV division asserting on some
input expressions (e.g., non-affine expressions) and quietly giving
up on others.  When giving up, we set the quotient to be equal to
zero and the remainder to be equal to the numerator. With this
patch, we always quietly give up when we cannot perform the
division.

This patch also adds a test case for DependenceAnalysis that
previously caused an assertion.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247314 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MergeFuncs] Fix callsite attributes in thunk generation
JF Bastien [Thu, 10 Sep 2015 18:08:35 +0000 (18:08 +0000)]
[MergeFuncs] Fix callsite attributes in thunk generation

This change correctly sets the attributes on the callsites
generated in thunks. This makes sure things such as sret, sext, etc.
are correctly set, so that the call can be a proper tailcall.

Also, the transfer of attributes in the replaceDirectCallers function
appears to be unnecessary, but until this is confirmed it will remain.

Author: jrkoenig
Reviewers: dschuff, jfb
Subscribers: llvm-commits, nlewycky
Differential revision: http://reviews.llvm.org/D12581

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247313 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTidy up some alias syntax to make explicit pointer type migration easier
David Blaikie [Thu, 10 Sep 2015 18:03:45 +0000 (18:03 +0000)]
Tidy up some alias syntax to make explicit pointer type migration easier

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247312 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CMake] s/LLVM_SOURCE_DIR/LLVM_MAIN_SRC_DIR/
Jordan Rose [Thu, 10 Sep 2015 17:55:02 +0000 (17:55 +0000)]
[CMake] s/LLVM_SOURCE_DIR/LLVM_MAIN_SRC_DIR/

Fix-up for r247305 to use the right variable. There's another use of
LLVM_SOURCE_DIR in this file that is probably also questionable, but it's
for Windows so I'm going to leave it alone.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247311 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SimplifyCFG] Use known bits to eliminate dead switch defaults
Philip Reames [Thu, 10 Sep 2015 17:44:47 +0000 (17:44 +0000)]
[SimplifyCFG] Use known bits to eliminate dead switch defaults

This is a follow up to http://reviews.llvm.org/D11995 implementing the suggestion by Hans.

If we know some of the bits of the value being switched on, we know that the maximum number of unique cases covers the unknown bits. This allows to eliminate switch defaults for large integers (i32) when most bits in the value are known.

Note that I had to make the transform contingent on not having any dead cases. This is conservatively correct with the old code, but required for the new code since we might have a dead case which varies one of the known bits. Counting that towards our number of covering cases would be bad.  If we do have dead cases, we'll eliminate them first, then revisit the possibly dead default.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247309 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CMake] Add DARWIN_LTO_LIBRARY option to allow overriding -lto_library.
Chris Bieneman [Thu, 10 Sep 2015 17:28:51 +0000 (17:28 +0000)]
[CMake] Add DARWIN_LTO_LIBRARY option to allow overriding -lto_library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247308 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CMake] Allow LLVM_TOOLCHAIN_TOOLS to be overridden
Chris Bieneman [Thu, 10 Sep 2015 17:23:32 +0000 (17:23 +0000)]
[CMake] Allow LLVM_TOOLCHAIN_TOOLS to be overridden

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247306 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CMake] Fix Xcode build with LLVM_ENABLE_OBJLIB.
Jordan Rose [Thu, 10 Sep 2015 17:18:51 +0000 (17:18 +0000)]
[CMake] Fix Xcode build with LLVM_ENABLE_OBJLIB.

This amends chapuni's r246156 to handle an Xcode quirk, one even called out
in the CMake documentation:

    Some native build systems may not like targets that have only object files,
    so consider adding at least one real source file to any target that
    references $<TARGET_OBJECTS:objlib>.

I've limited the scope of this hack to Xcode for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247305 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDebug Info: Allow a DIModule to appear as the scope of other entities.
Adrian Prantl [Thu, 10 Sep 2015 17:13:58 +0000 (17:13 +0000)]
Debug Info: Allow a DIModule to appear as the scope of other entities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247304 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[docs][PerformanceTips] Add text on allocas and alignment
Philip Reames [Thu, 10 Sep 2015 17:03:10 +0000 (17:03 +0000)]
[docs][PerformanceTips] Add text on allocas and alignment

This summarizes two recent llvm-dev discussions.  Most of the text provided by David Chisnall and Benoit Belley with minor editting by me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247301 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] add two more variants of FuzzerDriver for convenience
Kostya Serebryany [Thu, 10 Sep 2015 16:57:57 +0000 (16:57 +0000)]
[libFuzzer] add two more variants of FuzzerDriver for convenience

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247300 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WinEH] Fix single-block cleanup coloring
Joseph Tremoulet [Thu, 10 Sep 2015 16:51:25 +0000 (16:51 +0000)]
[WinEH] Fix single-block cleanup coloring

Summary:
The coloring code in WinEHPrepare queues cleanuprets' successors with the
correct color (the parent one) when it sees their cleanuppad, and so later
when iterating successors knows to skip processing cleanuprets since
they've already been queued.  This latter check was incorrectly under an
'else' condition and so inadvertently was not kicking in for single-block
cleanups.  This change sinks the check out of the 'else' to fix the bug.

Reviewers: majnemer, andrew.w.kaylor, rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247299 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRe-commit r247216: "Fix Clang-tidy misc-use-override warnings, other minor fixes"
Hans Wennborg [Thu, 10 Sep 2015 16:49:58 +0000 (16:49 +0000)]
Re-commit r247216: "Fix Clang-tidy misc-use-override warnings, other minor fixes"

Except the changes that defined virtual destructors as =default, because that
ran into problems with GCC 4.7 and overriding methods that weren't noexcept.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247298 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix an undefined behavior introduces in r247234
Steven Wu [Thu, 10 Sep 2015 16:32:28 +0000 (16:32 +0000)]
Fix an undefined behavior introduces in r247234

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247296 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago80-cols; NFC
Sanjay Patel [Thu, 10 Sep 2015 16:31:19 +0000 (16:31 +0000)]
80-cols; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247295 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agouse range-based for loop; NFCI
Sanjay Patel [Thu, 10 Sep 2015 16:25:38 +0000 (16:25 +0000)]
use range-based for loop; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247294 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agouse range-based for loop; NFCI
Sanjay Patel [Thu, 10 Sep 2015 16:15:21 +0000 (16:15 +0000)]
use range-based for loop; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247293 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Bitcode] Add xfail test for PR24755 (uselistorder)
Vedant Kumar [Thu, 10 Sep 2015 16:02:24 +0000 (16:02 +0000)]
[Bitcode] Add xfail test for PR24755 (uselistorder)

This test stresses verify-uselistorder. PR24755 is caused by our
ignoring uses when they occur in the function personality slot, the
prologue data slot, or the prefix data slot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247292 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agofix typo; NFC
Sanjay Patel [Thu, 10 Sep 2015 15:14:34 +0000 (15:14 +0000)]
fix typo; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247287 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix PR 24724 - The implicit register verifier shouldn't assume certain operand
Alex Lorenz [Thu, 10 Sep 2015 14:04:34 +0000 (14:04 +0000)]
Fix PR 24724 - The implicit register verifier shouldn't assume certain operand
order.

The implicit register verifier in the MIR parser should only check if the
instruction's default implicit operands are present in the instruction. It
should not check the order in which they occur.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247283 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoCleaning up LLVM IR mode for Emacs.
Rafael Espindola [Thu, 10 Sep 2015 13:44:28 +0000 (13:44 +0000)]
Cleaning up LLVM IR mode for Emacs.

I've made a range of improvements to the Emacs mode for LLVM IR.

Most importantly, it changes llvm-mode to inherit from prog-mode. This
means llvm-mode will be treated as a normal programming mode in Emacs,
so many Emacs features will just work. prog-mode is new to Emacs 24,
so I've added an alias to ensure compatibility with Emacs 23 too.

I've changed the mode definition to use define-derived-mode. This
saves us needing to set up local variables ourselves, and saves us
needing to define llvm-mode-map, llvm-mode-abbrev-table,
llvm-mode-map.

I've removed the keybindings to tab-to-tab-stop, center-line and
center-paragraph. This shouldn't be llvm-mode's responsibility, and
the code didn't actually work anyway (since `(not llvm-mode-map)`
always evaluated to `t`, the keybindings were never executed).

I've simplified the syntax-table definition, it's equivalent (e.g. `"`
is treated as string delimiter by default in Emacs). I've added `.` as
a symbol constituent, so functions like `llvm.memset.p0i8.i32` are
recognised as a single symbol. I've also changed `%` to be a symbol
constituent, so users can move between words or symbols at their
choice, rather than conflating the two.

I've fixed regexp for types, which incorrect used `symbol` instead of
`symbols` as an argument to `regexp-opt`. This was causing incorrect
highlighting on lines like `call void @foovoid`.

I've removed string and comment highlighting from
`llvm-font-lock-keywords`. This is already handled by the
syntax-table.

Finally, I've removed the reference to jasmin. That project is long
abandoned and the link 404s. For reference, I've found an old copy of
the project here:
https://github.com/stevej/emacs/blob/master/vendor/jasmin/jasmin.el

Patch by Wilfred Hughes!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247281 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAVX512: Implemented encoding and intrinsics for
Igor Breger [Thu, 10 Sep 2015 12:54:54 +0000 (12:54 +0000)]
AVX512: Implemented encoding and intrinsics for
  vextracti64x4 ,vextracti64x2, vextracti32x8, vextracti32x4, vextractf64x4, vextractf64x2, vextractf32x8, vextractf32x4
Added tests for intrinsics and encoding.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247276 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSilencing C4141 warnings that were introduced en masse because __forceinline cannot...
Aaron Ballman [Thu, 10 Sep 2015 12:53:40 +0000 (12:53 +0000)]
Silencing C4141 warnings that were introduced en masse because __forceinline cannot be combined with inline in MSVC without triggering this diagnostic. This is safe to disable because clang will catch instances of the issue with -Wduplicate-decl-specifier, so we are not losing diagnostic coverage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247275 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[FileCheck] Use range-based for loops. NFC.
Benjamin Kramer [Thu, 10 Sep 2015 11:59:55 +0000 (11:59 +0000)]
[FileCheck] Use range-based for loops. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247272 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoThere is a trunc(lshr (zext A), Cst) optimization in InstCombineCasts that
Jakub Kuderski [Thu, 10 Sep 2015 11:31:20 +0000 (11:31 +0000)]
There is a trunc(lshr (zext A), Cst) optimization in InstCombineCasts that
removes cast by performing the lshr on smaller types. However, currently there
is no trunc(lshr (sext A), Cst) variant.
This patch add such optimization by transforming trunc(lshr (sext A), Cst)
to ashr A, Cst.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247271 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Rewrite the StringRef::find implementation to be simpler, clearer,
Chandler Carruth [Thu, 10 Sep 2015 11:17:49 +0000 (11:17 +0000)]
[ADT] Rewrite the StringRef::find implementation to be simpler, clearer,
and tremendously less reliant on the optimizer to fix things.

The code is always necessarily looking for the entire length of the
string when doing the equality tests in this find implementation, but it
previously was needlessly re-checking the size each time among other
annoyances.

By writing this so simply an ddirectly in terms of memcmp, it also is
about 8x faster in a debug build, which in turn makes FileCheck about 2x
faster in 'ninja check-llvm'. This saves about 8% of the time for
FileCheck-heavy parts of the test suite like the x86 backend tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247269 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[DAGCombine] Truncate BUILD_VECTOR operators if necessary when constant folding vectors
Silviu Baranga [Thu, 10 Sep 2015 10:34:34 +0000 (10:34 +0000)]
[DAGCombine] Truncate BUILD_VECTOR operators if necessary when constant folding vectors

Summary:
The BUILD_VECTOR node will truncate its operators to match the
type. We need to take this into account when constant folding -
we need to perform a truncation before constant folding the elements.
This is because the upper bits can change the result, depending on
the operation type (for example this is the case for min/max).

This change also adds a regression test.

Reviewers: jmolloy

Subscribers: jmolloy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247265 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoEnable GlobalsAA by default
James Molloy [Thu, 10 Sep 2015 10:22:20 +0000 (10:22 +0000)]
Enable GlobalsAA by default

This can give significant improvements to alias analysis in some situations, and improves its testing coverage in all situations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247264 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd GlobalsAA as preserved to a bunch of transforms
James Molloy [Thu, 10 Sep 2015 10:22:12 +0000 (10:22 +0000)]
Add GlobalsAA as preserved to a bunch of transforms

GlobalsAA must by definition be preserved in function passes, but the passmanager doesn't know that. Make each pass explicitly preserve GlobalsAA.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247263 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Force inline several super boring and unusually hot methods on
Chandler Carruth [Thu, 10 Sep 2015 09:46:47 +0000 (09:46 +0000)]
[ADT] Force inline several super boring and unusually hot methods on
SmallVector to further help debug builds not waste their time calling
one line functions.

To give you an idea of why this is worthwhile, this change alone gets
another >10% reduction in the runtime of TripleTest.Normalization! It's
now under 9 seconds for me. Sadly, this is the end of the easy wins for
that test. Anything further will require some different architecture of
the test itself. Still, I'm pretty happy. 'check-llvm' now is under 35s
for me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247259 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Micro-optimize and force inlining for string switches.
Chandler Carruth [Thu, 10 Sep 2015 09:25:59 +0000 (09:25 +0000)]
[ADT] Micro-optimize and force inlining for string switches.

These are now quite heavily used in unit tests and the host tools,
making it worth having them be reasonably fast even in an unoptimized
build. This change reduces the total runtime of TripleTest.Normalization
by yet another 10% to 15%. It is now under 10 seconds on my machine, and
the total check-llvm time has dropped from 38s to around 36s.

I experimented with a number of different options, and the code pattern
here consistently seemed to lower the cleanest, likely due to the
significantly simple CFG and far fewer redundant tests of 'Result'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247257 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Do not use vtrn for vectorshuffle if the order is reversed
James Molloy [Thu, 10 Sep 2015 08:42:28 +0000 (08:42 +0000)]
[ARM] Do not use vtrn for vectorshuffle if the order is reversed

The tests in isVTRNMask and isVTRN_v_undef_Mask should also check that the elements of the upper and lower half of the vectorshuffle occur in the correct order when both halves are used. Without this test the code assumes that it is correct to use vector transpose (vtrn) for the masks <1, 1, 0, 0> and <1, 3, 0, 2>, among others, but the transpose actually incorrectly generates shuffles for <0, 0, 1, 1> and <0, 2, 1, 3> in this case.

Patch by Jeroen Ketema!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247254 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Apply a large hammer to StringRef functions: attribute always_inline.
Chandler Carruth [Thu, 10 Sep 2015 08:29:35 +0000 (08:29 +0000)]
[ADT] Apply a large hammer to StringRef functions: attribute always_inline.

The logic of this follows something Howard does in libc++ and something
I discussed with Chris eons ago -- for a lot of functions, there is
really no benefit to preserving "debug information" by leaving the
out-of-line even in debug builds. This is especially true as we now do
a very good job of preserving most debug information even in the face of
inlining. There are a bunch of methods in StringRef that we are paying
a completely unacceptable amount for with every debug build of every
LLVM developer.

Some day, we should fix Clang/LLVM so that developers can reasonable
use a default of something other than '-O0' and not waste their lives
waiting on *completely* unoptimized code to execute. We should have
a default that doesn't impede debugging while providing at least
plausable performance.

But today is not that day.

So today, I'm applying always_inline to the functions that are really
hurting the critical path for stuff like 'check_llvm'. I'm being very
cautious here, but there are a few other APIs that we really should do
this for as a matter of pragmatism. Hopefully we can rip this out some
day.

With this change, TripleTest.Normalization runtime decreases by over
10%, and the total 'check-llvm' time on my 48-core box goes from 38s to
just under 37s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247253 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Support] Fix the always_inline attribute macro to not include the
Chandler Carruth [Thu, 10 Sep 2015 08:29:30 +0000 (08:29 +0000)]
[Support] Fix the always_inline attribute macro to not include the
'inline' specifier. That specifier may or may not be valid for a given
function, or it may be required for correct linkage even when the
compiler doesn't support the always_inline attribute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247252 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Micro-optimize the Triple constructor by doing a single split and
Chandler Carruth [Thu, 10 Sep 2015 07:51:43 +0000 (07:51 +0000)]
[ADT] Micro-optimize the Triple constructor by doing a single split and
re-using the resulting components rather than repeatedly splitting and
re-splitting to compute each component as part of the initializer list.

This is more work on PR23676. Sadly, it doesn't help much. It removes
the constructor from my profile, but doesn't make a sufficient dent in
the total time. But it should play together nicely with subsequent
changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247250 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Fix a confusing interface spec and some annoying peculiarities
Chandler Carruth [Thu, 10 Sep 2015 07:51:37 +0000 (07:51 +0000)]
[ADT] Fix a confusing interface spec and some annoying peculiarities
with the StringRef::split method when used with a MaxSplit argument
other than '-1' (which nobody really does today, but which should
actually work).

The spec claimed both to split up to MaxSplit times, but also to append
<= MaxSplit strings to the vector. One of these doesn't make sense.
Given the name "MaxSplit", let's go with it being a max over how many
*splits* occur, which means the max on how many strings get appended is
MaxSplit+1. I'm not actually sure the implementation correctly provided
this logic either, as it used a really opaque loop structure.

The implementation was also playing weird games with nullptr in the data
field to try to rely on a totally opaque hidden property of the split
method that returns a pair. Nasty IMO.

Replace all of this with what is (IMO) simpler code that doesn't use the
pair returning split method, and instead just finds each separator and
appends directly. I think this is a lot easier to read, and it most
definitely matches the spec. Added some tests that exercise the corner
cases around StringRef() and StringRef("") that all now pass.

I'll start using this in code in the next commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247249 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoGlobalsAAResult(&&): Move every members.
NAKAMURA Takumi [Thu, 10 Sep 2015 07:16:42 +0000 (07:16 +0000)]
GlobalsAAResult(&&): Move every members.

Or, one of MSVC builders failed with unexpected behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247247 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdded isUndef() interface for SDNode
Elena Demikhovsky [Thu, 10 Sep 2015 06:33:13 +0000 (06:33 +0000)]
Added isUndef() interface for SDNode

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247246 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Switch a bunch of places in LLVM that were doing single-character
Chandler Carruth [Thu, 10 Sep 2015 06:12:31 +0000 (06:12 +0000)]
[ADT] Switch a bunch of places in LLVM that were doing single-character
splits to actually use the single character split routine which does
less work, and in a debug build is *substantially* faster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247245 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Add a single-character version of the small vector split routine
Chandler Carruth [Thu, 10 Sep 2015 06:07:03 +0000 (06:07 +0000)]
[ADT] Add a single-character version of the small vector split routine
on StringRef. Finding and splitting on a single character is
substantially faster than doing it on even a single character StringRef
-- we immediately get to a *very* tuned memchr call this way.

Even nicer, we get to this even in a debug build, shaving 18% off the
runtime of TripleTest.Normalization, helping PR23676 some more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247244 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd a way to skip the Go bindings tests even when Go is configured in
Chandler Carruth [Thu, 10 Sep 2015 05:47:43 +0000 (05:47 +0000)]
Add a way to skip the Go bindings tests even when Go is configured in
CMake.

The Go bindings tests in an unoptimized build take over 30 seconds for
me, making it the slowest test in 'check-llvm' by a factor of two.

I've only rigged this up fully to the CMake build. If someone is
interested in rigging it up to the autoconf build, they're welcome to do
so.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247243 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ScalarEvolution] Fix PR24757.
Sanjoy Das [Thu, 10 Sep 2015 05:27:38 +0000 (05:27 +0000)]
[ScalarEvolution] Fix PR24757.

Summary:
PR24757 was caused by some incorect math in
`ScalarEvolution::HowFarToZero` -- the smallest unsigned solution for X
in

  2^N * A = 2^N * X

is not necessarily A.

Reviewers: atrick, majnemer, meheff

Subscribers: llvm-commits, sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247242 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LPM] Simplify this code and fix a compile error for compilers that
Chandler Carruth [Thu, 10 Sep 2015 04:22:36 +0000 (04:22 +0000)]
[LPM] Simplify this code and fix a compile error for compilers that
don't correctly implement the scoping rules of C++11 range based for
loops. This kind of aliasing isn't a good idea anyways (and wasn't
really intended).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247241 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LPM] Use a map from analysis ID to immutable passes in the legacy pass
Chandler Carruth [Thu, 10 Sep 2015 02:31:42 +0000 (02:31 +0000)]
[LPM] Use a map from analysis ID to immutable passes in the legacy pass
manager to avoid a slow linear scan of every immutable pass and on every
attempt to find an analysis pass.

This speeds up 'check-llvm' on an unoptimized build for me by 15%, YMMV.
It should also help (a tiny bit) other folks that are really
bottlenecked on repeated runs of tiny pass pipelines across small IR
files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247240 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoEnable the shrink wrapping optimization for PPC64.
Kit Barton [Thu, 10 Sep 2015 01:55:44 +0000 (01:55 +0000)]
Enable the shrink wrapping optimization for PPC64.

The changes in this patch are as follows:
  1. Modify the emitPrologue and emitEpilogue methods to work properly when the prologue and epilogue blocks are not the first/last blocks in the function
  2. Fix a bug in PPCEarlyReturn optimization caused by an empty entry block in the function
  3. Override the runShrinkWrap PredicateFtor (defined in TargetMachine) to check whether shrink wrapping should run:
      Shrink wrapping will run on PPC64 (Little Endian and Big Endian) unless -enable-shrink-wrap=false is specified on command line

A new test case, ppc-shrink-wrapping.ll was created based on the existing shrink wrapping tests for x86, arm, and arm64.

Phabricator review: http://reviews.llvm.org/D11817

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247237 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] Match FI+offset in STNP addressing mode.
Ahmed Bougacha [Thu, 10 Sep 2015 01:54:43 +0000 (01:54 +0000)]
[AArch64] Match FI+offset in STNP addressing mode.

First, we need to teach isFrameOffsetLegal about STNP.
It already knew about the STP/LDP variants, but those were probably
never exercised, because it's only the load/store optimizer that
generates STP/LDP, and the only user of the method is frame lowering,
which runs earlier.
The STP/LDP cases were wrong: they didn't take into account the fact
that they return two results, not one, so the immediate offset will be
the 4th operand, not the 3rd.

Follow-up to r247234.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247236 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MC] Convert all the remaining tests from macho-dump to llvm-readobj.
Davide Italiano [Thu, 10 Sep 2015 01:50:00 +0000 (01:50 +0000)]
[MC] Convert all the remaining tests from macho-dump to llvm-readobj.

This sort-of deprecates macho-dump. It may take still a little while
to garbage collect it, but at least there's no real usage of it in
the tree anymore. New tests should always rely on llvm-readobj or
llvm-objdump.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247235 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] Match base+offset in STNP addressing mode.
Ahmed Bougacha [Thu, 10 Sep 2015 01:48:29 +0000 (01:48 +0000)]
[AArch64] Match base+offset in STNP addressing mode.

Followup to r247231.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247234 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMakes EmitRecord() accepting ArrayRef and raw array (NFC)
Mehdi Amini [Thu, 10 Sep 2015 01:45:55 +0000 (01:45 +0000)]
Makes EmitRecord() accepting ArrayRef and raw array (NFC)

After r247186, a vector is no longer needed as the push_front for
the code is removed.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247232 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] Support selecting STNP.
Ahmed Bougacha [Thu, 10 Sep 2015 01:42:28 +0000 (01:42 +0000)]
[AArch64] Support selecting STNP.

We could go through the load/store optimizer and match STNP where
we would have matched a nontemporal-annotated STP, but that's not
reliable enough, as an opportunistic optimization.
Insetad, we can guarantee emitting STNP, by matching them at ISel.
Since there are no single-input nontemporal stores, we have to
resort to some high-bits-extracting trickery to generate an STNP
from a plain store.

Also, we need to support another, LDP/STP-specific addressing mode,
base + signed scaled 7-bit immediate offset.
For now, only match the base. Let's make it smart separately.

Part of PR24086.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247231 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU/SI: Fix more cases of losing exec operands
Matt Arsenault [Thu, 10 Sep 2015 01:23:28 +0000 (01:23 +0000)]
AMDGPU/SI: Fix more cases of losing exec operands

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247230 91177308-0d34-0410-b5e6-96231b3b80d8