1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

113177 Commits

Author SHA1 Message Date
Sanjoy Das
2602c601e8 Clarify the wording on what it means for a SCEVAddRecExpr to be <NW>.
llvm-svn: 228587
2015-02-09 18:44:42 +00:00
Sanjoy Das
9a8a687508 Bugfix: SCEV incorrectly marks certain add recurrences as nsw
When creating a scev for sext({X,+,Y}), scev checks if the expression
is equivalent to {sext X,+,zext Y}.  If it can prove that, it also
tags the original {X,+,Y} as <nsw>, which is not correct.

In the test case I run `-scalar-evolution` twice because the bug
manifests only once SCEV has run through and seen the `sext`
expressions (and then does a in-place mutation on {X,+,Y}).

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

llvm-svn: 228586
2015-02-09 18:34:55 +00:00
Lang Hames
a19eaab874 [Orc] Revert r228567 (GCC ICE workaround) - it doesn't seem to have helped.
As far as I can tell r228568 was the right workaround, and r228567 was
unnecessary. If reverting this causes problems on the bots I'll reinstate it.

llvm-svn: 228585
2015-02-09 18:16:43 +00:00
Sanjay Patel
ac6e29e4d7 fixed to test features, not CPUs
llvm-svn: 228581
2015-02-09 17:17:09 +00:00
Kit Barton
7bff890217 This change implements the following three logical vector operations:
veqv (vector equivalence)
vnand
vorc
I increased the AddedComplexity for these instructions to 500 to ensure they are generated instead of issuing other VSX instructions.


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

llvm-svn: 228580
2015-02-09 17:03:18 +00:00
Sanjay Patel
732b5abdba rename variable to give it some meaning; remove obvious comments; NFC
llvm-svn: 228579
2015-02-09 16:30:58 +00:00
Sanjay Patel
0d69091d26 fix comment that didn't match the code; remove unnecessary braces; NFC
llvm-svn: 228578
2015-02-09 16:04:52 +00:00
Johannes Doerfert
70a4c8fe80 Allow ScalarEvolution to catch more min/max cases
For the attached test case different types are used in the ICmpInst
  and SelectInst that represent the min/max expressions. However, if the
  ICmpInst type is smaller a comparison with the sign/zero extended
  operands would have yielded the same result. This situation might
  arise after the instruction combination pass was applied.

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

llvm-svn: 228572
2015-02-09 12:34:23 +00:00
Lang Hames
f1ea70a68b [Orc] Try another workaround for the GCC 4.7.2 ICE introduced in r228557. NFC.
llvm-svn: 228568
2015-02-09 07:47:32 +00:00
Lang Hames
6983fc8f43 [Orc] Tweak lambda capture lists to try to avoid an ICE on gcc-4.7.2. NFC.
Apparently gcc-4.7.2 is touchy about 'this' appearing in a lambda capture list
along with other captures. I've rewritten my captures to try to avoid the issue.

llvm-svn: 228567
2015-02-09 07:22:56 +00:00
Akira Hatanaka
19ff8ff0b3 Fix a bug in DemoteRegToStack where a reload instruction was inserted into the
wrong basic block.

This would happen when the result of an invoke was used by a phi instruction
in the invoke's normal destination block. An instruction to reload the invoke's
value would get inserted before the critical edge was split and a new basic
block (which is the correct insertion point for the reload) was created. This
commit fixes the bug by splitting the critical edge before all the reload
instructions are inserted.

Also, hoist up the code which computes the insertion point to the only place
that need that computation.

rdar://problem/15978721

llvm-svn: 228566
2015-02-09 06:38:23 +00:00
David Majnemer
5e3b5bdf67 MC: Calculate intra-section symbol differences correctly for COFF
This fixes PR22060.

llvm-svn: 228565
2015-02-09 06:31:31 +00:00
Lang Hames
79fa1f9f13 [Orc] Fix the MSVC bots by using LLVM_EXPLICIT rather than explicit.
llvm-svn: 228564
2015-02-09 04:46:41 +00:00
Craig Topper
52b42f0b75 [X86] Remove 256-bit and 512-bit memop pattern fragments. They are no longer used.
llvm-svn: 228563
2015-02-09 04:04:53 +00:00
Craig Topper
a684f06383 [X86] Remove 'memop' uses from AVX512. Use 'load' instead.
llvm-svn: 228562
2015-02-09 04:04:50 +00:00
Tim Northover
e34e125ece DeadArgElim: fix mismatch in accounting of array return types.
Some parts of DeadArgElim were only considering the individual fields
of StructTypes separately, but others (where insertvalue &
extractvalue instructions occur) also looked into ArrayTypes.

This one is an actual bug; the mismatch can lead to an argument being
considered used by a return sub-value that isn't being tracked (and
hence is dead by default). It then gets incorrectly eliminated.

llvm-svn: 228559
2015-02-09 01:21:00 +00:00
Tim Northover
3d150e22ef DeadArgElim: assess uses of entire return value aggregate.
Previously, a non-extractvalue use of an aggregate return value meant
the entire return was considered live (the algorithm gave up
entirely). This was correct, but conservative. It's better to actually
look at that Use, making the analysis results apply to all sub-values
under consideration.

E.g.

  %val = call { i32, i32 } @whatever()
  [...]
  ret { i32, i32 } %val

The return is using the entire aggregate (sub-values 0 and 1). We can
still simplify @whatever if we can prove that this return is itself
unused.

Also unifies the logic slightly between aggregate and non-aggregate
cases..

llvm-svn: 228558
2015-02-09 01:20:53 +00:00
Lang Hames
92f9dd24ac [Orc] Add a JITSymbol class to the Orc APIs, refactor APIs, update clients.
This patch refactors a key piece of the Orc APIs: It removes the
*::getSymbolAddress and *::lookupSymbolAddressIn methods, which returned target
addresses (uint64_ts), and replaces them with *::findSymbol and *::findSymbolIn
respectively, which return instances of the new JITSymbol type. Unlike the old
methods, calling findSymbol or findSymbolIn does not cause the symbol to be
immediately materialized when found. Instead, the symbol will be materialized
if/when the getAddress method is called on the returned JITSymbol. This allows
us to query for the existence of symbols without actually materializing them. In
the future I expect more information to be attached to the JITSymbol class, for
example whether the returned symbol is a weak or strong definition. This will
allow us to properly handle weak symbols and multiple definitions.

llvm-svn: 228557
2015-02-09 01:20:51 +00:00
Ramkumar Ramachandra
570fa73130 InstCombine: propagate nonNull through assume
Make assume (load (call|invoke) != null) set nonNull return attribute
for the call and invoke. Also include tests.

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

llvm-svn: 228556
2015-02-09 01:13:13 +00:00
Ramkumar Ramachandra
e9173d98c2 [emacs] Get llvm-mode to font-lock "personality"
Differential Revision: http://reviews.llvm.org/D7494

llvm-svn: 228555
2015-02-09 00:30:03 +00:00
David Blaikie
0ab351a78f Fix -Wuninitialized build by referencing the relevant ctor parameter instead of the base class member variable.
llvm-svn: 228554
2015-02-08 23:15:37 +00:00
Zachary Turner
71e3bf6e80 Make PDBSymbol's IPDBSymbol reference const.
llvm-svn: 228553
2015-02-08 22:53:53 +00:00
Sanjoy Das
9bd991cb84 Bugfix: ScalarEvolution incorrectly assumes that the start of certain
add recurrences don't overflow.

This change makes the optimization more restrictive.  It still assumes
that an overflowing `add nsw` is undefined behavior; and this change
will need revisiting once we have a consistent semantics for poison
values.

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

llvm-svn: 228552
2015-02-08 22:52:17 +00:00
Craig Topper
39e5a46fee [X86] Remove the remaining uses of memop from AVX and AVX2 instruction patterns. AVX and AVX2 can handle unaligned loads being folded so we can just use 'load'
llvm-svn: 228551
2015-02-08 22:38:25 +00:00
Benjamin Kramer
2f55b73a71 Metadata: Use <algorithm> to simplify code. NFC.
llvm-svn: 228550
2015-02-08 21:56:09 +00:00
Sanjay Patel
aab4929127 fix test attributes; this is an SSE2 test, not a Nehalem test
llvm-svn: 228546
2015-02-08 21:14:27 +00:00
Sanjay Patel
b2034cf7b4 fix test attributes; this is an x86-64 test, not a Nehalem test
llvm-svn: 228545
2015-02-08 21:10:40 +00:00
Sanjay Patel
46a1da8b0e fix test attributes; these are SSE2 tests, not Nehalem tests
llvm-svn: 228544
2015-02-08 21:05:03 +00:00
David Blaikie
b1d9c1be95 Kaleidoscope-Orc: Reuse the IRGen utility function in later chapters, and remove an unused parameter.
llvm-svn: 228543
2015-02-08 21:03:30 +00:00
Zachary Turner
754851ad80 DebugInfoPDB: Make the symbol base case hold an IPDBSession ref.
Dumping a symbol often requires access to data that isn't inside
the symbol hierarchy, but which is only accessible through the
top-level session.  This patch is a pure interface change to give
symbols a reference to the session.

llvm-svn: 228542
2015-02-08 20:58:09 +00:00
Sanjay Patel
091da2db42 fix test attributes; these are SSE2 tests, not Nehalem tests
llvm-svn: 228541
2015-02-08 20:50:58 +00:00
David Blaikie
518f29b489 Kaleidoscope-Orc: Extract IRGen work into a utility function.
llvm-svn: 228539
2015-02-08 20:29:28 +00:00
David Blaikie
1f9ab7d592 Constify the Orc Kaleidoscope examples IRGen functions.
llvm-svn: 228537
2015-02-08 20:15:01 +00:00
Sanjay Patel
fea32fd7dc fix test attributes; these are x86-64 tests, not Nehalem tests
llvm-svn: 228536
2015-02-08 20:05:53 +00:00
Sanjay Patel
fe04920f0e fix test attributes; these are MMX tests, not Nehalem tests
llvm-svn: 228535
2015-02-08 20:01:12 +00:00
Sanjay Patel
880c5c4f36 fix test attributes; these are SSE2 tests, not Nehalem tests
llvm-svn: 228534
2015-02-08 19:50:55 +00:00
Sanjay Patel
c25859ef62 generalize test; nothing Nehalem-specific here
llvm-svn: 228532
2015-02-08 19:38:25 +00:00
Lang Hames
0d443d6653 [Orc][Kaleidoscope] Build Kaleidoscope/Orc tutorials with warnings.
llvm-svn: 228531
2015-02-08 19:15:33 +00:00
Lang Hames
c5bd46a2c2 [Orc][Kaleidoscope] Remove fixed sized buffers from string conversion code and
further c++ify the Kaleidoscope/Orc tutorials.

llvm-svn: 228530
2015-02-08 19:14:56 +00:00
Sanjay Patel
5093636637 fix typos; NFC
llvm-svn: 228529
2015-02-08 18:54:22 +00:00
Simon Pilgrim
c65658ff6d [X86][AVX2] AVX2 broadcast + permute memory folding tests.
llvm-svn: 228528
2015-02-08 18:33:13 +00:00
Zachary Turner
d65edd8565 Make UTF8->UTF16 conversion null terminate output on empty input.
llvm-svn: 228527
2015-02-08 18:08:51 +00:00
Simon Pilgrim
9fae6cc7c6 Moved AVX2 vbroadcast (reg) instruction foldings under the correct grouping. NFC.
llvm-svn: 228526
2015-02-08 17:13:54 +00:00
Bjorn Steinbrink
a6a56743c3 Correctly combine alias.scope metadata by a union instead of intersecting
Summary:
The alias.scope metadata represents sets of things an instruction might
alias with. When generically combining the metadata from two
instructions the result must be the union of the original sets, because
the new instruction might alias with anything any of the original
instructions aliased with.

Reviewers: hfinkel

Subscribers: llvm-commits

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

llvm-svn: 228525
2015-02-08 17:07:14 +00:00
NAKAMURA Takumi
fe49ccef6f [CMake] Kaleidoscope-Orc: Update libdeps.
llvm-svn: 228524
2015-02-08 11:15:08 +00:00
Elena Demikhovsky
40c204cf7d Masked Gather and Scatter Intrinsics.
Gather and Scatter are new introduced intrinsics, comming after recently implemented masked load and store.
This is the first patch for Gather and Scatter intrinsics. It includes only the syntax, parsing and verification.

Gather and Scatter intrinsics allow to perform multiple memory accesses (read/write) in one vector instruction.
The intrinsics are not target specific and will have the following syntax:
Gather:
declare <16 x i32> @llvm.masked.gather.v16i32(<16 x i32*> <vector of ptrs>, i32 <alignment>, <16 x i1> <mask>, <16 x i32> <passthru>)
declare <8 x float> @llvm.masked.gather.v8f32(<8 x float*><vector of ptrs>, i32 <alignment>, <8 x i1> <mask>, <8 x float><passthru>)

Scatter:
declare void @llvm.masked.scatter.v8i32(<8 x i32><vector value to be stored> , <8 x i32*><vector of ptrs> , i32 <alignment>, <8 x i1> <mask>)
declare void @llvm.masked.scatter.v16i32(<16 x i32> <vector value to be stored> , <16 x i32*> <vector of ptrs>, i32 <alignment>, <16 x i1><mask> )

Vector of ptrs - a set of source/destination addresses, to load/store the value. 
Mask - switches on/off vector lanes to prevent memory access for switched-off lanes
vector of ptrs, value and mask should have the same vector width.

These are code examples where gather / scatter should be used and will allow function vectorization
;void foo1(int * restrict A, int * restrict B, int * restrict C) {
; for (int i=0; i<SIZE; i++) {
; A[i] = B[C[i]];
; }
;}

;void foo3(int * restrict A, int * restrict B) {
; for (int i=0; i<SIZE; i++) {
; A[B[i]] = i+5;
; }
;}

Tests will come in the following patches, with CodeGen and Vectorizer.

http://reviews.llvm.org/D7433

llvm-svn: 228521
2015-02-08 08:27:19 +00:00
David Blaikie
e5a2bce6c8 Add CMake build support for Orc examples (& fix some clang -Werror build
breaks due to unused variables).

llvm-svn: 228520
2015-02-08 07:20:04 +00:00
Lang Hames
40b2958350 [Orc][Kaleidoscope] Fix method-name think-o. NFC.
llvm-svn: 228519
2015-02-08 04:34:13 +00:00
Tim Northover
78c64c2e1c ARM & AArch64: teach LowerVSETCC that output type size may differ from input.
While various DAG combines try to guarantee that a vector SETCC
operation will have the same output size as input, there's nothing
intrinsic to either creation or LegalizeTypes that actually guarantees
it, so the function needs to be ready to handle a mismatch.

Fortunately this is easy enough, just extend or truncate the naturally
compared result.

I couldn't reproduce the failure in other backends that I know have
SIMD, so it's probably only an issue for these two due to shared
heritage.

Should fix PR21645.

llvm-svn: 228518
2015-02-08 00:50:47 +00:00
Zachary Turner
6fb87b6e2d Removed unused function mistakenly left in, triggering -Werror.
llvm-svn: 228517
2015-02-08 00:41:31 +00:00