platform/upstream/llvm.git
8 years ago[ELF] Support for setting the base address
Petr Hosek [Tue, 12 Jul 2016 19:37:53 +0000 (19:37 +0000)]
[ELF] Support for setting the base address

The -image-base option allows for overriding the base address.

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

llvm-svn: 275206

8 years ago[LoopVectorize] Assorted cleanups
David Majnemer [Tue, 12 Jul 2016 19:35:15 +0000 (19:35 +0000)]
[LoopVectorize] Assorted cleanups

Use range-based for loops instead of doing everything manually.
Use auto when appropriate.

No functional change is intended.

llvm-svn: 275205

8 years agoX86FixupBWInsts: No need for forward liveness analysis.
Matthias Braun [Tue, 12 Jul 2016 19:04:30 +0000 (19:04 +0000)]
X86FixupBWInsts: No need for forward liveness analysis.

With r274952 and r275201 in place there are no cases left where a
forward liveness analysis yields different results than a backward one.
So we can remove the forward stepping logic.

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

llvm-svn: 275204

8 years agoAMDGPU: Fix verifier error with kill intrinsic
Matt Arsenault [Tue, 12 Jul 2016 19:01:23 +0000 (19:01 +0000)]
AMDGPU: Fix verifier error with kill intrinsic

Don't create a terminator in the middle of the block.
We should probably get rid of this intrinsic.

llvm-svn: 275203

8 years ago[PM] Port LoopIdiomRecognize Pass to new PM
Dehao Chen [Tue, 12 Jul 2016 18:45:51 +0000 (18:45 +0000)]
[PM] Port LoopIdiomRecognize Pass to new PM

Summary: Port LoopIdiomRecognize Pass to new PM

Reviewers: davidxl

Subscribers: davide, sanjoy, mzolotukhin, llvm-commits

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

llvm-svn: 275202

8 years agoBranchFolding: Use LivePhysReg to update live in lists.
Matthias Braun [Tue, 12 Jul 2016 18:44:33 +0000 (18:44 +0000)]
BranchFolding: Use LivePhysReg to update live in lists.

Use LivePhysRegs with a backwards walking algorithm to update live in
lists, this way the results do not depend on the presence of kill flags
anymore.

This patch also reduces the number of registers added as live-in.
Previously all pristine registers as well as all sub registers of a
super register were added resulting in unnecessarily large live in
lists. This fixed https://llvm.org/PR25263.

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

llvm-svn: 275201

8 years agoAMDGPU: Set isConvergent on v_cmpx* instructions
Matt Arsenault [Tue, 12 Jul 2016 18:41:03 +0000 (18:41 +0000)]
AMDGPU: Set isConvergent on v_cmpx* instructions

No test since these aren't used now, except for one place
in a pre-emit pass.

llvm-svn: 275200

8 years agoTweaks to the NSIndexPath formatter to enhance stability
Enrico Granata [Tue, 12 Jul 2016 18:33:52 +0000 (18:33 +0000)]
Tweaks to the NSIndexPath formatter to enhance stability

rdar://problem/25767901

llvm-svn: 275199

8 years agoAdd logging to Linux Host::GetProcessAndStatInfo.
Oleksiy Vyalov [Tue, 12 Jul 2016 18:14:27 +0000 (18:14 +0000)]
Add logging to Linux Host::GetProcessAndStatInfo.

llvm-svn: 275198

8 years agoAMDGPU: Add LLVM IR Intrinsic for v_lerp_u8
Wei Ding [Tue, 12 Jul 2016 18:02:14 +0000 (18:02 +0000)]
AMDGPU: Add LLVM IR Intrinsic for v_lerp_u8

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

llvm-svn: 275197

8 years agoFix printing of debugging information in LiveIntervals::shrinkToUses
Krzysztof Parzyszek [Tue, 12 Jul 2016 17:55:28 +0000 (17:55 +0000)]
Fix printing of debugging information in LiveIntervals::shrinkToUses

Print VNI->def before calling VNI->markUnused(), since markUnused makes
the def invalid.

llvm-svn: 275196

8 years agoAArch64: fix return type of vqmovun_high_*.
Tim Northover [Tue, 12 Jul 2016 17:38:50 +0000 (17:38 +0000)]
AArch64: fix return type of vqmovun_high_*.

These should be returning an unsigned quantity.

llvm-svn: 275195

8 years agoAdd print/dump routines to LiveInterval::SubRange
Krzysztof Parzyszek [Tue, 12 Jul 2016 17:37:44 +0000 (17:37 +0000)]
Add print/dump routines to LiveInterval::SubRange

llvm-svn: 275194

8 years ago[PGO] Don't include full file path in static function profile counter names
Xinliang David Li [Tue, 12 Jul 2016 17:14:51 +0000 (17:14 +0000)]
[PGO] Don't include full file path in static function profile counter names

Patch by Jake VanAdrighem
Differential Revision: http://reviews.llvm.org/D22028

llvm-svn: 275193

8 years agoadd tests for missing DeMorgan's Law folds
Sanjay Patel [Tue, 12 Jul 2016 17:05:04 +0000 (17:05 +0000)]
add tests for missing DeMorgan's Law folds

llvm-svn: 275192

8 years agoFix for the mingw builder
David Majnemer [Tue, 12 Jul 2016 16:56:33 +0000 (16:56 +0000)]
Fix for the mingw builder

llvm-svn: 275191

8 years ago[ItaniumMangle] Correctly mangle BuiltinTemplateDecls
David Majnemer [Tue, 12 Jul 2016 16:48:17 +0000 (16:48 +0000)]
[ItaniumMangle] Correctly mangle BuiltinTemplateDecls

A BuiltinTemplateDecl has no underlying templated decl and as such they
cannot be relied upon for mangling.  The ItaniumMangler had some bugs
here which lead to crashes.

This fixes PR28519.

llvm-svn: 275190

8 years agoAdd CHECK line to test case. NFC.
Michael Kruse [Tue, 12 Jul 2016 16:37:50 +0000 (16:37 +0000)]
Add CHECK line to test case. NFC.

Check not only that the compiler is not crashing, but also whether the
probablematic part (The sequence of instructions simplified to '4') is reflected
in the output.

Thanks to Tobias for the hint.

llvm-svn: 275189

8 years agoauto-generate checks
Sanjay Patel [Tue, 12 Jul 2016 16:21:55 +0000 (16:21 +0000)]
auto-generate checks

llvm-svn: 275188

8 years agoauto-generate checks
Sanjay Patel [Tue, 12 Jul 2016 16:17:30 +0000 (16:17 +0000)]
auto-generate checks

llvm-svn: 275187

8 years agoauto-generate checks
Sanjay Patel [Tue, 12 Jul 2016 16:13:04 +0000 (16:13 +0000)]
auto-generate checks

llvm-svn: 275186

8 years agoIncrease "process load" timeout
Pavel Labath [Tue, 12 Jul 2016 16:06:31 +0000 (16:06 +0000)]
Increase "process load" timeout

Loading a dynamic library can take quite a long time, since it triggers a number of
shared-library-event stops for dependent libraries. This is especially true for remote targets
due to communication latency. Increase the default 500ms timeout to account for that.

Committing as obvious.

llvm-svn: 275185

8 years agoAdd tests for the meta.unary.props that do not require a complete type. This is part...
Marshall Clow [Tue, 12 Jul 2016 15:50:53 +0000 (15:50 +0000)]
Add tests for the meta.unary.props that do not require a complete type. This is part of LWG#2582

llvm-svn: 275184

8 years agoclang-format: [JS] Allow top-level conditionals again.
Daniel Jasper [Tue, 12 Jul 2016 15:45:53 +0000 (15:45 +0000)]
clang-format: [JS] Allow top-level conditionals again.

I am not sure exactly which test breakage Martin was trying to fix in
r273694. For now, fix the behavior for top-level conditionals, which
(surprisingly) are actually used somewhat commonly.

llvm-svn: 275183

8 years agoDisable the "gcd-io-race.mm" test to investigate bot hangs due to the test being...
Kuba Brecka [Tue, 12 Jul 2016 15:41:14 +0000 (15:41 +0000)]
Disable the "gcd-io-race.mm" test to investigate bot hangs due to the test being deadlocked.

llvm-svn: 275182

8 years ago[compiler-rt] Disable a test failing on windows.
Etienne Bergeron [Tue, 12 Jul 2016 15:33:25 +0000 (15:33 +0000)]
[compiler-rt] Disable a test failing on windows.

Summary:
The unittest is not working on windows. The "regexp.h" is not available and
gtest-port won't support regexp with operator '|'.

The test wasn't failing on 32-bits because of this check:
```
  if (SANITIZER_WORDSIZE != 64 || ASAN_AVOID_EXPENSIVE_TESTS) return;
```

```
[ RUN      ] AddressSanitizer.HugeMallocTest
C:/src/llvm/llvm/utils/unittest/googletest\src/gtest-port.cc(272): error: Failed
Syntax error at index 30 in simple regular expression "is located 1 bytes to the left|AddressSanitizer failed to allocate": '|' is unsupported.
C:/src/llvm/llvm/projects/compiler-rt/lib/asan/tests/asan_test.cc(308): error: Death test: Ident((char*)malloc(n_megs << 20))[-1] = 0
    Result: died but not with expected error.
  Expected: is located 1 bytes to the left|AddressSanitizer failed to allocate
```

See gtest-port.h:
```
  #elif GTEST_OS_WINDOWS

// <regex.h> is not available on Windows.  Use our own simple regex
// implementation instead.
# define GTEST_USES_SIMPLE_RE 1
```

Reviewers: rnk

Subscribers: llvm-commits, wang0109, kubabrecka, chrisha

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

llvm-svn: 275181

8 years ago[compiler-rt] Enhance function padding detection for function interception
Etienne Bergeron [Tue, 12 Jul 2016 15:33:04 +0000 (15:33 +0000)]
[compiler-rt] Enhance function padding detection for function interception

Summary:
Many CRT (64-bits) functions contains a "hint-nop". The current padding
detection is not able to recognize the 10-bytes padding and the HotPatch
hooking technique cannot be used.

Other patterns may be discover and may be added later.

Reviewers: rnk

Subscribers: llvm-commits, wang0109, chrisha

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

llvm-svn: 275180

8 years ago[MC] Flip llc's assembly comment preservation flag to have consistent
Nirav Dave [Tue, 12 Jul 2016 15:32:36 +0000 (15:32 +0000)]
[MC] Flip llc's assembly comment preservation flag to have consistent
orientation with llvm-mc.

llvm-svn: 275179

8 years ago[AArch64] Set FMOVS0 and FMOVD0 as isAsCheapAsAMove when needed.
Haicheng Wu [Tue, 12 Jul 2016 15:31:41 +0000 (15:31 +0000)]
[AArch64] Set FMOVS0 and FMOVD0 as isAsCheapAsAMove when needed.

If a subtarget has both ZCZeroing and CustomCheapAsMoveHandling features (now
only Kryo has both), set FMOVS0 and FMOVD0 isAsCheapAsAMove.

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

llvm-svn: 275178

8 years agomark issue #2422 as complete; this was just a wording clarification
Marshall Clow [Tue, 12 Jul 2016 15:29:35 +0000 (15:29 +0000)]
mark issue #2422 as complete; this was just a wording clarification

llvm-svn: 275177

8 years agomark issue #2181 as complete; this was just a wording clarification
Marshall Clow [Tue, 12 Jul 2016 15:15:55 +0000 (15:15 +0000)]
mark issue #2181 as complete; this was just a wording clarification

llvm-svn: 275176

8 years ago[NPL] Increase ETXTBSY workaround sleep
Pavel Labath [Tue, 12 Jul 2016 15:13:11 +0000 (15:13 +0000)]
[NPL] Increase ETXTBSY workaround sleep

10ms does not seem to be enough all the time, go to 50.

llvm-svn: 275175

8 years ago[SCEVAffinator] Fix assertion checking for constant divisor.
Michael Kruse [Tue, 12 Jul 2016 15:08:47 +0000 (15:08 +0000)]
[SCEVAffinator] Fix assertion checking for constant divisor.

An assertion in visitSDivInstruction() checked whether the divisor is constant
by checking whether the argument is a ConstantInt. However, SCEVValidator allows
the divisor to be simplified to a constant by ScalarEvolution.

We synchronize the implementation of SCEVValidator and SCEVAffinator to both
accept simplified SCEV expressions.

llvm-svn: 275174

8 years ago[test] Fix category-based skipping
Pavel Labath [Tue, 12 Jul 2016 15:07:18 +0000 (15:07 +0000)]
[test] Fix category-based skipping

Summary:
LLDBTestResult.hardMarkAsSkipped marked the whole class as skipped when the first class in the
test failed the category check. This meant that subsequent tests in the same class did not run
even if they were passing the category filter. Fix that.

Reviewers: tfiala

Subscribers: lldb-commits

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

llvm-svn: 275173

8 years agoAdd option to disable __deallocate #warning
Saleem Abdulrasool [Tue, 12 Jul 2016 14:39:13 +0000 (14:39 +0000)]
Add option to disable __deallocate #warning

From r229162:
  Visual Studio's SAL extension uses a macro named __deallocate. This
  macro is used pervasively
Using -Werror when building for Windows can force the use of -Wno-#warnings
specifically because of this __deallocate #warning. Instead of forcing
builds to disable all #warnings, this option allows libc++ to be built
without this particular warning, while leaving other #warnings enabled.

Patch by Dave Lee!

llvm-svn: 275172

8 years agoPut the status in the right column
Marshall Clow [Tue, 12 Jul 2016 14:38:59 +0000 (14:38 +0000)]
Put the status in the right column

llvm-svn: 275171

8 years agoMark P0067 as 'postponed', because it will be revised before the next meeting
Marshall Clow [Tue, 12 Jul 2016 14:37:39 +0000 (14:37 +0000)]
Mark P0067 as 'postponed', because it will be revised before the next meeting

llvm-svn: 275170

8 years ago[Clang][AVX512] Making cosmetic changes
Michael Zuckerman [Tue, 12 Jul 2016 12:42:27 +0000 (12:42 +0000)]
[Clang][AVX512] Making cosmetic changes

llvm-svn: 275169

8 years ago[PowerPC] Cannonicalize applicable vector shift immediates as swaps
Nemanja Ivanovic [Tue, 12 Jul 2016 12:16:27 +0000 (12:16 +0000)]
[PowerPC] Cannonicalize applicable vector shift immediates as swaps

This patch corresponds to review:
http://reviews.llvm.org/D21358

Vector shifts that have the same semantics as a vector swap are cannonicalized
as such to provide additional opportunities for swap removal optimization to
remove unnecessary swaps.

llvm-svn: 275168

8 years ago[codeview] Improved array type support.
Amjad Aboud [Tue, 12 Jul 2016 12:06:34 +0000 (12:06 +0000)]
[codeview] Improved array type support.

Added support for:
1. Multi dimension array.
2. Array of structure type, which previously was declared incompletely.
3. Dynamic size array.
4. Array where element type is a typedef, volatile or constant (this should resolve PR28311).

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

llvm-svn: 275167

8 years agoRecommit r275161 "[ELF] - Move section factory out from writer to make it reusable."
George Rimar [Tue, 12 Jul 2016 09:49:43 +0000 (09:49 +0000)]
Recommit r275161 "[ELF] - Move section factory out from writer to make it reusable."

With fix:
* fixed compilation error under linux:

template <class ELFT> class OutputSectionFactory {
...
  typedef typename SectionKey<ELFT::Is64Bits> Key;

changed to:
template <class ELFT> class OutputSectionFactory {
...
  typedef typename elf::SectionKey<ELFT::Is64Bits> Key;

llvm-svn: 275166

8 years agoFix a race on process exit
Pavel Labath [Tue, 12 Jul 2016 09:37:55 +0000 (09:37 +0000)]
Fix a race on process exit

Summary:
Process::SetExitStatus was popping the process io handler and resetting m_process_input_reader
shared pointer, which is not a safe thing to do as the function is called asynchronously and
other threads may be accessing the member variable. (E.g. if the process terminates really
quickly, the private state thread might only be in the process of pushing the handler on the
stack. Sometimes, this leads to deadlock, as the shared pointer's state gets corrupted by the
concurrent access.

Since the IOHandler will be popped anyway in Process:HandleProcessStateChangedEvent when the
exited event gets processed, doing the same in SetExitStatus seems to be unnecessary.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 275165

8 years agoDwarf parser: don't lookup void typedefs in the DWO
Pavel Labath [Tue, 12 Jul 2016 09:26:30 +0000 (09:26 +0000)]
Dwarf parser: don't lookup void typedefs in the DWO

Summary:
void typedefs do not have a DW_AT_type attribute, so we end up with an empty encoding_uid
variable. These don't need to be looked up and trying to look that will assert in a debug build.

Reviewers: clayborg

Subscribers: lldb-commits, tberghammer

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

llvm-svn: 275164

8 years agoRevert r275161 "[ELF] - Move section factory out from writer to make it reusable."
George Rimar [Tue, 12 Jul 2016 09:11:13 +0000 (09:11 +0000)]
Revert r275161 "[ELF] - Move section factory out from writer to make it reusable."

It broke build bot:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-debian-fast/builds/39652

llvm-svn: 275163

8 years ago[ELF] - Make few members of Writer to be global and export them for reuse
George Rimar [Tue, 12 Jul 2016 08:50:42 +0000 (08:50 +0000)]
[ELF] - Make few members of Writer to be global and export them for reuse

Creating sections on linkerscript side requires some methods
that can be reused if are exported from writer.

Patch implements that change.

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

llvm-svn: 275162

8 years ago[ELF] - Move section factory out from writer to make it reusable.
George Rimar [Tue, 12 Jul 2016 08:38:04 +0000 (08:38 +0000)]
[ELF] - Move section factory out from writer to make it reusable.

Since linkerscript should create sections by itself
(if SECTIONS command is present),
then we might want to reuse the OutputSectionFactory (D19976 already do that now),
so this patch moves it out from writer cpp file for that purpose.

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

llvm-svn: 275161

8 years agoAMDGPU: Unify MOVRELSOffset and MOVRELDOffset
Nicolai Haehnle [Tue, 12 Jul 2016 08:12:16 +0000 (08:12 +0000)]
AMDGPU: Unify MOVRELSOffset and MOVRELDOffset

Summary:
Previously, constant index insertelements would be turned into SI_INDIRECT_DST,
which is bound to prevent some optimization opportunities. Worse, it mislead
the heuristic that decides whether immediates should be lowered to S_MOV_B32
or V_MOV_B32 in a way that resulted in unnecessary v_readfirstlanes.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, kzhuravl, llvm-commits

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

llvm-svn: 275160

8 years ago[ELF] - Add Id field to Version struct.
George Rimar [Tue, 12 Jul 2016 07:44:40 +0000 (07:44 +0000)]
[ELF] - Add Id field to Version struct.

That helps to avoid expressions like I + 2 in code
that assigns version number to symbols.

Change was suggested by Rui Ueyama.

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

llvm-svn: 275159

8 years ago[ELF] Support for symbol assignment in linker scripts within SECTIONS {} block
Eugene Leviant [Tue, 12 Jul 2016 06:39:48 +0000 (06:39 +0000)]
[ELF] Support for symbol assignment in linker scripts within SECTIONS {} block

llvm-svn: 275158

8 years ago[ASTMatchers] isSignedInteger() and isUnsignedInteger()
Clement Courbet [Tue, 12 Jul 2016 06:36:00 +0000 (06:36 +0000)]
[ASTMatchers] isSignedInteger() and isUnsignedInteger()

Complementary to isInteger(), these match signed and unsigned integers
respectively.

Review: http://reviews.llvm.org/D21989
llvm-svn: 275157

8 years agoRevert "New pass manager for LICM."
Vitaly Buka [Tue, 12 Jul 2016 06:25:32 +0000 (06:25 +0000)]
Revert "New pass manager for LICM."

Summary: This reverts commit r275118.

Subscribers: sanjoy, mehdi_amini

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

llvm-svn: 275156

8 years ago[AVX512] Remove masked logic op intrinsics and autoupgrade them to native IR.
Craig Topper [Tue, 12 Jul 2016 05:27:53 +0000 (05:27 +0000)]
[AVX512] Remove masked logic op intrinsics and autoupgrade them to native IR.

llvm-svn: 275155

8 years ago[MS ABI] Support throwing/catching __unaligned types
David Majnemer [Tue, 12 Jul 2016 04:42:50 +0000 (04:42 +0000)]
[MS ABI] Support throwing/catching __unaligned types

We need to mark the appropriate bits in ThrowInfo and HandlerType so
that the personality routine can correctly handle qualification
conversions.

llvm-svn: 275154

8 years agoRemove unused parameters.
Rui Ueyama [Tue, 12 Jul 2016 03:49:41 +0000 (03:49 +0000)]
Remove unused parameters.

llvm-svn: 275153

8 years agoDump enum unique names.
Rui Ueyama [Tue, 12 Jul 2016 03:33:48 +0000 (03:33 +0000)]
Dump enum unique names.

llvm-svn: 275152

8 years agoAdd some safety checks to Platform::GetRemoteSharedModule so if it
Jason Molenda [Tue, 12 Jul 2016 03:25:22 +0000 (03:25 +0000)]
Add some safety checks to Platform::GetRemoteSharedModule so if it
is passed a ModuleSpec with a UUID, it won't accept a file it finds
with a matching FileSpec & ArchSpec, but with a different UUID.

<rdar://problem/27258864>

llvm-svn: 275151

8 years agoRe-enable TPI hash verification for enum records.
Rui Ueyama [Tue, 12 Jul 2016 03:25:03 +0000 (03:25 +0000)]
Re-enable TPI hash verification for enum records.

We didn't read unique names correctly. As a result, we computed
hashes on (non-)unique names instead of unique names.

llvm-svn: 275150

8 years agoX86: Avoid implicit iterator conversions, NFC
Duncan P. N. Exon Smith [Tue, 12 Jul 2016 03:18:50 +0000 (03:18 +0000)]
X86: Avoid implicit iterator conversions, NFC

Avoid implicit conversions from MachineInstrBundleIterator to
MachineInstr*, mainly by preferring MachineInstr& over MachineInstr* and
using range-based for loops.

llvm-svn: 275149

8 years agoFix libdeps in r275125. LTO tools require BitReader.
NAKAMURA Takumi [Tue, 12 Jul 2016 03:01:22 +0000 (03:01 +0000)]
Fix libdeps in r275125. LTO tools require BitReader.

llvm-svn: 275148

8 years agoPrint remarks from WholeProgramDevirt pass for each call site.
Ivan Krasin [Tue, 12 Jul 2016 02:38:37 +0000 (02:38 +0000)]
Print remarks from WholeProgramDevirt pass for each call site.

Summary:
It's useful to have some visibility about which call sites are devirtualized,
especially for debug purposes. Another use case is a regression test on the
application side (like, Chromium).

Reviewers: pcc

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

llvm-svn: 275145

8 years agollvm/test/CodeGen/AMDGPU/selected-stack-object.ll REQUIRES +Asserts, since it expects...
NAKAMURA Takumi [Tue, 12 Jul 2016 02:18:09 +0000 (02:18 +0000)]
llvm/test/CodeGen/AMDGPU/selected-stack-object.ll REQUIRES +Asserts, since it expects assertion failure.

llvm-svn: 275144

8 years ago[Kryo] Enable ZCZeroing feature
Haicheng Wu [Tue, 12 Jul 2016 02:04:01 +0000 (02:04 +0000)]
[Kryo] Enable ZCZeroing feature

This feature uses immediate #0 to zero a register.

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

llvm-svn: 275143

8 years agoHexagon: Avoid implicit iterator conversions, NFC
Duncan P. N. Exon Smith [Tue, 12 Jul 2016 01:55:32 +0000 (01:55 +0000)]
Hexagon: Avoid implicit iterator conversions, NFC

Avoid implicit iterator conversions from MachineInstrBundleIterator to
MachineInstr* in the Hexagon backend, mostly by preferring MachineInstr&
over MachineInstr* and switching to range-based for loops.

There's a long tail of API cleanup here, but I'm planning to leave the
rest to the Hexagon maintainers.  HexagonInstrInfo defines many of its
own predicates, and most of them still take MachineInstr*.  Some of
those actually check for nullptr, so I didn't feel comfortable changing
them to MachineInstr& en masse.

llvm-svn: 275142

8 years agoMips: Avoid implicit iterator conversions, NFC
Duncan P. N. Exon Smith [Tue, 12 Jul 2016 01:47:02 +0000 (01:47 +0000)]
Mips: Avoid implicit iterator conversions, NFC

Avoid implicit conversions from MachineInstrBundleIterator to
MachineInstr* in the Mips backend, mainly by preferring MachineInstr&
over MachineInstr* when a pointer isn't nullable and using range-based
for loops.

llvm-svn: 275141

8 years agoAdd LLVM build config for BuildAndIntegration.
Stephane Sezer [Tue, 12 Jul 2016 01:44:58 +0000 (01:44 +0000)]
Add LLVM build config for BuildAndIntegration.

Reviewers: tfiala, clayborg

Subscribers: lldb-commits

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

llvm-svn: 275140

8 years agoMake ThreadPlanStepInstruction's constructor public.
Stephane Sezer [Tue, 12 Jul 2016 01:43:46 +0000 (01:43 +0000)]
Make ThreadPlanStepInstruction's constructor public.

Summary:
Some thread plans have public contructors, some others have protected
constructors with friend classes. Not sure how these were determined,
but this thread plan is going to be required to implement trampoline
step-through on Windows.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 275139

8 years ago[X86,IR] Remove unnecessary or unused LLVMContext parameter from some of the X86...
Craig Topper [Tue, 12 Jul 2016 01:42:33 +0000 (01:42 +0000)]
[X86,IR] Remove unnecessary or unused LLVMContext parameter from some of the X86 intrinsic upgrade functions.

llvm-svn: 275138

8 years agoSystemZ: Avoid implicit iterator conversions, NFC
Duncan P. N. Exon Smith [Tue, 12 Jul 2016 01:39:01 +0000 (01:39 +0000)]
SystemZ: Avoid implicit iterator conversions, NFC

Avoid implicit conversions from MachineInstrBundleIterator to
MachineInstr* in the SystemZ backend, mainly by preferring MachineInstr&
over MachineInstr* and using range-based for loops.

llvm-svn: 275137

8 years agofix incorrect constant (from http://reviews.llvm.org/D22111)
Etienne Bergeron [Tue, 12 Jul 2016 01:30:58 +0000 (01:30 +0000)]
fix incorrect constant (from reviews.llvm.org/D22111)

llvm-svn: 275136

8 years agoTeach FastISel about thiscall (and, hence, about callee-pop).
Nico Weber [Tue, 12 Jul 2016 01:30:35 +0000 (01:30 +0000)]
Teach FastISel about thiscall (and, hence, about callee-pop).

http://reviews.llvm.org/D22115

llvm-svn: 275135

8 years agoApply local patches when building llvm on Mac.
Stephane Sezer [Tue, 12 Jul 2016 01:28:59 +0000 (01:28 +0000)]
Apply local patches when building llvm on Mac.

Summary:
This is already done when building for linux with the CMake build
system. This functionality disappeared recently when some of the build
scripts used by the xcode build system changed.

Reviewers: tfiala, clayborg

Subscribers: lldb-commits

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

llvm-svn: 275134

8 years agoAMDGPU: Cleanup pseudoinstructions
Matt Arsenault [Tue, 12 Jul 2016 00:23:17 +0000 (00:23 +0000)]
AMDGPU: Cleanup pseudoinstructions

llvm-svn: 275133

8 years agoAMDGPU: Fix missing scc def on control flow pseudos
Matt Arsenault [Tue, 12 Jul 2016 00:08:14 +0000 (00:08 +0000)]
AMDGPU: Fix missing scc def on control flow pseudos

These are all expanded to instructions that include an scc def.

llvm-svn: 275132

8 years agoAMDGPU: Enable trackLivenessAfterRegAlloc
Matt Arsenault [Mon, 11 Jul 2016 23:56:30 +0000 (23:56 +0000)]
AMDGPU: Enable trackLivenessAfterRegAlloc

This has caught a number of bugs.

llvm-svn: 275131

8 years agoDo not use bool in C header lto.h, use lto_bool_t instead
Mehdi Amini [Mon, 11 Jul 2016 23:55:01 +0000 (23:55 +0000)]
Do not use bool in C header lto.h, use lto_bool_t instead

llvm-svn: 275130

8 years agoAMDGPU: Remove superfluous string attributes from tests
Matt Arsenault [Mon, 11 Jul 2016 23:35:48 +0000 (23:35 +0000)]
AMDGPU: Remove superfluous string attributes from tests

Also fix v_mac.ll not testing right thing for fneg

llvm-svn: 275129

8 years agoCorrecting the previous fix for test submitted with r275115.
Wolfgang Pieb [Mon, 11 Jul 2016 23:27:19 +0000 (23:27 +0000)]
Correcting the previous fix for test submitted with r275115.

llvm-svn: 275128

8 years agoFix test submitted with r275115 (failed on ppc64 buildbots).
Wolfgang Pieb [Mon, 11 Jul 2016 23:20:28 +0000 (23:20 +0000)]
Fix test submitted with r275115 (failed on ppc64 buildbots).

llvm-svn: 275127

8 years agoAttempt to make buildbots happy.
George Burgess IV [Mon, 11 Jul 2016 23:18:32 +0000 (23:18 +0000)]
Attempt to make buildbots happy.

Woohoo, unused variable warnings in builds without asserts (as a result
of r275122).

llvm-svn: 275126

8 years agoAdd a libLTO API to query a memory buffer and check if it contains ObjC categories
Mehdi Amini [Mon, 11 Jul 2016 23:10:18 +0000 (23:10 +0000)]
Add a libLTO API to query a memory buffer and check if it contains ObjC categories

The linker supports a feature to force load an object from a static
archive if it defines an Objective-C category.
This API supports this feature by looking at every section in the
module to find if a category is defined in the module.

llvm-svn: 275125

8 years agomissing modifications for http://reviews.llvm.org/D21952
Etienne Bergeron [Mon, 11 Jul 2016 23:09:33 +0000 (23:09 +0000)]
missing modifications for reviews.llvm.org/D21952

llvm-svn: 275124

8 years ago[compiler-rt] Refactor the interception code on windows.
Etienne Bergeron [Mon, 11 Jul 2016 23:02:18 +0000 (23:02 +0000)]
[compiler-rt] Refactor the interception code on windows.

Summary:
This is a cleanup and refactoring of the interception code on windows

Enhancement:
  * Adding the support for 64-bits code
  * Adding several hooking technique:
    * Detour
    * JumpRedirect
    * HotPatch
    * Trampoline
  * Adding a trampoline memory pool (64-bits) and release the allocated memory in unittests

Cleanup:
  * Adding unittests for 64-bits hooking techniques
  * Enhancing the RoundUpInstruction by sharing common decoder

Reviewers: rnk

Subscribers: llvm-commits, wang0109, chrisha

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

llvm-svn: 275123

8 years ago[CFLAA] Simplify CFLGraphBuilder. NFC.
George Burgess IV [Mon, 11 Jul 2016 22:59:09 +0000 (22:59 +0000)]
[CFLAA] Simplify CFLGraphBuilder. NFC.

This patch simplifies the graph builder by encoding nodes as {Value,
Dereference Level} pairs. This lets us kill edge types, and allows us to
get rid of hacks in StratifiedSets (like addAttrsBelow/...). This
simplification also allows us to remove InstantiatedRelations and
InstantiatedAttrs.

Patch by Jia Chen.

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

llvm-svn: 275122

8 years ago[Coverage] Do not map regions from system headers
Vedant Kumar [Mon, 11 Jul 2016 22:57:46 +0000 (22:57 +0000)]
[Coverage] Do not map regions from system headers

Do not assign source regions located within system headers file ID's,
and do not construct counter mapping regions out of them.

This makes coverage reports less cluttered and less mysterious. E.g
using the "assert" macro doesn't cause assert.h to appear in reports,
and it no longer shows the "assertion failed" branch as an uncovered
region.

It also makes coverage mapping sections a bit smaller (e.g a 1%
reduction in a stage2 build of bin/llvm-as).

llvm-svn: 275121

8 years ago[Coverage] Move logic to skip decl's into a helper (NFC)
Vedant Kumar [Mon, 11 Jul 2016 22:57:44 +0000 (22:57 +0000)]
[Coverage] Move logic to skip decl's into a helper (NFC)

llvm-svn: 275120

8 years agoFixed a threading race condition where we could crash after calling Debugger::Termina...
Greg Clayton [Mon, 11 Jul 2016 22:50:18 +0000 (22:50 +0000)]
Fixed a threading race condition where we could crash after calling Debugger::Terminate().

The issue was we have two global variables: one that contains a DebuggerList pointer and one that contains a std::mutex pointer. These get initialized in Debugger::Initialize(), and everywhere that uses these does:

if (g_debugger_list_ptr && g_debugger_list_mutex_ptr)
{
    std::lock_guard<std::recursive_mutex> guard(*g_debugger_list_mutex_ptr);
    // do work while mutex is locked
}

Debugger::Terminate() was deleting and nulling out g_debugger_list_ptr which meant we had a race condition where someone might do the if statement and it evaluates to true, then another thread calls Debugger::Terminate() and deletes and nulls out g_debugger_list_ptr while holding the mutex, and another thread then locks the mutex and tries to use g_debugger_list_ptr. The fix is to just not delete and null out the g_debugger_list_ptr variable.

llvm-svn: 275119

8 years agoNew pass manager for LICM.
Dehao Chen [Mon, 11 Jul 2016 22:45:24 +0000 (22:45 +0000)]
New pass manager for LICM.

Summary: Port LICM to the new pass manager.

Reviewers: davidxl, silvas

Subscribers: silvas, davide, sanjoy, llvm-commits, mehdi_amini

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

llvm-svn: 275118

8 years agoCorrect ordering of loads/stores.
Alina Sbirlea [Mon, 11 Jul 2016 22:34:29 +0000 (22:34 +0000)]
Correct ordering of loads/stores.

Summary:
Aiming to correct the ordering of loads/stores. This patch changes the
insert point for loads to the position of the first load.
It updates the ordering method for loads to insert before, rather than after.

Before this patch the following sequence:
"load a[1], store a[1], store a[0], load a[2]"
Would incorrectly vectorize to "store a[0,1], load a[1,2]".
The correctness check was assuming the insertion point for loads is at
the position of the first load, when in practice it was at the last
load. An alternative fix would have been to invert the correctness check.
The current fix changes insert position but also requires reordering of
instructions before the vectorized load.

Updated testcases to reflect the changes.

Reviewers: tstellarAMD, llvm-commits, jlebar, arsenm

Subscribers: mzolotukhin

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

llvm-svn: 275117

8 years agoARM: validate immediate branch targets in AsmParser.
Tim Northover [Mon, 11 Jul 2016 22:29:37 +0000 (22:29 +0000)]
ARM: validate immediate branch targets in AsmParser.

Immediate branch targets aren't commonly used, but if they are we should make
sure they can actually be encoded. This means they must be divisible by 2 when
targeting Thumb mode, and by 4 when targeting ARM mode.

Also do a little naming cleanup while I was changing everything around anyway.

llvm-svn: 275116

8 years agoPrevent the creation of empty (forwarding) blocks resulting from nested ifs.
Wolfgang Pieb [Mon, 11 Jul 2016 22:22:23 +0000 (22:22 +0000)]
Prevent the creation of empty (forwarding) blocks resulting from nested ifs.

Summary:
Nested if statements can generate empty BBs whose terminator branches
unconditionally to its successor. These branches are not eliminated
to help generate better line number information in some cases, but there
is no reason to keep the empty blocks that result from nested ifs.

Reviewers: mehdi_amini, dblaikie, echristo

Subscribers: mehdi_amini, cfe-commits

Differential review: http://reviews.llvm.org/D11360

llvm-svn: 275115

8 years agoDon't compute modulus of hash if it is smaller than the bucket count.
Eric Fiselier [Mon, 11 Jul 2016 22:02:02 +0000 (22:02 +0000)]
Don't compute modulus of hash if it is smaller than the bucket count.

This cleans up a previous optimization attempt in hash, and results in
additional performance improvements over that previous attempt. Additionally
this new optimization does not hinder the power of 2 bucket count optimization.

llvm-svn: 275114

8 years agoAMDGPU: Treat texture gather instructions more like other MIMG instructions
Nicolai Haehnle [Mon, 11 Jul 2016 21:59:43 +0000 (21:59 +0000)]
AMDGPU: Treat texture gather instructions more like other MIMG instructions

Summary:
Setting MIMG to 0 has a bunch of unexpected side effects, including that
isVMEM returns false which leads to incorrect treatment in the hazard
recognizer. The reason I noticed it is that it also leads to incorrect
treatment in VGPR-to-SGPR copies, which is one cause of the referenced bug.

The only reason why MIMG was set to 0 is to signal the special handling of
dmasks, but that can be checked differently.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96877

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, kzhuravl, llvm-commits

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

llvm-svn: 275113

8 years agoremove empty lines
Etienne Bergeron [Mon, 11 Jul 2016 21:57:11 +0000 (21:57 +0000)]
remove empty lines

llvm-svn: 275112

8 years ago[compiler-rt] Fix VisualStudio virtual folders layout
Etienne Bergeron [Mon, 11 Jul 2016 21:51:56 +0000 (21:51 +0000)]
[compiler-rt] Fix VisualStudio virtual folders layout

Summary:
This patch is a refactoring of the way cmake 'targets' are grouped.
It won't affect non-UI cmake-generators.

Clang/LLVM are using a structured way to group targets which ease
navigation through Visual Studio UI. The Compiler-RT projects
differ from the way Clang/LLVM are grouping targets.

This patch doesn't contain behavior changes.

Reviewers: kubabrecka, rnk

Subscribers: wang0109, llvm-commits, kubabrecka, chrisha

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

llvm-svn: 275111

8 years agoRefactor the PDB writing to use a builder approach
Zachary Turner [Mon, 11 Jul 2016 21:45:26 +0000 (21:45 +0000)]
Refactor the PDB writing to use a builder approach

llvm-svn: 275110

8 years ago[pdb] Add a pdb2yaml option to not dump file headers.
Zachary Turner [Mon, 11 Jul 2016 21:45:09 +0000 (21:45 +0000)]
[pdb] Add a pdb2yaml option to not dump file headers.

This will be useful once we start adding the ability to dump type
records and symbol records, since it will allow us to generate
mergeable information instead of information that specifies an
entire file.

llvm-svn: 275109

8 years agoAMDGPU: fix local stack slot allocation bugs
Nicolai Haehnle [Mon, 11 Jul 2016 21:44:40 +0000 (21:44 +0000)]
AMDGPU: fix local stack slot allocation bugs

Summary:
The main bug fix here is using the 32-bit encoding of V_ADD_I32 in
materializeFrameBaseRegister and resolveFrameIndex, so that arbitrary
immediates work.

The second part is that we may now require the SegmentWaveByteOffset
even when there are initially no stack objects and VGPR spilling isn't
enabled, for stack slots that are allocated later. This means that some
bits become effectively dead and can be cleaned up.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96602
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits, kzhuravl

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

llvm-svn: 275108

8 years ago[asan] Add exception handler to map memory on demand on Win64.
Etienne Bergeron [Mon, 11 Jul 2016 21:40:59 +0000 (21:40 +0000)]
[asan] Add exception handler to map memory on demand on Win64.
Memory will be committed on demand when exception happens while accessing
shadow memeory region.

Patch by: Wei Wang
Differential Revision: http://reviews.llvm.org/D21942

llvm-svn: 275107

8 years ago[X86] Make some cast costs more precise
Michael Kuperstein [Mon, 11 Jul 2016 21:39:44 +0000 (21:39 +0000)]
[X86] Make some cast costs more precise

Make some AVX and AVX512 cast costs more precise.
Based on part of a patch by Elena Demikhovsky (D15604).

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

llvm-svn: 275106

8 years agoAlways use the allocator to construct/destruct elements of a deque/vector. Fixes...
Marshall Clow [Mon, 11 Jul 2016 21:38:08 +0000 (21:38 +0000)]
Always use the allocator to construct/destruct elements of a deque/vector. Fixes PR#28412. Thanks to Jonathan Wakely for the report.

llvm-svn: 275105