7 years agoInstroduce a template file to define InstrPGO core data structures.
Xinliang David Li [Fri, 16 Oct 2015 23:17:34 +0000 (23:17 +0000)]
Instroduce a template file to define InstrPGO core data structures.

Changing PGO data format layout can be a pain. Many different places need
to be touched and kept in sync. Failing to do so usually results in errors
very time consuming to debug.

This file is intended to be the master file that defines the layout of the
core runtime data structures. Currently only two structure is covered: Per
function ProfData structure and the function record structure used in
coverage mapping.

No client code has been made yet, so this commit is NFC.

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

7 years ago[CMake] Cleaning up and generalizing the LLVMInstallSymlink script so that it can...
Chris Bieneman [Fri, 16 Oct 2015 23:17:13 +0000 (23:17 +0000)]
[CMake] Cleaning up and generalizing the LLVMInstallSymlink script so that it can be used for libraries too.

In order to resolve PR25059, we're going to need to be able to generate symlinks to libraries manually, so I need this code to be reusable.

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

7 years ago[libFuzzer] print a stack trace on timeout
Kostya Serebryany [Fri, 16 Oct 2015 23:04:31 +0000 (23:04 +0000)]
[libFuzzer] print a stack trace on timeout

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

7 years agoRevert "This is a follow-up to the discussion in D12882."
Benjamin Kramer [Fri, 16 Oct 2015 23:00:29 +0000 (23:00 +0000)]
Revert "This is a follow-up to the discussion in D12882."

Breaks clang selfhost, see PR25222. This reverts commits r250527 and r250528.

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

7 years ago[libFuzzer] reduce the size of artifacts printed on the screen
Kostya Serebryany [Fri, 16 Oct 2015 22:47:20 +0000 (22:47 +0000)]
[libFuzzer] reduce the size of artifacts printed on the screen

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

7 years ago[libFuzzer] When -test_single_input crashes the test it is not necessary to write...
Kostya Serebryany [Fri, 16 Oct 2015 22:41:47 +0000 (22:41 +0000)]
[libFuzzer] When -test_single_input crashes the test it is not necessary to write crash-file because input is already known to the user. Patch by Mike Aizatsky

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

7 years ago[x86] promote 'add nsw' to a wider type to allow more combines
Sanjay Patel [Fri, 16 Oct 2015 22:14:12 +0000 (22:14 +0000)]
[x86] promote 'add nsw' to a wider type to allow more combines

The motivation for this patch starts with PR20134:

void foo(int *a, int i) {
  a[i] = a[i+1] + a[i+2];

It seems better to produce this (14 bytes):

movslq %esi, %rsi
movl 0x4(%rdi,%rsi,4), %eax
addl 0x8(%rdi,%rsi,4), %eax
movl %eax, (%rdi,%rsi,4)

Rather than this (22 bytes):

leal 0x1(%rsi), %eax
leal 0x2(%rsi), %ecx
movslq %ecx, %rcx
movl (%rdi,%rcx,4), %ecx
addl (%rdi,%rax,4), %ecx
movslq %esi, %rax
movl %ecx, (%rdi,%rax,4)

The most basic problem (the first test case in the patch combines constants) should also be fixed in InstCombine,
but it gets more complicated after that because we need to consider architecture and micro-architecture. For
example, AArch64 may not see any benefit from the more general transform because the ISA solves the sexting in
hardware. Some x86 chips may not want to replace 2 ADD insts with 1 LEA, and there's an attribute for that:
FeatureSlowLEA. But I suspect that doesn't go far enough or maybe it's not getting used when it should; I'm
also not sure if FeatureSlowLEA should also mean "slow complex addressing mode".

I see no perf differences on test-suite with this change running on AMD Jaguar, but I see small code size
improvements when building clang and the LLVM tools with the patched compiler.

A more general solution to the sext(add nsw(x, C)) problem that works for multiple targets is available
in CodeGenPrepare, but it may take quite a bit more work to get that to fire on all of the test cases that
this patch takes care of.

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

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

7 years agoMC: Don't crash after issuing a diagnostic.
Jim Grosbach [Fri, 16 Oct 2015 22:07:59 +0000 (22:07 +0000)]
MC: Don't crash after issuing a diagnostic.

Crashing is bad, m'kay? Fixing a 4 year old bug of my own creation.
Adding the testcase now which I should have added then which would have
long since caught this.

The problem is that printMessage() will display the diagnostic but not
set HadError to true, resulting in the assembler continuing on its way
and trying to create relocations for things that may not allow them or
otherwise get itself into trouble. Using the Error() helper function
here rather than calling printMessage() directly resolves this.


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

7 years ago[WinEH] Fix CatchRetSuccessorColorMap accounting
Joseph Tremoulet [Fri, 16 Oct 2015 21:22:54 +0000 (21:22 +0000)]
[WinEH] Fix CatchRetSuccessorColorMap accounting

We now use the block for the catchpad itself, rather than its normal
successor, as the funclet entry.
Putting the normal successor in the map leads downstream funclet
membership computations to erroneous results.

Reviewers: majnemer, rnk

Subscribers: rnk, llvm-commits

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

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

7 years agoFix assertion failure with fp128 to unsigned i64 conversion
Andrew Kaylor [Fri, 16 Oct 2015 20:39:20 +0000 (20:39 +0000)]
Fix assertion failure with fp128 to unsigned i64 conversion

Patch by Mitch Bodart

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

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

7 years ago[Hexagon] Split double registers
Krzysztof Parzyszek [Fri, 16 Oct 2015 20:38:54 +0000 (20:38 +0000)]
[Hexagon] Split double registers

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

7 years ago[WinEH] Remove dead code/includes from WinEHPrepare
David Majnemer [Fri, 16 Oct 2015 19:59:52 +0000 (19:59 +0000)]
[WinEH] Remove dead code/includes from WinEHPrepare

No functionality change is intended.

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

7 years ago[Hexagon] Delete lib/Target/Hexagon/HexagonRemoveSZExtArgs.cpp
Krzysztof Parzyszek [Fri, 16 Oct 2015 19:51:53 +0000 (19:51 +0000)]
[Hexagon] Delete lib/Target/Hexagon/HexagonRemoveSZExtArgs.cpp

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

7 years ago[Hexagon] Merge adjacent stores
Krzysztof Parzyszek [Fri, 16 Oct 2015 19:43:56 +0000 (19:43 +0000)]
[Hexagon] Merge adjacent stores

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

7 years agoSample profiles - Re-arrange binary format to emit head samples only on top functions.
Diego Novillo [Fri, 16 Oct 2015 18:54:35 +0000 (18:54 +0000)]
Sample profiles - Re-arrange binary format to emit head samples only on top functions.

The number of samples collected at the head of a function only make
sense for top-level functions (i.e., those actually called as opposed to
being inlined inside another).

Head samples essentially count the time spent inside the function's
prologue.  This clearly doesn't make sense for inlined functions, so we
were always emitting 0 in those.

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

7 years agoWebAssembly: fix load/store syntax
JF Bastien [Fri, 16 Oct 2015 18:24:42 +0000 (18:24 +0000)]
WebAssembly: fix load/store syntax

Summary: The syntax has changed a bit recently.

Reviewers: binji

Subscribers: llvm-commits, jfb, sunfish, dschuff

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

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

7 years ago[WinEH] Fix endpad coloring/numbering
Joseph Tremoulet [Fri, 16 Oct 2015 18:08:16 +0000 (18:08 +0000)]
[WinEH] Fix endpad coloring/numbering

When a cleanup's cleanupendpad or cleanupret targets a catchendpad, stop
trying to propagate the cleanup's parent's color to the catchendpad, since
what's needed is the cleanup's grandparent's color and the catchendpad
will get that color from the catchpad linkage already.  We already had
this exclusion for invokes, but were missing it for

Also add a missing line that tags cleanupendpads' states in the
EHPadStateMap, without with lowering invokes that target cleanupendpads
which unwind to other handlers (and so don't have the -1 state) will fail.

This fixes the reduced IR repro in PR25163.

Reviewers: majnemer, andrew.w.kaylor, rnk

Subscribers: llvm-commits

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

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

7 years agoFix typo, NFC.
Yaron Keren [Fri, 16 Oct 2015 17:50:47 +0000 (17:50 +0000)]
Fix typo, NFC.

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

7 years agomove test case to x86 directory because it specifies an x86 target
Sanjay Patel [Fri, 16 Oct 2015 17:18:07 +0000 (17:18 +0000)]
move test case to x86 directory because it specifies an x86 target

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

7 years agoThis is a follow-up to the discussion in D12882.
Sanjay Patel [Fri, 16 Oct 2015 16:54:30 +0000 (16:54 +0000)]
This is a follow-up to the discussion in D12882.

Ideally, we would like SimplifyCFG to be able to form select instructions even when the operands
are expensive (as defined by the TTI cost model) because that may expose further optimizations.
However, we would then like a later pass like CodeGenPrepare to undo that transformation if the
target would likely benefit from not speculatively executing an expensive op (this patch).

Once we have this safety mechanism in place, we can adjust SimplifyCFG to restore its
select-formation behavior that changed with r248439.

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

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

7 years agoWebAssembly: relooper analysis pass
JF Bastien [Fri, 16 Oct 2015 16:35:49 +0000 (16:35 +0000)]
WebAssembly: relooper analysis pass

Summary: Make the relooper an analysis pass, to convert CFG to AST.

Reviewers: sunfish

Subscribers: jfb, dschuff

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

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

7 years ago[AArch64] Implement vector splitting on UADDV.
Charlie Turner [Fri, 16 Oct 2015 15:38:25 +0000 (15:38 +0000)]
[AArch64] Implement vector splitting on UADDV.

Summary: Fixes PR25056.

Reviewers: mcrosier, junbuml, jmolloy

Subscribers: aemerson, rengolin, llvm-commits

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

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

7 years agoSample Profiling - Remove useless asserts. NFC.
Diego Novillo [Fri, 16 Oct 2015 13:54:52 +0000 (13:54 +0000)]
Sample Profiling - Remove useless asserts. NFC.

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

7 years agoCommited two test files which are forgotten during commit of patch for http://reviews...
Zlatko Buljan [Fri, 16 Oct 2015 13:03:10 +0000 (13:03 +0000)]
Commited two test files which are forgotten during commit of patch for reviews.llvm.org/D13376

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

7 years ago[mips][microMIPS] Implement LB, LBE, LBU and LBUE instructions
Hrvoje Varga [Fri, 16 Oct 2015 12:24:58 +0000 (12:24 +0000)]
[mips][microMIPS] Implement LB, LBE, LBU and LBUE instructions
Differential Revision: http://reviews.llvm.org/D11633

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

7 years agoFix path::home_directory() unit test.
Pawel Bylica [Fri, 16 Oct 2015 10:11:07 +0000 (10:11 +0000)]
Fix path::home_directory() unit test.

It turns out that constructing std::string from null pointer is not the very best idea.

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

7 years agoSupportTests::HomeDirectory: Don't try tests when $HOME is undefined.
NAKAMURA Takumi [Fri, 16 Oct 2015 09:40:01 +0000 (09:40 +0000)]
SupportTests::HomeDirectory: Don't try tests when $HOME is undefined.

Lit sanitizes env vars. $HOME is not exported in Lit tests.

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

7 years agoReformat.
NAKAMURA Takumi [Fri, 16 Oct 2015 09:38:49 +0000 (09:38 +0000)]

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

7 years agoUse Windows Vista API to get the user's home directory
Pawel Bylica [Fri, 16 Oct 2015 09:08:59 +0000 (09:08 +0000)]
Use Windows Vista API to get the user's home directory

Summary: This patch replaces usage of deprecated SHGetFolderPathW with SHGetKnownFolderPath. The usage of SHGetKnownFolderPath is wrapped to allow queries for other "known" folders in the near future.

Reviewers: aaron.ballman, gbedwell

Subscribers: chapuni, llvm-commits

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

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

7 years ago[X86] Add fxsr feature flag for fxsave/fxrestore instructions.
Craig Topper [Fri, 16 Oct 2015 06:03:09 +0000 (06:03 +0000)]
[X86] Add fxsr feature flag for fxsave/fxrestore instructions.

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

7 years agoInitial migration of AVR backend
Dylan McKay [Fri, 16 Oct 2015 03:10:30 +0000 (03:10 +0000)]
Initial migration of AVR backend

This patch adds the underlying infrastructure for an AVR backend to be included into LLVM. It is the first of a series of patches aimed at moving the out-of-tree AVR backend into the tree.

It consists of adding a new`Triple` target 'avr'.

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

7 years ago[RS4GC] Dont' propagate call attrs related to patchable statepoints
Sanjoy Das [Fri, 16 Oct 2015 02:41:23 +0000 (02:41 +0000)]
[RS4GC] Dont' propagate call attrs related to patchable statepoints

The `"statepoint-id"` and `"statepoint-num-patch-bytes"` attributes are
used solely to determine properties of the `gc.statepoint` being
created.  Once the `gc.statepoint` is in place, these should be removed.

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

7 years ago[RS4GC] Bring legalizeCallAttributes up to LLVM coding style; NFC
Sanjoy Das [Fri, 16 Oct 2015 02:41:11 +0000 (02:41 +0000)]
[RS4GC] Bring legalizeCallAttributes up to LLVM coding style; NFC

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

7 years ago[RS4GC] Use "deopt" operand bundles
Sanjoy Das [Fri, 16 Oct 2015 02:41:00 +0000 (02:41 +0000)]
[RS4GC] Use "deopt" operand bundles

This is a step towards using operand bundles to carry deopt state till
RewriteStatepointsForGC.  The change adds a flag to
RewriteStatepointsForGC that teaches it to pick up deopt state from a
`"deopt"` operand bundle attached to the `call` or `invoke` it is

The command line flag added, `-rs4gc-use-deopt-bundles`, will only exist
for a short while.  Once we are able to pipe deopt bundle state through
the full optimization pipeline without problems, we will "constant fold"
`-rs4gc-use-deopt-bundles` to `true`.

Reviewers: swaroop.sridhar, reames

Subscribers: llvm-commits, sanjoy

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

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

7 years ago[IndVars] Rename getExtend; NFC
Sanjoy Das [Fri, 16 Oct 2015 01:00:50 +0000 (01:00 +0000)]
[IndVars] Rename getExtend; NFC

Rename `IndVarSimplify::getExtend` to `IndVarSimplify::createExtendInst`
to make it obvious that it creates `llvm::Instruction` s.

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

7 years ago[IndVars] Have `cloneArithmeticIVUser` guess better
Sanjoy Das [Fri, 16 Oct 2015 01:00:47 +0000 (01:00 +0000)]
[IndVars] Have `cloneArithmeticIVUser` guess better

`cloneArithmeticIVUser` currently trips over expression like `add %iv,
-1` when `%iv` is being zero extended -- it tries to construct the
widened use as `add %iv.zext, zext(-1)` and (correctly) fails to prove
equivalence to `zext(add %iv, -1)` (here the SCEV for `%iv` is

This change teaches `IndVars` to try sign extending the non-IV operand
if that makes the newly constructed IV use equivalent to the widened
narrow IV use.

Reviewers: atrick, hfinkel, reames

Subscribers: sanjoy, llvm-commits

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

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

7 years ago[IndVars] Extract out a few local variables; NFC
Sanjoy Das [Fri, 16 Oct 2015 01:00:44 +0000 (01:00 +0000)]
[IndVars] Extract out a few local variables; NFC

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

7 years ago[IndVars] Split `WidenIV::cloneIVUser`; NFC
Sanjoy Das [Fri, 16 Oct 2015 01:00:39 +0000 (01:00 +0000)]
[IndVars] Split `WidenIV::cloneIVUser`; NFC

This NFC splitting is intended to make a later diff easier to follow.
It just tail duplicates `cloneIVUser` into `cloneArithmeticIVUser` and

Reviewers: atrick, hfinkel, reames

Subscribers: llvm-commits

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

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

7 years agoWebAssembly: update syntax
JF Bastien [Fri, 16 Oct 2015 00:53:49 +0000 (00:53 +0000)]
WebAssembly: update syntax

Follow the same syntax as for the spec repo. Both have evolved slightly
independently and need to converge again.

This, along with wasmate changes, allows me to do the following:

  echo "int add(int a, int b) { return a + b; }" > add.c
  ./out/bin/clang -O2 -S --target=wasm32-unknown-unknown add.c -o add.wack
  ./experimental/prototype-wasmate/wasmate.py add.wack > add.wast
  ./sexpr-wasm-prototype/out/sexpr-wasm add.wast -o add.wasm
  ./sexpr-wasm-prototype/third_party/v8-native-prototype/v8/v8/out/Release/d8 -e "print(WASM.instantiateModule(readbuffer('add.wasm'), {print:print}).add(42, 1337));"

As you'd expect, the d8 shell prints out the right value.

Reviewers: sunfish

Subscribers: jfb, llvm-commits, dschuff

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

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

7 years agoAdd emacs c++ mode hint.
Lang Hames [Fri, 16 Oct 2015 00:44:01 +0000 (00:44 +0000)]
Add emacs c++ mode hint.

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

7 years ago[llvm-readobj/ELF] Dump DT_VERDEF/DT_VERDEFNUM correctly.
Davide Italiano [Thu, 15 Oct 2015 22:04:55 +0000 (22:04 +0000)]
[llvm-readobj/ELF] Dump DT_VERDEF/DT_VERDEFNUM correctly.

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

7 years agoRevert "[safestack] Fast access to the unsafe stack pointer on AArch64/Android."
Evgeniy Stepanov [Thu, 15 Oct 2015 21:26:49 +0000 (21:26 +0000)]
Revert "[safestack] Fast access to the unsafe stack pointer on AArch64/Android."

Breaks the hexagon buildbot.

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

7 years agoReplace a forward declaration with an #include.
Adrian Prantl [Thu, 15 Oct 2015 20:58:55 +0000 (20:58 +0000)]
Replace a forward declaration with an #include.
When building with modules the forward-declared inner class
DebugLocStream::ListBuilder causes clang to fall over.

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

7 years ago[safestack] Fast access to the unsafe stack pointer on AArch64/Android.
Evgeniy Stepanov [Thu, 15 Oct 2015 20:50:16 +0000 (20:50 +0000)]
[safestack] Fast access to the unsafe stack pointer on AArch64/Android.

Android libc provides a fixed TLS slot for the unsafe stack pointer,
and this change implements direct access to that slot on AArch64 via
__builtin_thread_pointer() + offset.

This change also moves more code into TargetLowering and its
target-specific subclasses to get rid of target-specific codegen
in SafeStackPass.

This change does not touch the ARM backend because ARM lowers
builting_thread_pointer as aeabi_read_tp, which is not available
on Android.

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

7 years ago[CMake] Adding LLVM_CREATE_XCODE_TOOLCHAIN to the CMake documentation page.
Chris Bieneman [Thu, 15 Oct 2015 20:12:08 +0000 (20:12 +0000)]
[CMake] Adding LLVM_CREATE_XCODE_TOOLCHAIN to the CMake documentation page.

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

7 years ago[CMake] [Darwin] Add support for generating Xcode-compatible toolchains that xcodebui...
Chris Bieneman [Thu, 15 Oct 2015 20:09:01 +0000 (20:09 +0000)]
[CMake] [Darwin] Add support for generating Xcode-compatible toolchains that xcodebuild and xcrun can search

Sometimes you want to install a custom compiler and use it like the system compiler without overriding the system compiler. This patch lets you create xctoolchains that the darwin command line tools can use.

To use this patch set LLVM_CREATE_XCODE_TOOLCHAIN=On in your CMake invocation and build the `install-code-toolchain` target.

After installation you can set the envar EXTERNAL_TOOLCHAINS_DIR to your installed Toolchains directory, and the TOOLCHAINS envar to the toolchain identifier (ex org.llvm.3.8.0svn). This will then cause /usr/bin/clang to call your newly installed clang.

Reviewers: Bigcheese, bogner

Subscribers: tobiasfar, llvm-commits

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

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

7 years agoAdd a missing include of cstddef needed for size_t.
Adrian Prantl [Thu, 15 Oct 2015 19:41:54 +0000 (19:41 +0000)]
Add a missing include of cstddef needed for size_t.

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

7 years agox86: preserve flags when folding atomic operations
JF Bastien [Thu, 15 Oct 2015 18:24:52 +0000 (18:24 +0000)]
x86: preserve flags when folding atomic operations

D4796 taught LLVM to fold some atomic integer operations into a single
instruction. The pattern was unaware that the instructions clobbered
flags. I fixed some of this issue in D13680 but had missed INC/DEC.

This patch adds the missing EFLAGS definition.

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

7 years agodocs: Stop using DEBUG() without DEBUG_TYPE in the ProgrammersManual
Justin Bogner [Thu, 15 Oct 2015 18:17:44 +0000 (18:17 +0000)]
docs: Stop using DEBUG() without DEBUG_TYPE in the ProgrammersManual

The DEBUG() macro has required that a DEBUG_TYPE be set since r206822.
Update the programmers manual to reflect that, and also update the
wording to point out that DEBUG_TYPE should be defined after #includes.

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

7 years ago[SelectionDAG] Remove dead code. NFC.
Benjamin Kramer [Thu, 15 Oct 2015 17:54:06 +0000 (17:54 +0000)]
[SelectionDAG] Remove dead code. NFC.

Carefully selected parts without deleting graph stuff and dumping methods.

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

7 years ago[AsmPrinter] Prune dead code. NFC.
Benjamin Kramer [Thu, 15 Oct 2015 17:16:32 +0000 (17:16 +0000)]
[AsmPrinter] Prune dead code. NFC.

I left all (dead) print and dump methods in place.

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

7 years agoChange test to use FileCheck rather than grep.
Kevin B. Smith [Thu, 15 Oct 2015 17:05:12 +0000 (17:05 +0000)]
Change test to use FileCheck rather than grep.
Differential Revision: http://reviews.llvm.org/D13751

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

7 years agoRevert 250343 and 250344
Philip Reames [Thu, 15 Oct 2015 16:51:00 +0000 (16:51 +0000)]
Revert 250343 and 250344

Turns out this approach is buggy.  In discussion about follow on work, Sanjoy pointed out that we could be subject to circular logic problems.

 if (i u< L) leave()
 if ((i + 1) u< L) leave()
 print(a[i] + a[i+1])

If we know that L is less than UINT_MAX, we could possible prove (in a control dependent way) that i + 1 does not overflow.  This gives us:
 if (i u< L) leave()
 if ((i +nuw 1) u< L) leave()
 print(a[i] + a[i+1])

If we now do the transform this patch proposed, we end up with:
 if ((i +nuw 1) u< L) leave_appropriately()
 print(a[i] + a[i+1])

That would be a miscompile when i==-1.  The problem here is that the control dependent nuw bits got used to prove something about the first condition.  That's obviously invalid.

This won't happen today, but since I plan to enhance LVI/CVP with exactly that transform at some point in the not too distant future...

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

7 years agox86 FP atomic codegen: don't drop globals, stack
JF Bastien [Thu, 15 Oct 2015 16:46:29 +0000 (16:46 +0000)]
x86 FP atomic codegen: don't drop globals, stack

x86 codegen is clever about generating good code for relaxed
floating-point operations, but it was being silly when globals and
immediates were involved, forgetting where the global was and
loading/storing from/to the wrong place. The same applied to hard-coded
address immediates.

Don't let it forget about the displacement.

This fixes https://llvm.org/bugs/show_bug.cgi?id=25171

A very similar bug when doing floating-points atomics to the stack is
also fixed by this patch.

This fixes https://llvm.org/bugs/show_bug.cgi?id=25144

Reviewers: pete

Subscribers: llvm-commits, majnemer, rsmith

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

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

7 years agoSample Profiles - Adjust integer types. Mostly NFC.
Diego Novillo [Thu, 15 Oct 2015 16:36:21 +0000 (16:36 +0000)]
Sample Profiles - Adjust integer types. Mostly NFC.

This adjusts all integers in the reader/writer to reflect the types
stored on profile files. They should all be unsigned 32-bit or 64-bit
values. Changed all associated internal types to be uint32_t or

The only place that needed some adjustments is in the sample profile
transformation. Altough the weight read from the profile are 64-bit
values, the internal API for branch weights only accepts 32-bit values.
The pass now saturates weights that overflow uint32_t.

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

7 years agoPrevent assertion with "llc -debug" and anonymous symbols.
Tim Northover [Thu, 15 Oct 2015 16:18:27 +0000 (16:18 +0000)]
Prevent assertion with "llc -debug" and anonymous symbols.

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

7 years agoLit: Rework r249161; Move RLIMIT_NPROC to main.py.
NAKAMURA Takumi [Thu, 15 Oct 2015 15:37:13 +0000 (15:37 +0000)]
Lit: Rework r249161; Move RLIMIT_NPROC to main.py.

The message "raised the process limit..." prevented the progress bar.

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

7 years ago[ScalarOpts] Remove dead code.
Benjamin Kramer [Thu, 15 Oct 2015 15:08:58 +0000 (15:08 +0000)]
[ScalarOpts] Remove dead code.

Does not touch debug dumpers. NFC.

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

7 years agoRecommit r250345, it was reverted in r250366 to investigate a bot failure.
Manman Ren [Thu, 15 Oct 2015 14:59:40 +0000 (14:59 +0000)]
Recommit r250345, it was reverted in r250366 to investigate a bot failure.

Our internal bot is still red after r250366.

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

7 years ago[mips][ias] Implement ulh macro.
Daniel Sanders [Thu, 15 Oct 2015 14:52:58 +0000 (14:52 +0000)]
[mips][ias] Implement ulh macro.

This macro is needed to prevent test/CodeGen/Mips/2008-08-01-AsmInline.ll from
failing after the integrated assembler is enabled by default.

Reviewers: vkalintiris

Subscribers: llvm-commits, dsanders

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

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

7 years agoRequire Windows API of version 6.1 (Windows 7).
Pawel Bylica [Thu, 15 Oct 2015 14:50:31 +0000 (14:50 +0000)]
Require Windows API of version 6.1 (Windows 7).

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

7 years ago[NVPTX] Remove dead code.
Benjamin Kramer [Thu, 15 Oct 2015 14:45:41 +0000 (14:45 +0000)]
[NVPTX] Remove dead code.

I left helpers that look useful for debugging alone. NFC.

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

7 years ago[mips][mips16] MIPS16 is not a CPU/Architecture but is an ASE.
Daniel Sanders [Thu, 15 Oct 2015 14:34:23 +0000 (14:34 +0000)]
[mips][mips16] MIPS16 is not a CPU/Architecture but is an ASE.

The -mcpu=mips16 option caused the Integrated Assembler to crash because
it couldn't figure out the architecture revision number to write to the
.MIPS.abiflags section. This CPU definition has been removed because, like
microMIPS, MIPS16 is an ASE to a base architecture.

Reviewers: vkalintiris

Subscribers: rkotler, llvm-commits, dsanders

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

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

7 years ago[X86] Rip out orphaned method declarations and other dead code. NFC.
Benjamin Kramer [Thu, 15 Oct 2015 14:09:59 +0000 (14:09 +0000)]
[X86] Rip out orphaned method declarations and other dead code. NFC.

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

7 years ago[DebugInfo] Remove dead forwarding accessors. NFC.
Benjamin Kramer [Thu, 15 Oct 2015 13:56:02 +0000 (13:56 +0000)]
[DebugInfo] Remove dead forwarding accessors. NFC.

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

7 years agoSilencing a -Wtype-limits warning; an unsigned value will always be >= 0; NFC.
Aaron Ballman [Thu, 15 Oct 2015 13:55:43 +0000 (13:55 +0000)]
Silencing a -Wtype-limits warning; an unsigned value will always be >= 0; NFC.

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

7 years agoAVX512: Implemented DAG lowering for shuff62x2/shufi62x2 instructions ( shuffle packe...
Igor Breger [Thu, 15 Oct 2015 13:29:07 +0000 (13:29 +0000)]
AVX512: Implemented DAG lowering for shuff62x2/shufi62x2 instructions ( shuffle packed values at 128-bit granularity )

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

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

7 years ago[CMake] check-llvm requires llvm-pdbdump.
NAKAMURA Takumi [Thu, 15 Oct 2015 13:22:38 +0000 (13:22 +0000)]
[CMake] check-llvm requires llvm-pdbdump.

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

7 years agoAVX512: Implemented encoding and intrinsics for vpternlogd/q.
Igor Breger [Thu, 15 Oct 2015 12:33:24 +0000 (12:33 +0000)]
AVX512: Implemented encoding and intrinsics for vpternlogd/q.

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

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

7 years agoAVX-512: Fixed a bug in shuffle lowering 32-bit mode
Elena Demikhovsky [Thu, 15 Oct 2015 11:35:33 +0000 (11:35 +0000)]
AVX-512: Fixed a bug in shuffle lowering 32-bit mode

AVX-512 bit shuffle fails on 32 bit since we create a vector of 64-bit constants.
I split 8x64-bit const vector to 16x32 on 32-bit mode.

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

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

7 years ago[x86] Merge test pr24562.ll into x86-fold-pshufb.ll. NFC.
Andrea Di Biagio [Thu, 15 Oct 2015 09:54:25 +0000 (09:54 +0000)]
[x86] Merge test pr24562.ll into x86-fold-pshufb.ll. NFC.

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

7 years agoMake windows.h less evil.
Benjamin Kramer [Thu, 15 Oct 2015 09:38:45 +0000 (09:38 +0000)]
Make windows.h less evil.

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

7 years ago[llvm-pdbdump] Remove oddly placed parens that MSVC doesn't like
Benjamin Kramer [Thu, 15 Oct 2015 09:32:54 +0000 (09:32 +0000)]
[llvm-pdbdump] Remove oddly placed parens that MSVC doesn't like

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

7 years agoDon't pretend AMDGPU backend knows how to custom-lower UDIVREM for vector types;...
Artyom Skrobov [Thu, 15 Oct 2015 09:18:47 +0000 (09:18 +0000)]
Don't pretend AMDGPU backend knows how to custom-lower UDIVREM for vector types; it can't

Reviewers: arsenm, jvesely, tstellarAMD

Subscribers: arsenm, llvm-commits

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

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

7 years agoSpeculatively unbreak Windows build
David Majnemer [Thu, 15 Oct 2015 09:17:15 +0000 (09:17 +0000)]
Speculatively unbreak Windows build

<windows.h> defines macros named min and max in conflict with
<algorithm>.  Prevent macro expansion by wrapping std::min in

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

7 years ago[mips][microMIPS] Implement DPA.W.PH, DPAQ_S.W.PH, DPAQ_SA.L.W, DPAQX_S.W.PH, DPAQX_S...
Zlatko Buljan [Thu, 15 Oct 2015 08:59:45 +0000 (08:59 +0000)]
[mips][microMIPS] Implement DPA.W.PH, DPAQ_S.W.PH, DPAQ_SA.L.W, DPAQX_S.W.PH, DPAQX_SA.W.PH, DPAU.H.QBL, DPAU.H.QBR and DPAX.W.PH instructions
Differential Revision: http://reviews.llvm.org/D13376

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

7 years ago[mips][microMIPS] Implement BREAK16, LI16, MOVE16, SDBBP16, SUBU16 and XOR16 instructions
Hrvoje Varga [Thu, 15 Oct 2015 08:39:07 +0000 (08:39 +0000)]
[mips][microMIPS] Implement BREAK16, LI16, MOVE16, SDBBP16, SUBU16 and XOR16 instructions
Differential Revision: http://reviews.llvm.org/D11292#inline-103143

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

7 years ago[mips][microMIPS] Implement LLE and SCE instructions
Hrvoje Varga [Thu, 15 Oct 2015 08:11:50 +0000 (08:11 +0000)]
[mips][microMIPS] Implement LLE and SCE instructions
Differential Revision: http://reviews.llvm.org/D11630

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

7 years ago[mips][microMIPS] Implement LWLE, LWRE, SWLE and SWRE instructions
Hrvoje Varga [Thu, 15 Oct 2015 07:23:06 +0000 (07:23 +0000)]
[mips][microMIPS] Implement LWLE, LWRE, SWLE and SWRE instructions
Differential Revision: http://reviews.llvm.org/D11631

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

7 years ago[RuntimeDyld] Drop the '.s' suffix off the COFF test case - the MIPS bot started
Lang Hames [Thu, 15 Oct 2015 07:16:40 +0000 (07:16 +0000)]
[RuntimeDyld] Drop the '.s' suffix off the COFF test case - the MIPS bot started
failing when the suffix was added.

I assume the lack of a '.s' suffix means that the test case just wasn't running
before, and it has never worked on MIPS. I'll investigate that tomorrow.

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

7 years agoUpdate for llvm API change.
Eric Christopher [Thu, 15 Oct 2015 07:01:16 +0000 (07:01 +0000)]
Update for llvm API change.

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

7 years agoRemove DIFile from createSubroutineType.
Eric Christopher [Thu, 15 Oct 2015 06:56:10 +0000 (06:56 +0000)]
Remove DIFile from createSubroutineType.

Patch by Amaury Sechet with a small modification by me.

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

7 years ago[RuntimeDyld] Don't try to get the contents of sections that don't have any
Lang Hames [Thu, 15 Oct 2015 06:41:45 +0000 (06:41 +0000)]
[RuntimeDyld] Don't try to get the contents of sections that don't have any
(e.g. bss sections).

MachO and ELF have been silently letting this pass, but COFFObjectFile contains
an assertion to catch this kind of (ab)use of the getSectionContents, and this
was causing the JIT to crash on COFF objects with BSS sections. This patch
should fix that.

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

7 years ago[MachO] Stop generating *coal* sections.
Akira Hatanaka [Thu, 15 Oct 2015 05:28:38 +0000 (05:28 +0000)]
[MachO] Stop generating *coal* sections.

Recommit r250342: move coal-sections-powerpc.s to subdirectory for powerpc.

Some background on why we don't have to use *coal* sections anymore:
Long ago when C++ was new and "weak" had not been standardized, an attempt was
made in cctools to support C++ inlines that can be coalesced by putting them
into their own section (TEXT/textcoal_nt instead of TEXT/text).

The current macho linker supports the weak-def bit on any symbol to allow it to
be coalesced, but the compiler still puts weak-def functions/data into alternate
section names, which the linker must map back to the base section name.

This patch makes changes that are necessary to prevent the compiler from using
the "coal" sections and have it use the non-coal sections instead when the
target architecture is not powerpc:

TEXT/textcoal_nt instead use TEXT/text
TEXT/const_coal instead use TEXT/const
DATA/datacoal_nt instead use DATA/data

If the target is powerpc, we continue to use the *coal* sections since anyone
targeting powerpc is probably using an old linker that doesn't have support for
the weak-def bits.

Also, have the assembler issue a warning if it encounters a *coal* section in
the assembly file and inform the users to use the non-coal sections instead.


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

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

7 years agoTest commit.
Hrvoje Varga [Thu, 15 Oct 2015 05:20:51 +0000 (05:20 +0000)]
Test commit.

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

7 years agoTemporarily revert r250345 to sort out bot failure.
Manman Ren [Thu, 15 Oct 2015 04:58:24 +0000 (04:58 +0000)]
Temporarily revert r250345 to sort out bot failure.

With r250345 and r250343, we start to observe the following failure
when bootstrap clang with lto and pgo:
PHI node entries do not match predecessors!
  %.sroa.029.3.i = phi %"class.llvm::SDNode.13298"* [ null, %30953 ], [ null, %31017 ], [ null, %30998 ], [ null, %_ZN4llvm8dyn_castINS_14ConstantSDNodeENS_7SDValueEEENS_10cast_rettyIT_T0_E8ret_typeERS5_.exit.i.1804 ], [ null, %30975 ], [ null, %30991 ], [ null, %_ZNK4llvm3EVT13getScalarTypeEv.exit.i.1812 ], [ %..sroa.029.0.i, %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit.i.1826 ], !dbg !451895
label %30998
label %_ZNK4llvm3EVTeqES0_.exit19.thread.i
LLVM ERROR: Broken function found, compilation aborted!

I will re-commit this if the bot does not recover.

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

7 years agoAdd XSAVE/XSAVEOPT to KNL processor.
Craig Topper [Thu, 15 Oct 2015 03:56:54 +0000 (03:56 +0000)]
Add XSAVE/XSAVEOPT to KNL processor.

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

7 years agos/NumFiles/NumStreams/
David Majnemer [Thu, 15 Oct 2015 01:39:00 +0000 (01:39 +0000)]

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

7 years ago[llvm-pdbdump] Provide a mechanism to dump the raw contents of a PDB
David Majnemer [Thu, 15 Oct 2015 01:27:19 +0000 (01:27 +0000)]
[llvm-pdbdump] Provide a mechanism to dump the raw contents of a PDB

A PDB can be thought of as a very simple file system.  It is
occasionally illuminating to see the contents of the underlying files.

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

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

7 years agoFix -Wmismatched-tags error in modules build by removing unused forward declaration.
Richard Smith [Thu, 15 Oct 2015 01:15:26 +0000 (01:15 +0000)]
Fix -Wmismatched-tags error in modules build by removing unused forward declaration.

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

7 years ago[bugpoint] llvm-gcc doesn't exist anymore ...
Davide Italiano [Thu, 15 Oct 2015 01:12:01 +0000 (01:12 +0000)]
[bugpoint] llvm-gcc doesn't exist anymore ...

... so this comment is stale. Remove it. Range-loopify while here.

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

7 years ago[ARM] Make sure we do not dereference the end iterator when accessing debug
Quentin Colombet [Thu, 15 Oct 2015 00:41:26 +0000 (00:41 +0000)]
[ARM] Make sure we do not dereference the end iterator when accessing debug
Although the problem was always here, it would only be exposed when
shrink-wrapping is enable.


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

7 years agoRevert r250349.
Akira Hatanaka [Thu, 15 Oct 2015 00:11:03 +0000 (00:11 +0000)]
Revert r250349.

Test case coal-sections-powerpc.s is still failing on some buildbots.

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

7 years ago[JIT] TrivialMemoryManager: Fail if we can't allocate memory.
Davide Italiano [Thu, 15 Oct 2015 00:05:32 +0000 (00:05 +0000)]
[JIT] TrivialMemoryManager: Fail if we can't allocate memory.

TrivialMemoryManager currently doesn't check the return type of AllocateRWX --
and returns a 'null' MemoryBlock to its caller. As pointed out by Lang,
this exposes some serious issues with the MemoryManager interface. There's,
in fact, no way to report back an error to clients rather than aborting in
case memory can't be allocated. Eventually the interface will grow to support
this, but for now, fail sooner rather than later.

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

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

7 years ago[MachO] Stop generating *coal* sections.
Akira Hatanaka [Wed, 14 Oct 2015 23:48:10 +0000 (23:48 +0000)]
[MachO] Stop generating *coal* sections.

Recommit r250342: add -arch=ppc32 to the RUN lines of powerpc tests.

Some background on why we don't have to use *coal* sections anymore:
Long ago when C++ was new and "weak" had not been standardized, an attempt was
made in cctools to support C++ inlines that can be coalesced by putting them
into their own section (TEXT/textcoal_nt instead of TEXT/text).

The current macho linker supports the weak-def bit on any symbol to allow it to
be coalesced, but the compiler still puts weak-def functions/data into alternate
section names, which the linker must map back to the base section name.

This patch makes changes that are necessary to prevent the compiler from using
the "coal" sections and have it use the non-coal sections instead when the
target architecture is not powerpc:

TEXT/textcoal_nt instead use TEXT/text
TEXT/const_coal instead use TEXT/const
DATA/datacoal_nt instead use DATA/data

If the target is powerpc, we continue to use the *coal* sections since anyone
targeting powerpc is probably using an old linker that doesn't have support for
the weak-def bits.

Also, have the assembler issue a warning if it encounters a *coal* section in
the assembly file and inform the users to use the non-coal sections instead.


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

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

7 years agoRevert r250342.
Akira Hatanaka [Wed, 14 Oct 2015 23:29:10 +0000 (23:29 +0000)]
Revert r250342.

Investigate why coal-sections-powerpc.s is failing on some buildbots.

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

7 years agoUpdate the branch weight metadata in JumpThreading pass.
Cong Hou [Wed, 14 Oct 2015 23:14:17 +0000 (23:14 +0000)]
Update the branch weight metadata in JumpThreading pass.

Currently in JumpThreading pass, the branch weight metadata is not updated after CFG modification. Consider the jump threading on PredBB, BB, and SuccBB. After jump threading, the weight on BB->SuccBB should be adjusted as some of it is contributed by the edge PredBB->BB, which doesn't exist anymore. This patch tries to update the edge weight in metadata on BB->SuccBB by scaling it by 1 - Freq(PredBB->BB) / Freq(BB->SuccBB).

This is the third attempt to submit this patch, while the first two led to failures in some FDO tests. After investigation, it is the edge weight normalization that caused those failures. In this patch the edge weight normalization is fixed so that there is no zero weight in the output and the sum of all weights can fit in 32-bit integer. Several unit tests are added.

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

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

7 years agoTest case which should have been part of 250343
Philip Reames [Wed, 14 Oct 2015 22:47:06 +0000 (22:47 +0000)]
Test case which should have been part of 250343

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

7 years ago[SimplifyCFG] Speculatively flatten CFG based on profiling metadata
Philip Reames [Wed, 14 Oct 2015 22:46:19 +0000 (22:46 +0000)]
[SimplifyCFG] Speculatively flatten CFG based on profiling metadata

If we have a series of branches which are all unlikely to fail, we can possibly combine them into a single check on the fastpath combined with a bit of dispatch logic on the slowpath. We don't want to do this unconditionally since it requires speculating instructions past a branch, but if the profiling metadata on the branch indicates profitability, this can reduce the number of checks needed along the fast path.

The canonical example this is trying to handle is removing the second bounds check implied by the Java code: a[i] + a[i+1]. Note that it can currently only do so for really simple conditions and the values of a[i] can't be used anywhere except in the addition. (i.e. the load has to have been sunk already and not prevent speculation.) I plan on extending this transform over the next few days to handle alternate sequences.

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

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

7 years ago[MachO] Stop generating *coal* sections.
Akira Hatanaka [Wed, 14 Oct 2015 22:45:36 +0000 (22:45 +0000)]
[MachO] Stop generating *coal* sections.

Some background on why we don't have to use *coal* sections anymore:
Long ago when C++ was new and "weak" had not been standardized, an attempt was
made in cctools to support C++ inlines that can be coalesced by putting them
into their own section (TEXT/textcoal_nt instead of TEXT/text).

The current macho linker supports the weak-def bit on any symbol to allow it to
be coalesced, but the compiler still puts weak-def functions/data into alternate
section names, which the linker must map back to the base section name.

This patch makes changes that are necessary to prevent the compiler from using
the "coal" sections and have it use the non-coal sections instead when the
target architecture is not powerpc:

TEXT/textcoal_nt instead use TEXT/text
TEXT/const_coal instead use TEXT/const
DATA/datacoal_nt instead use DATA/data

If the target is powerpc, we continue to use the *coal* sections since anyone
targeting powerpc is probably using an old linker that doesn't have support for
the weak-def bits.

Also, have the assembler issue a warning if it encounters a *coal* section in
the assembly file and inform the users to use the non-coal sections instead.


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

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