Commit Graph

140770 Commits

Author SHA1 Message Date
Sanjay Patel
a897799dc7 [docs] fix link to AMD manuals (PR30946)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286249 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 16:49:24 +00:00
Dehao Chen
43252d0179 Use the last 7 bits to represent the discriminator to fit it in 1 byte ULEB128 (NFC).
From experiments, discriminator is rarely greater than 127. Here we enforce it to be no greater than 127 so that it will always fit in 1 byte.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286245 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 16:32:32 +00:00
Simon Pilgrim
38950e5112 [X86][SSE] Regenerate test (just adds missing header)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286241 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 15:42:49 +00:00
Simon Pilgrim
abcddd5a2c [TargetLowering] Fix undef vector element issue with true/false result handling
Fixed an issue with vector usage of TargetLowering::isConstTrueVal / TargetLowering::isConstFalseVal boolean result matching.

The comment said we shouldn't handle constant splat vectors with undef elements. But the the actual code was returning false if the build vector contained no undef elements....

This patch now ignores the number of undefs (getConstantSplatNode will return null if the build vector is all undefs).

The change has also unearthed a couple of missed opportunities in AVX512 comparison code that will need to be addressed.

Differential Revision: https://reviews.llvm.org/D26031

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286238 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 15:07:01 +00:00
Pablo Barrio
ac54d0066c [JumpThreading] Unfold selects that depend on the same condition
Summary:
These are good candidates for jump threading. This enables later opts
(such as InstCombine) to combine instructions from the selects with
instructions out of the selects. SimplifyCFG will fold the select
again if unfolding wasn't worth it.

Patch by James Molloy and Pablo Barrio.

Reviewers: rengolin, haicheng, sebpop

Subscribers: jojo, jmolloy, llvm-commits

Differential Revision: https://reviews.llvm.org/D26391

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286236 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 14:53:30 +00:00
Simon Pilgrim
169b408a54 [VectorLegalizer] Expansion of CTLZ using CTPOP when possible
This patch avoids scalarization of CTLZ by instead expanding to use CTPOP (ref: "Hacker's Delight") when the necessary operations are available.

This also adds the necessary cost models for X86 SSE2 targets (the main beneficiary) to ensure vectorization only happens when its useful.

Differential Revision: https://reviews.llvm.org/D25910

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286233 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 14:10:28 +00:00
Rafael Espindola
174270cc4c cleanup hashSysV a bit.
Don't pass a reference to a StringRef and use a range loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286232 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 14:04:16 +00:00
Roger Ferrer Ibanez
b576a606d4 [AArch64] Fix incorrect CSEL node created
Under -enable-unsafe-fp-math, SELECT_CC lowering in AArch64
transforms floating point comparisons of the form "a == 0.0 ? 0.0 : x" to
"a == 0.0 ? a : x". But it incorrectly assumes that 'x' and 'a' have
the same type which can lead to a wrong CSEL node that crashes later
due to nonsensical copies.

Differential Revision: https://reviews.llvm.org/D26394



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286231 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 13:34:41 +00:00
Simon Dardis
00b1a65d84 [mips] Renable small data section test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286230 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 13:03:45 +00:00
Amara Emerson
0a1b0ce7cf Adds the loop end location to the loop metadata.
This additional information can be used to improve the locations when generating remarks for loops.

Patch by Florian Hahn.

Differential Revision: https://reviews.llvm.org/D25763



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286227 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 11:18:59 +00:00
Sylvestre Ledru
20b341aa05 Fix memory leaks (coverity issues 1365586 & 1365591)
Reviewers: hfinkel

Subscribers: george.burgess.iv, malcolm.parsons, boris.ulasevich, llvm-commits

Differential Revision: https://reviews.llvm.org/D26347

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286223 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 10:00:45 +00:00
Craig Topper
2b94bbb140 [AVX-512] Add an avx512f without avx512vl command line to vec_fp_to_int.ll and regenerate. This will make a change in a future patch easier to see. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286216 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 06:58:53 +00:00
Peter Collingbourne
5498e18776 IR, Bitcode: Change bitcode reader to no longer own its memory buffer.
Unique ownership is just one possible ownership pattern for the memory buffer
underlying the bitcode reader. In practice, as this patch shows, ownership can
often reside at a higher level. With the upcoming change to allow multiple
modules in a single bitcode file, it will no longer be appropriate for
modules to generally have unique ownership of their memory buffer.

The C API exposes the ownership relation via the LLVMGetBitcodeModuleInContext
and LLVMGetBitcodeModuleInContext2 functions, so we still need some way for
the module to own the memory buffer. This patch does so by adding an owned
memory buffer field to Module, and using it in a few other places where it
is convenient.

Differential Revision: https://reviews.llvm.org/D26384

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286214 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 06:03:43 +00:00
Justin Bogner
adbd909be7 cmake: Don't try to install exports if there aren't any
When using LLVM_DISTRIBUTION_COMPONENTS, it's possible for LLVM's
export list to be empty. If this happens the install(EXPORTS) command
will fail, but since there isn't anything to install anyway we really
just want to skip it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 05:02:18 +00:00
Peter Collingbourne
8fc9b4d314 Bitcode: Decouple block info block state from reader.
As proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/106630.html

Move block info block state to a new class, BitstreamBlockInfo.
Clients may set the block info for a particular cursor with the
BitstreamCursor::setBlockInfo() method.

At this point BitstreamReader is not much more than a container for an
ArrayRef<uint8_t>, so remove it and replace all uses with direct uses
of memory buffers.

Differential Revision: https://reviews.llvm.org/D26259

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286207 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 04:17:11 +00:00
Peter Collingbourne
ef0facce3e Bitcode: Split out block info reading into a separate function.
We're about to make this more complicated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286206 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 04:16:57 +00:00
George Burgess IV
ba372980dc Add a missing break statement. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286203 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 04:01:50 +00:00
Tim Northover
160a2705e6 GlobalISel: improve error diagnostics when IRTranslation fails.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 01:12:17 +00:00
Tim Northover
7b111890d1 GlobalISel: support selecting G_SELECT on AArch64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286185 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 00:45:29 +00:00
Mandeep Singh Grang
e7ffbb5a0e [CMake] Fix llvm_setup_rpath function
Summary:
Set _install_rpath to CMAKE_INSTALL_RPATH if it is defined, so that eventually
INSTALL_RPATH is set to CMAKE_INSTALL_RPATH.
The "if(NOT DEFINED CMAKE_INSTALL_RPATH)" was missing a corresponding else
clause.
This also cleans up the fix made in r285908.

Patch by Azharuddin Mohammed

Reviewers: john.brawn, sgundapa, beanz

Subscribers: chapuni, mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D26289

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 00:45:05 +00:00
Tim Northover
648fd9b1f6 GlobalISel: constrain PHI registers on AArch64.
Self-referencing PHI nodes need their destination operands to be constrained
because nothing else is likely to do so. For now we just pick a register class
naively.

Patch mostly by Ahmed again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 00:34:06 +00:00
Eli Friedman
a19c76d93d [LTO] Add error message on IO error in compileOptimizedToFile.
(No testcase because it's difficult to force an error here.)

Differential Revision: https://reviews.llvm.org/D26371



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286177 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 23:43:07 +00:00
Chad Rosier
a5af556e61 [AArch64] Remove dead check prefixes after r286110. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286174 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 23:13:59 +00:00
Chad Rosier
c6a1b2b827 [AArch64] Rename test to reflect changes after r286110. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286173 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 23:13:55 +00:00
Adam Nemet
3fbb1a90c3 [opt-viewer] Avoid division by zero
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286172 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 23:12:13 +00:00
Stanislav Mekhanoshin
c312996e7a [AMDGPU] Allow hoisting of comparisons out of a loop and eliminate condition copies
Codegen prepare sinks comparisons close to a user is we have only one register
for conditions. For AMDGPU we have many SGPRs capable to hold vector conditions.
Changed BE to report we have many condition registers. That way IR LICM pass
would hoist an invariant comparison out of a loop and codegen prepare will not
sink it.

With that done a condition is calculated in one block and used in another.
Current behavior is to store workitem's condition in a VGPR using v_cndmask
and then restore it with yet another v_cmp instruction from that v_cndmask's
result. To mitigate the issue a forward propagation of a v_cmp 64 bit result
to an user is implemented. Additional side effect of this is that we may
consume less VGPRs in a cost of more SGPRs in case if holding of multiple
conditions is needed, and that is a clear win in most cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286171 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 23:04:50 +00:00
Adam Nemet
330e12bad4 [OptDiag, opt-viewer] Save callee's location and display as link
With this we get a new field in the YAML record if the value being
streamed out has a debug location.  For examples, please see the changes
to the tests.

This is then used in opt-viewer to display a link for the callee
function in the inlining remarks.

Differential Revision: https://reviews.llvm.org/D26366

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286169 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 22:41:13 +00:00
Sanjin Sijaric
978966fb97 [AArch64] Transfer memory operands when lowering vector load/store intrinsics
Summary:
Some vector loads and stores generated from AArch64 intrinsics alias each other
unnecessarily, preventing better scheduling.  We just need to transfer memory
operands during lowering.

Reviewers: mcrosier, t.p.northover, jmolloy

Subscribers: aemerson, rengolin, llvm-commits

Differential Revision: https://reviews.llvm.org/D26313

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286168 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 22:39:02 +00:00
Lang Hames
3fab9364ac [docs] Add a pointer to ExitOnError to the discussion of handleErrors in the
programmer's manual.

ExitOnError is often a better alternative to handleErrors for tool code. This
patch makes it easier to find the ExitOnError discussion when reading the
handleErrors section.

Thanks to Peter Collingbourne for the suggestion.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286167 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 22:33:13 +00:00
Sanjoy Das
3e9cd162c0 [TRE] Remove dead code
Address review by Eli Friedman on rL286147.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286165 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 22:17:37 +00:00
Mehdi Amini
d2b417a57c [doc] Add documentation about how to use a monorepo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 22:14:09 +00:00
Mehdi Amini
ffe516c55a Add experimental support for unofficial monorepo-like directory layout
Summary:
This allows to have clang and llvm and the other subprojects
side-by-side instead of nested. This can be used with the monorepo or
multiple repos.

It will help having a single set of sources checked out but allows to
have a build directory with llvm and another one with llvm+clang.
Basically it abstracts LLVM_EXTERNAL_xxxx_SOURCE_DIR making it more
convenient by adopting a convention.

Reviewers: bogner, beanz, jlebar

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D26365

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286162 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 22:13:38 +00:00
Derek Schuff
9ebd8435df [WebAssembly] Emit a BasePointer when we have overly-aligned stack objects
Because we shift the stack pointer by an unknown amount, we need an
additional pointer. In the case where we have variable-size objects
as well, we can't reuse the frame pointer, thus three pointers.

Patch by Jacob Gravelle

Differential Revision: https://reviews.llvm.org/D26263

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286160 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 22:00:48 +00:00
Dehao Chen
cc1ad89bbb Reset debug loc to OldInduction in InnerLoopVectorizer::createInductionVariable. (NFC)
This is to prevent SetInsertionPoint from setting debug loc to Latch->getTerminator().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286159 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 21:59:40 +00:00
Davide Italiano
93cbe9bc6f [lib/Object] Rename elf_hash to hashSysV.
This is more clear, as we have also GNU hash these days..

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286157 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 21:56:04 +00:00
Reid Kleckner
14b08acb1e [lit] Print negative exit codes on Windows in hex
Negative exit codes are usually exceptions. They're easier to recognize
in hex. Compare -1073741502 to 0xc0000142.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286150 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 21:06:20 +00:00
Sanjoy Das
daf21289b6 Avoid tail recursion elimination across calls with operand bundles
Summary:
In some specific scenarios with well understood operand bundle types
(like `"deopt"`) it may be possible to go ahead and convert recursion to
iteration, but TailRecursionElimination does not have that logic today
so avoid doing the right thing for now.

I need some input on whether `"funclet"` operand bundles should also
block tail recursion elimination.  If not, I'll allow TRE across calls
with `"funclet"` operand bundles and add a test case.

Reviewers: rnk, majnemer, nlewycky, ahatanak

Subscribers: mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D26270

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 21:01:49 +00:00
Davide Italiano
2d2f4b6521 [lib/Object] Modernize. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286146 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 21:01:42 +00:00
Evgeniy Stepanov
d2b47f0e27 Use -fsanitize-recover instead of -mllvm -msan-keep-going.
Summary: Use -fsanitize-recover instead of -mllvm -msan-keep-going.

Reviewers: eugenis

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D26352

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 21:00:10 +00:00
Jordan Rose
fd34be2ddd Add tests for r286139.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286141 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 20:40:16 +00:00
Mehdi Amini
59bbd3ca9e Fix git-llvm script to handle git worktree setups correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286140 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 20:35:02 +00:00
Jordan Rose
d75c178408 Disallow StringRef assignment from temporary std::strings.
Similar to r283798, this prevents accidentally referring to temporary
storage that goes out of scope by the end of the statement:

  someStringRef = getStringByValue();
  someStringRef = (Twine("-") + otherString).str();

Note that once again the constructor still has this problem:

  StringRef someStringRef = getStringByValue();

because once again we occasionally rely on this in calls:

  takesStringRef(getStringByValue());
  takesStringRef(Twine("-") + otherString);

Still, it's a step.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286139 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 20:34:16 +00:00
Mehdi Amini
7e34ddb6ca Add some facilities to work with a git monorepo (experimental setup)
Add a new script in llvm/utils/git-svn/. When present in the $PATH,
it enables a `git llvm` command. It is providing at this
point only the ability to push from the git monorepo: `git llvm push`.
It is intended to evolves with more features, for instance I plan on
features like `git llvm show r284955` to help working with sequential
revision numbers.
The push feature is taken from Justin Lebar's script available here:
https://github.com/jlebar/llvm-repo-tools/

Differential Revision: https://reviews.llvm.org/D26334

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286138 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 20:00:47 +00:00
Davide Italiano
99d2cab4ae [AArch64] Remove dead store. Found by gcc7.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286137 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 19:11:25 +00:00
Kuba Brecka
8882bb7633 [tsan] Cast floating-point types correctly when instrumenting atomic accesses, LLVM part
Although rare, atomic accesses to floating-point types seem to be valid, i.e. `%a = load atomic float ...`. The TSan instrumentation pass however tries to emit inttoptr, which is incorrect, we should use a bitcast here. Anyway, IRBuilder already has a convenient helper function for this.

Differential Revision: https://reviews.llvm.org/D26266



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286135 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 19:09:56 +00:00
Matt Arsenault
f577de357a AMDGPU: Remove unnecessary and on conditional branch
The comment explaining why this was necessary is incorrect
in its description of v_cmp's behavior for inactive workitems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286134 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 19:09:33 +00:00
Matt Arsenault
e5fd9c09ad AMDGPU: Preserve vcc undef flags when inverting branch
If the branch was on a read-undef of vcc, passes that used
analyzeBranch to invert the branch condition wouldn't preserve
the undef flag resulting in a verifier error.

Fixes verifier failures in a future commit.

Also fix verifier error when inserting copy for vccz
corruption bug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286133 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 19:09:27 +00:00
David L. Jones
2dd5f7e327 Remove Go Attribute type that was deleted from the C API in r286062.
Summary:
The C++ side of the Go bindings were updated in r286085, r286086, and r286087,
but those did not remove this type.

Reviewers: djasper

Subscribers: axw

Differential Revision: https://reviews.llvm.org/D26337

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286131 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 18:38:49 +00:00
Stanislav Mekhanoshin
6afa68e1dc Test commit, deleted empty line at the end of README.txt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 18:31:21 +00:00
Zvi Rackover
58d02e0f92 [X86] Fix test checks script to satisfy pyflakes
- Remove unused imports.
- Initialize the variable 'name' before its (static) uses, and rename it to a
  more descriptive name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286128 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 18:08:19 +00:00