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

135421 Commits

Author SHA1 Message Date
David Majnemer
b6d3704975 [LoopUnrollAnalyzer] Handle out of bounds accesses in visitLoad
While we handed loads past the end of an array, we didn't handle loads
_before_ the array.

This fixes PR28062.

N.B. While the bug in the code is obvious, I am struggling to craft a
test case which is reasonable in size.

llvm-svn: 276510
2016-07-23 02:56:49 +00:00
Sanjoy Das
d06246dfe7 [SCEV] Make isImpliedCondOperandsViaRanges smarter
This change lets us prove things like

  "{X,+,10} s< 5000" implies "{X+7,+,10} does not sign overflow"

It does this by replacing replacing getConstantDifference by
computeConstantDifference (which is smarter) in
isImpliedCondOperandsViaRanges.

llvm-svn: 276505
2016-07-23 00:54:36 +00:00
Vedant Kumar
f67bc851fc [cmake] Use a sane default for LLVM_PROFILE_DATA_DIR
It's been pointed out that arbitrarily spraying raw profiles into a
build directory is insane. Doing this wastes a tremendous amount of
space and is also very lossy, since the test harness tends to wipe away
temporary sub-directories (which usually contain relevant profile data).

The new default is a `profiles` directory inside of the build dir.

llvm-svn: 276504
2016-07-23 00:38:11 +00:00
Sanjoy Das
e3099f488a [SCEV] Change the interface of computeConstantDifference; NFC
This is in preparation of
s/getConstantDifference/computeConstantDifference/ in a later change.

llvm-svn: 276503
2016-07-23 00:28:56 +00:00
Sanjay Patel
d0485934bc [InstCombine] move udiv+cmp fold over with other BinOp+cmp folds; NFCI
llvm-svn: 276502
2016-07-23 00:28:39 +00:00
Sanjay Patel
b0b41be26d auto-generate checks
llvm-svn: 276501
2016-07-23 00:09:54 +00:00
Tom Stellard
09e97d1cbb Revert "[AMDGPU] Emit read-only data to .rodata for hsa"
This reverts commit r276298.

Data stored in .rodata can have a negative offset from .text, but we
don't support negative values in relocations yet.

This caused a regression in one of the amp conformance tests:
5_Data_Cont/5_2_a_v/5_2_3_m/Assignment/Test.02.01

llvm-svn: 276498
2016-07-22 23:46:40 +00:00
Adam Nemet
0ec37e745a [LoopDataPrefetch] Fix unused variable in release build
llvm-svn: 276491
2016-07-22 23:08:10 +00:00
Adam Nemet
1c839e0506 [LoopDataPrefetch] Include hotness of region in opt remark
llvm-svn: 276488
2016-07-22 22:53:17 +00:00
Adam Nemet
22340b9cbd [LoopDataPrefetch] Sort headers
llvm-svn: 276487
2016-07-22 22:53:12 +00:00
George Burgess IV
e76f5c4b33 [CFLAA] Add more offset-sensitivity tracking.
This patch teaches FunctionInfo about offsets.

Like the last patch, this one doesn't introduce any visible
functionality change (the core algorithm knows nothing about offsets;
they're just plumbed through). Tests will come when we start acting
differently because of the offsets.

Patch by Jia Chen.

(N.B. I made a tiny change to Jia's patch to avoid warnings by GCC: I
put DenseMapInfo specializations in the `llvm` namespace. Only realized
that those appeared when compiling locally. :) )

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

llvm-svn: 276486
2016-07-22 22:30:48 +00:00
Sanjay Patel
dcaeebff4f add tests for icmp vector folds
llvm-svn: 276482
2016-07-22 22:19:52 +00:00
Tim Northover
4c332c49f1 GlobalISel: allow multiple types on MachineInstrs.
llvm-svn: 276481
2016-07-22 22:13:36 +00:00
Vitaly Buka
fe894453fe Unpoison stack before resume instruction
Summary:
Clang inserts cleanup code before resume similar way as before return instruction.
This makes asan poison local variables causing false use-after-scope reports.

__asan_handle_no_return does not help here as it was executed before
llvm.lifetime.end inserted into resume block.

To avoid false report we need to unpoison stack for resume same way as for return.

PR27453

Reviewers: kcc, eugenis

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

llvm-svn: 276480
2016-07-22 22:04:38 +00:00
Alina Sbirlea
587d579c84 Add flag to PassManagerBuilder to disable GVN Hoist Pass.
Summary:
Adding a flag to diable GVN Hoisting by default.
Note: The GVN Hoist Pass causes some Halide tests to hang. Halide will disable the pass while investigating.

Reviewers: llvm-commits, chandlerc, spop, dberlin

Subscribers: mehdi_amini

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

llvm-svn: 276479
2016-07-22 22:02:19 +00:00
Michael Kuperstein
cf125cd0ce [SLPVectorizer] Vectorize reverse-order loads in horizontal reductions
When vectorizing a tree rooted at a store bundle, we currently try to sort the
stores before building the tree, so that the stores can be vectorized. For other
trees, the order of the root bundle - which determines the order of all other
bundles - is arbitrary. That is bad, since if a leaf bundle of consecutive loads
happens to appear in the wrong order, we will not vectorize it.

This is partially mitigated when the root is a binary operator, by trying to
build a "reversed" tree when that's considered profitable. This patch extends the
workaround we have for binops to trees rooted in a horizontal reduction.

This fixes PR28474.

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

llvm-svn: 276477
2016-07-22 21:28:48 +00:00
Sanjay Patel
cefd5ab11e add tests for icmp vector folds
llvm-svn: 276476
2016-07-22 21:28:20 +00:00
Sanjay Patel
262eed8e23 add tests for icmp vector folds
llvm-svn: 276475
2016-07-22 21:13:08 +00:00
Vedant Kumar
c8566f811b [Coverage] Mark more methods const (NFC)
llvm-svn: 276474
2016-07-22 21:11:55 +00:00
Sanjay Patel
42b108b535 add tests for icmp vector folds
llvm-svn: 276472
2016-07-22 21:02:33 +00:00
Anna Thomas
70e110c227 Add invariant start call creation in IRBuilder.NFC
Differential Revision: https://reviews.llvm.org/D22700

llvm-svn: 276471
2016-07-22 20:57:23 +00:00
Pete Cooper
a18d1734a0 Use RValue refs in APInt add/sub methods.
This adds versions of operator + and - which are optimized for the LHS/RHS of the
operator being RValue's.  When an RValue is available, we can use its storage space
instead of allocating new space.

On code such as ConstantRange which makes heavy use of APInt's over 64-bits in size,
this results in significant numbers of saved allocations.

Thanks to David Blaikie for all the review and most of the code here.

llvm-svn: 276470
2016-07-22 20:55:46 +00:00
Vedant Kumar
fa48858cb0 [llvm-cov] Don't copy stylesheets into index files
Just link in the stylesheet from the toplevel dir of the report.

llvm-svn: 276468
2016-07-22 20:49:23 +00:00
Sanjoy Das
a909ee1bd8 [SCEV] Extract out a helper function; NFC
The helper will get smarter in a later change, but right now this is
just code reorganization.

llvm-svn: 276467
2016-07-22 20:47:55 +00:00
Sanjay Patel
b927c04180 update to use FileCheck and auto-generate checks
llvm-svn: 276466
2016-07-22 20:39:07 +00:00
George Burgess IV
36f8c441dc Fix include case. NFC.
llvm-svn: 276465
2016-07-22 20:15:19 +00:00
Sanjay Patel
fe9aad543e add tests for icmp vector folds
llvm-svn: 276464
2016-07-22 20:11:08 +00:00
Zachary Turner
eca8d34bfd Make DebugInfoMsf a dependency of DebugInfoPDBTests.
For some reason this doesn't cause linker errors with MSVC or
clang-cl, but the bots seem to be failing with other compilers.

llvm-svn: 276463
2016-07-22 20:05:30 +00:00
Tim Northover
e35b03e144 GlobalISel: implement legalization pass, with just one transformation.
This adds the actual MachineLegalizeHelper to do the work and a trivial pass
wrapper that legalizes all instructions in a MachineFunction. Currently the
only transformation supported is splitting up a vector G_ADD into one acting on
smaller vectors.

llvm-svn: 276461
2016-07-22 20:03:43 +00:00
Zachary Turner
985ee30b2c Make PDBFile store an msf::Layout.
Previously it was storing all the fields of an msf::Layout as
separate members.  This is a trivial cleanup to make it store
an msf::Layout directly.  This makes the code more readable
since it becomes clear which fields of PDBFile are actually the
msf specific layout information in a sea of other bookkeeping
fields.

llvm-svn: 276460
2016-07-22 19:56:33 +00:00
Zachary Turner
5565f30e4c [pdb] Have builders share a single BumpPtrAllocator.
This makes it easier to have the writable and readable PDB
interfaces share code since the read/write and write-only
interfaces now share a single allocator, you don't have to worry
about a builder building a read only interface and then having
the read-only interface's data become corrupt when the builder
goes out of scope.  Now the allocator is specified explicitly
to all constructors, so all interfaces can share a single allocator
that is scoped appropriately.

llvm-svn: 276459
2016-07-22 19:56:26 +00:00
Zachary Turner
de0ff2102f [msf] Create LLVMDebugInfoMsf
This provides a better layering of responsibilities among different
aspects of PDB writing code.  Some of the MSF related code was
contained in CodeView, and some was in PDB prior to this.  Further,
we were often saying PDB when we meant MSF, and the two are
actually independent of each other since in theory you can have
other types of data besides PDB data in an MSF.  So, this patch
separates the MSF specific code into its own library, with no
dependencies on anything else, and DebugInfoCodeView and
DebugInfoPDB take dependencies on DebugInfoMsf.

llvm-svn: 276458
2016-07-22 19:56:05 +00:00
Teresa Johnson
1562f29368 [llvm-ar] Document 'T' thin archive modifier (NFC)
llvm-svn: 276457
2016-07-22 19:41:00 +00:00
Teresa Johnson
6813bf2821 [ThinLTO/gold] Remove thin archive part of new test due to bot failures
I am getting a bot failure from the thin archive part of this test:

From
http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/40468/steps/test_llvm/logs/LLVM%20%3A%3A%20tools__gold__X86__thinlto_emit_linked_objects.ll:

Command Output (stderr):
--
/home/bb/cmake-llvm-x86_64-linux/build/./bin/llvm-ar: creating
/home/bb/cmake-llvm-x86_64-linux/build/test/tools/gold/X86/Output/thinlto_emit_linked_objects.ll.tmp2.a
/usr/bin/ld.gold: internal error in add_writer, at
../../gold/token.h:124

--

This appears to be an issue with an older version of gold. The test case
passes for me locally when I use the gold v1.12 I was testing with, but
when I tried the gold installed on my system which is v1.11 I get the
same error.

Remove the thin archive version of the test, since there isn't a way to
predicate it on gold version.

llvm-svn: 276453
2016-07-22 18:32:30 +00:00
Jun Bum Lim
f7d4b99429 Recommit - [DSE]Enhance shorthening MemIntrinsic based on OverlapIntervals
Recommiting r275571 after fixing crash reported in PR28270.
Now we erase elements of IOL in deleteDeadInstruction().

Original Summary:
This change use the overlap interval map built from partial overwrite tracking to perform shortening MemIntrinsics.
Add test cases which was missing opportunities before.

llvm-svn: 276452
2016-07-22 18:27:24 +00:00
Sanjay Patel
a2baf75a4a add tests for vector bit manipulation intrinsics
llvm-svn: 276451
2016-07-22 18:22:25 +00:00
Teresa Johnson
00cb55d094 [ThinLTO/gold] Support for getting list of included objects from gold
Summary:
In the distributed backend case, the ThinLink step and the final native
object link are separate processes. This can be problematic when archive
libraries are involved in the link (e.g. via --start-lib/--end-lib
pairs). The linker only includes objects from libraries when
there is a strong reference to them, and depending on the intervening
ThinLTO backend processes' importing/inlining, the strong references
may appear different in the two link steps. See D22356 and D22467
for two scenarios where this causes issues.

To ensure that the final link includes the same objects, this patch
adds support for an "=filename" form of the thinlto-index-only plugin
option, in which case objects gold included in the link are emitted to
the given filename. This should be used as input to the final link (e.g.
via the @filename option to gold), instead of listing all the objects
within --start-lib/--end-lib pairs again.

Note that the support for the gold callback that identifies included
objects was added in gold version 1.12.

Reviewers: davidxl, mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 276450
2016-07-22 18:20:22 +00:00
Wei Mi
95c770abfc [PM] Port BreakCriticalEdges to the new PM.
Differential Revision: https://reviews.llvm.org/D22688

llvm-svn: 276449
2016-07-22 18:04:25 +00:00
Anna Thomas
6f5ce86e80 Invariant start/end intrinsics overloaded for address space
Summary:
The llvm.invariant.start and llvm.invariant.end intrinsics currently
support specifying invariant memory objects only in the default address
space.

With this change, these intrinsics are overloaded for any adddress space
for memory objects
and we can use these llvm invariant intrinsics in non-default address
spaces.

Example: llvm.invariant.start.p1i8(i64 4, i8 addrspace(1)* %ptr)

This overloaded intrinsic is needed for representing final or invariant
memory in managed languages.

Reviewers: apilipenko, reames

Subscribers: llvm-commits
llvm-svn: 276447
2016-07-22 17:49:40 +00:00
Vedant Kumar
5af4b0792f [utils] Update coverage regression checking script
r276409 changed the coverage summary format. Update the script so that
it can parse the new output, and incorporate the new information into
its warnings.

llvm-svn: 276446
2016-07-22 17:38:03 +00:00
Krzysztof Parzyszek
c2b310d505 [Hexagon] Make HexagonCodeGen depend on Scalar
Hexagon backend uses LoopDataPrefetch pass that is defined in Scalar.

llvm-svn: 276441
2016-07-22 17:23:46 +00:00
Matt Arsenault
9fbc4e603d AMDGPU: Remove redundant test
llvm-svn: 276439
2016-07-22 17:01:36 +00:00
Matt Arsenault
5f79e9e697 AMDGPU: Fix groupstaticsize for large LDS
The size can exceed s_movk_i32's limit, and we don't
want to use it this early since it inhibits optimizations.

This should probably be merged to the release branch.

llvm-svn: 276438
2016-07-22 17:01:33 +00:00
Matt Arsenault
dc6f828a36 AMDGPU: Add HSA dispatch id intrinsic
llvm-svn: 276437
2016-07-22 17:01:30 +00:00
Matt Arsenault
bd4ed9f420 AMDGPU: Delete more dead code
Remove dead code from r600 intrinsic removal.
Remove unset members, rename StackSize to be less ambiguous.

llvm-svn: 276436
2016-07-22 17:01:25 +00:00
Matt Arsenault
b7536203de AMDGPU: Fix i1 fp_to_int
R600's i1 fp_to_uint selected but was incorrect according to
what instcombine constant folds to.

llvm-svn: 276435
2016-07-22 17:01:21 +00:00
Matt Arsenault
06bddd7410 AMDGPU: Don't reinvent transferSuccessorsAndUpdatePHIs
llvm-svn: 276434
2016-07-22 17:01:15 +00:00
Tim Northover
9663fe04b9 GlobalISel: implement alloca instruction
llvm-svn: 276433
2016-07-22 16:59:52 +00:00
Simon Pilgrim
75121ab2d6 [SelectionDAG] Optimization of BITREVERSE legalization for power-of-2 integer scalar/vector types
An extension of D19978, this patch replaces the default BITREVERSE evaluation of individual bit masks+shifts with block mask+shifts when we have integer elements of power-of-2 bits in size.

After calling BSWAP to reverse the order of the constituent bytes (which typically follows a similar approach), every neighbouring 4-bits, 2-bits and finally 1-bit pairs are masked off and swapped over with shifts.

In doing so we can significantly reduce the number of operations required.

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

llvm-svn: 276432
2016-07-22 16:46:25 +00:00
Xinliang David Li
495aee72c0 [Profile] Cleanup: remove unused interface
llvm-svn: 276431
2016-07-22 16:11:56 +00:00