131821 Commits

Author SHA1 Message Date
Silviu Baranga
c5b59c23b5 [LAA] Use re-written SCEV expressions when computing distances
This removes a redundant stride versioning step (we already
do it in getPtrStride, so it has no effect) and uses PSE to
get the SCEV expressions for the source and destination
(this might have changed when getPtrStride was called).

I discovered this through code inspection, and couldn't
produce a regression test for it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269052 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 12:28:49 +00:00
James Molloy
3a22301784 Revert "[VectorUtils] Query number of sign bits to allow more truncations"
This was a fairly simple patch but on closer inspection was seriously flawed and caused PR27690.

This reverts commit r268921.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269051 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 12:27:23 +00:00
Daniel Sanders
32ba5cd276 [mips][ias] Make the default path unreachable in needsRelocateWithSymbol() (except for N64).
Following post-commit comments on r268900 from Rafael Espindola:
The missing relocations are now explicitly listed in the switch statement with
appropriate FIXME comments and the default path is now unreachable. The
temporary exception to this is that compound relocations for N64 still have a
default path that returns true. This is because fixing that case ought to be a
separate patch.

Also make R_MIPS_NONE return false since it has no effect on the section data.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269047 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 12:17:04 +00:00
Jeroen Ketema
f14def1048 [OCaml] Update core test and re-enable testing
Differential Revision: http://reviews.llvm.org/D19828


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269040 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 11:19:20 +00:00
Simon Pilgrim
122b5fb8b8 [X86][AVX512] Added masked version of MOVDDUP test with 16f32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269038 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 10:30:00 +00:00
Chuang-Yu Cheng
9aa98caa23 Update Debug Intrinsics in RewriteUsesOfClonedInstructions in LoopRotation
Loop rotation clones instruction from the old header into the preheader. If
there were uses of values produced by these instructions that were outside
the loop, we have to insert PHI nodes to merge the two values. If the values
are used by DbgIntrinsics they will be used as a MetadataAsValue of a
ValueAsMetadata of the original values, and iterating all of the uses of the
original value will not update the DbgIntrinsics. The new code checks if the
values are used by DbgIntrinsics and if so, updates them using essentially
the same logic as the original code.

The attached testcase demonstrates the issue. Without the fix, the
DbgIntrinic outside the loop uses values computed inside the loop, even
though these values do not dominate the DbgIntrinsic.

Author: Thomas Jablin (tjablin)
Reviewers: dblaikie aprantl kbarton hfinkel cycheng

http://reviews.llvm.org/D19564

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269034 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 09:45:44 +00:00
Arnaud A. de Grandmaison
5e24513c1f [InstCombine] Remove trivially empty va_start/va_end and va_copy/va_end ranges.
When a va_start or va_copy is immediately followed by a va_end (ignoring
debug information or other start/end in between), then it is safe to
remove the pair. As this code shares some commonalities with the lifetime
markers, this has been factored to helper functions.

This InstCombine pattern kicks-in 3 times when running the LLVM test
suite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269033 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 09:24:49 +00:00
Chris Dewhurst
01fad33aac [Sparc][LEON] Itineraries unit test.
Added test to check LeonItineraries are being applied by code checked-in two weeks ago in r267121.

Phabricator Review: http://reviews.llvm.org/D19359

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269032 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 09:09:20 +00:00
Daniel Sanders
dd9958f08f Clarify the difference between ISD::BITCAST and the bitcast instruction from LLVM-IR.
Subscribers: llvm-commits, hfinkel

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269031 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 09:01:54 +00:00
Renato Golin
3c1ea17cfa Revert "[PGO] Fix __llvm_profile_raw_version linkage in MACHO IR instrumentation generates a COMDAT symbol __llvm_profile_raw_version to overwrite the same symbol in profile run-time to distinguish IR profiles from Clang generated profiles. In MACHO, LinkOnceODR linkage is used due to the lack of COMDAT support."
This reverts commits r268969, r268979 and r268984. They had target specific test
in generic directories without the correct specifiers and made it hard for us to
come up with a good solution by rapidly committing untested changes.

This test needs to be in a target specific directory or have the correct REQUIRED
identifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269027 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 08:23:57 +00:00
Jonas Paulsson
32db7c31b2 [foldMemoryOperand()] Pass LiveIntervals to enable liveness check.
SystemZ (and probably other targets as well) can fold a memory operand
by changing the opcode into a new instruction that as a side-effect
also clobbers the CC-reg.

In order to do this, liveness of that reg must first be checked. When
LIS is passed, getRegUnit() can be called on it and the right
LiveRange is computed on demand.

Reviewed by Matthias Braun.
http://reviews.llvm.org/D19861

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269026 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 08:09:37 +00:00
Elena Demikhovsky
b6e58d8bd0 [LoopVectorize] Handling induction variable with non-constant step.
Allow vectorization when the step is a loop-invariant variable.
This is the loop example that is getting vectorized after the patch:

 int int_inc;
 int bar(int init, int *restrict A, int N) {

  int x = init;
  for (int i=0;i<N;i++){
    A[i] = x;
    x += int_inc;
  }
  return x;
 }

"x" is an induction variable with *loop-invariant* step.
But it is not a primary induction. Primary induction variable with non-constant step is not handled yet.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269023 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 07:33:35 +00:00
Denis Zobnin
f459cb2831 [LAA] Rename "isStridedPtr" with "getPtrStride". NFC.
Changing misleading function name was approved in http://reviews.llvm.org/D17268.
Patch by Roman Shirokiy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269021 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 05:55:16 +00:00
Matthias Braun
c798cb42bb liveness.mir requires asserts to use -debug-only
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269020 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 05:38:47 +00:00
Craig Topper
9abf0e829e [X86][AVX512] Strengthen the assertions from r269001. We need VLX to use the 128/256-bit move opcodes for extended registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269019 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 05:28:04 +00:00
Craig Topper
5937d7d9ab [X86] Add ZMM registers to the X86_INTR calling convention preserved mask when AVX512 is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269018 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 05:28:02 +00:00
Craig Topper
7522f0e895 [X86] Update X86_INTR calling convention to save ZMM registers instead of YMM registers when AVX512 is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 05:27:56 +00:00
Matthias Braun
e607e01664 LiveIntervalAnalysis: Rework constructMainRangeFromSubranges()
We now use LiveRangeCalc::extendToUses() instead of a specially designed
algorithm in constructMainRangeFromSubranges():
- The original motivation for constructMainRangeFromSubranges() were
  differences between the main liverange and subranges because of hidden
  dead definitions. This case however cannot happen anymore with the
  DetectDeadLaneMasks pass in place.
- It simplifies the code.
- This fixes a longstanding bug where we did not properly create new SSA
  values on merging control flow (the MachineVerifier missed most of
  these cases).
- Move constructMainRangeFromSubranges() to LiveIntervalAnalysis and
  LiveRangeCalc to better match the implementation/available helper
  functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269016 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 04:51:14 +00:00
Matthias Braun
583673e65e LiveInterval: Avoid unnecessary auto, add const; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269015 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 04:51:09 +00:00
Matthias Braun
0f8d2d6396 llc: Print+Verify machine function after loading it
In -run-pass mode verify/print machine function immediately after
loading the .mir file if -verify-machineinstr/-print-machineinstrs
option is specified.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269014 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 04:51:07 +00:00
Matthias Braun
07636808ac TargetPassConfig: Set PrintMachineCode even if addMachinePasses() does not run.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269013 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 04:51:04 +00:00
Dan Gohman
01a542927d [WebAssembly] Move register stackification and coloring to a late phase.
Move the register stackification and coloring passes to run very late, after
PEI, tail duplication, and most other passes. This means that all code emitted
and expanded by those passes is now exposed to these passes. This also
eliminates the need for prologue/epilogue code to be manually stackified,
which significantly simplifies the code.

This does require running LiveIntervals a second time. It's useful to think
of these late passes not as late optimization passes, but as a domain-specific
compression algorithm based on knowledge of liveness information. It's used to
compress the code after all conventional optimizations are complete, which is
why it uses LiveIntervals at a phase when actual optimization passes don't
typically need it.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269012 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 04:24:02 +00:00
Matthias Braun
6a6190de10 CodeGen: Move TargetPassConfig from Passes.h to an own header; NFC
Many files include Passes.h but only a fraction needs to know about the
TargetPassConfig class. Move it into an own header. Also rename
Passes.cpp to TargetPassConfig.cpp while we are at it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269011 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 03:21:59 +00:00
Matthias Braun
63558aa6e4 PrologEpilogInserter: Remove unnecessary dependency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269010 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 03:21:47 +00:00
Matthias Braun
b5fb260d42 Appease MSVC
Apply a similar fix to the one in r269006 to LiveIntervalTest.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269009 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 03:03:55 +00:00
Sanjoy Das
b93f14ae06 [ValueTracking] Use guards to prove non-nullness of a value
Reviewers: apilipenko, majnemer, reames

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269008 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 02:35:44 +00:00
Sanjoy Das
bbd902f57e [BasicAA] Guard intrinsics don't write to memory
Summary:
The idea is very close to what we do for assume intrinsics: we mark the
guard intrinsics as writing to arbitrary memory to maintain control
dependence, but under the covers we teach AA that they do not mod any
particular memory location.

Reviewers: chandlerc, hfinkel, gbiv, reames

Subscribers: george.burgess.iv, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 02:35:41 +00:00
Matthias Braun
3c559a044a Try to appease clang-x64-ninja-win7 bot.
Looks like you need the complete definition of "X" when calling a "X
&func()" declared function even when not using the result further.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269006 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 02:09:32 +00:00
Matthias Braun
bbeb3ea1ff llc: Rework -run-pass option
We now construct a custom pass pipeline instead of injecting
start-before/stop-after into the default pipeline construction. This
allows to specify any pass known to the pass registry. Previously
specifying indirectly added analysis passes or passes not added to the
pipeline add all would not be added and we would silently do nothing.

This also restricts the -run-pass option to cases with .mir input.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269003 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 01:32:44 +00:00
Matthias Braun
bf765dfe21 LLVMTargetMachine: Add functions to create MIModuleInfo/MIFunction; NFC
Add convenience function to create MachineModuleInfo and
MachineFunctionAnalysis passes and add them to a pass manager.

Despite factoring out some shared code in
LiveIntervalTest/LLVMTargetMachine this will be used by my upcoming llc
change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269002 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 01:32:40 +00:00
Quentin Colombet
c2cb1b7b04 [X86][AVX512] Use the proper load/store for AVX512 registers.
When loading or storing AVX512 registers we were not using the AVX512
variant of the load and store for VR128 and VR256 like registers.
Thus, we ended up with the wrong encoding and actually were dropping the
high bits of the instruction. The result was that we load or store the
wrong register. The effect is visible only when we emit the object file
directly and disassemble it. Then, the output of the disassembler does
not match the assembly input.

This is related to llvm.org/PR27481.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269001 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 01:09:14 +00:00
Evgeniy Stepanov
d3d318a084 Don't inline functions with different SafeStack attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268999 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 00:33:07 +00:00
Sanjoy Das
b03e0b7cfd [SCEVExpander] Clang format expressions; NFC
The boolean expressions are somewhat hard to read otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268998 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 00:32:31 +00:00
Sanjoy Das
cbda428c36 [SCEV] Use guards to prove predicates
We can use calls to @llvm.experimental.guard to prove predicates,
relying on the fact that in all locations domianted by a call to
@llvm.experimental.guard the predicate it is guarding is known to be
true.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268997 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 00:31:49 +00:00
Justin Lebar
e598f97f6c [nvvm] Mark ldu and ldg intrinsics as IntrArgMemOnly.
Summary:
Previously these intrinsics were marked as can-read any memory address.
Now they're marked as reading only the pointer they're passed.

Reviewers: rnk

Subscribers: jholewinski, llvm-commits, tra

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268996 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 00:31:25 +00:00
Justin Lebar
4c9fd4a948 Minor formatting fixes in LoopUnroll.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268995 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 00:31:23 +00:00
Justin Lebar
9f9e951090 [NVPTX] Change begin/end inline asm comments to "begin/end inline asm".
Previously it was just "// inline asm", which made it tricky to read
code with lots of inline assembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268994 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 00:31:22 +00:00
Justin Lebar
493ba428f1 [NVVM] Add comments to NVVM intrinsics listing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268993 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 00:31:20 +00:00
Derek Schuff
42a5196098 [WebAssembly] Disable 128-bit shift libcalls
Currently the signature of the functions
i128(i128, i32) aka void(i32, i64, i64, i32) doesn't match the signature
of the call emitted by the default lowering, void(i32, i64, i64).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268991 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 00:14:07 +00:00
Justin Bogner
6d523e1b0e SDAG: Stop relying on Select's return value in SystemZ's splitLargeImmediate. NFC
The call to Select on Upper here happens in an unusual order in order
to defeat the constant folding that getNode() does. Add a comment
explaining why we can't just move the Select to later to avoid a
Handle, and wrap the call to SelectCode in a handle so we don't need
its return value.

This is part of the work to have Select return void instead of an
SDNode *, which is in turn part of llvm.org/pr26808.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268990 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 23:54:23 +00:00
Eugene Zelenko
3d09da3538 Fix some Clang-tidy modernize-deprecated-headers and Include What You Use warnings; other minor fixes.
Differential revision: http://reviews.llvm.org/D20042


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268989 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 23:11:38 +00:00
Adam Nemet
1b5ab63915 [LV] Hint at the new loop distribution pragma in optimization remark
When we encounter unsafe memory dependencies, loop distribution could
help.

Even though, the diagnostics is in LAA, it's only currently emitted in
the vectorizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268987 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 23:03:44 +00:00
Adam Nemet
5d9efa72ab [IndirectCallPromotion] Remove duplicate comment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268986 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 23:03:06 +00:00
Adrian Prantl
2158bbea6e Disable this unit test on MSVC, which crashes while compiling it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268985 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 22:59:55 +00:00
Rong Xu
0ea9dd5d8e Fix buildbot failure from r268968.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268984 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 22:45:47 +00:00
Quentin Colombet
d3fb1bcc0c [X86] Fix the AllRegs AVX calling convention.
We used to list registers that were not in the AVX space. In other
words, we were pushing registers that the ISA cannot encode
(YMM16-YMM31).

This is part of llvm.org/PR27481.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268983 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 22:37:05 +00:00
Sanjay Patel
22d7b011d5 [Inliner] don't assume that a Constant alloca size is a ConstantInt (PR27277)
Differential Revision: http://reviews.llvm.org/D20077



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268980 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 21:51:53 +00:00
Rong Xu
957278efba Fix buildbot failure from r268968.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268979 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 21:51:50 +00:00
Chad Rosier
2ebc9f6346 Typo. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268975 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 21:37:43 +00:00
Xinliang David Li
05e004f012 Cleanup followup of r268710 - [PM] port IR based PGO prof-gen pass to new pass manager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268974 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 21:37:12 +00:00