Commit Graph

146189 Commits

Author SHA1 Message Date
Jonas Hahnfeld
31f4503532 [Support] Remove unit test for fs::is_local
rL295768 introduced this test that fails if LLVM is built and tested on
an NFS share. Delete the test as discussed on the corresponing commit
thread. The only feasible solution would have been to introduce
environment variables and to en/disable the test conditionally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297260 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-08 08:36:21 +00:00
Amjad Aboud
8cd8473e96 [SLP] Fixed non-deterministic behavior in Loop Vectorizer.
Differential Revision: https://reviews.llvm.org/D30638

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297257 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-08 05:09:10 +00:00
Tim Shen
2aec349a25 Revert "Revert "[PowerPC][ELFv2ABI] Allocate parameter area on-demand to reduce stack frame size""
After inspection, it's an UB in our code base. Someone cast a var-arg
function pointer to a non-var-arg one. :/

Re-commit r296771 to continue testing on the patch.

Sorry for the trouble!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297256 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-08 02:41:35 +00:00
Zachary Turner
732e67b306 Work around an ICE on MSVC 2017.
MSVC 2017 was released today, and I found one bug in the
compiler which prevents a successful build of LLVM.  This
patch works around the bug in a fairly benign way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297255 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-08 01:57:40 +00:00
Sebastian Pop
222cc006d9 Handle UnreachableInst in isGuaranteedToTransferExecutionToSuccessor
A block with an UnreachableInst does not transfer execution to a successor.
The problem was exposed by GVN-hoist. This patch fixes bug 32153.

Patch by Aditya Kumar.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297254 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-08 01:54:50 +00:00
Davide Italiano
22615bf638 [SCCP] Merge markOverdefined and markAnythingOverdefined.
There's no need to have two separate APIs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297253 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-08 01:26:37 +00:00
Justin Lebar
8a5da6d404 [NVPTX] Remove unnecessary isImageReadoOnly(), isImageWriteOnly(), & isImageReadWrite calls
This is repetition of isImage() function in NVPTXUtilities.cpp.

Patch by Briana Grace!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297252 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-08 01:14:15 +00:00
Matt Arsenault
f06f68a796 AMDGPU: Don't wait at end of block with a trivial successor
If there is only one successor, and that successor only
has one predecessor the wait can obviously be delayed until
uses or the end of the next block. This avoids code quality
regressions when there are trivial fallthrough blocks inserted
for structurization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297251 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-08 01:06:58 +00:00
Eli Friedman
9ac562c933 [DAGCombine] Simplify ISD::AND in GetDemandedBits.
This helps in cases involving bitfields where an AND is exposed by
legalization.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297249 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-08 00:56:35 +00:00
Matt Arsenault
fc8387b8d1 AMDGPU: Constant fold rcp node
When doing arcp optimization with a constant denominator,
this was leaving behind rcps with constant inputs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297248 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-08 00:48:46 +00:00
Konstantin Zhuravlyov
df032da7f1 [DebugInfo] Make legal and emit DW_OP_swap and DW_OP_xderef
Differential Revision: https://reviews.llvm.org/D29672


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297247 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-08 00:28:57 +00:00
Daniel Sanders
50ccd80b58 Fix additional constructor call missed by r297241.
It was added between my build+test and my commit.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297244 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 23:32:10 +00:00
Changpeng Fang
2e729706f1 AMDGPU/SI: Do not insert EndCf in an unreachable block
Reviewers:
  arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297243 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 23:29:36 +00:00
Sanjay Patel
70bc85f677 [InstCombine] shrink truncated insertelement into undef vector
This is the 2nd part of solving:
http://lists.llvm.org/pipermail/llvm-dev/2017-February/110293.html

D30123 moves the trunc ahead of the shuffle, and this moves the trunc ahead of the insertelement. 
We're limiting this transform to undef rather than any constant to avoid backend problems.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297242 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 23:27:14 +00:00
Daniel Sanders
35c6dd2400 Recommit: [globalisel] Change LLT constructor string into an LLT-based object that knows how to generate it.
Summary:
This will allow future patches to inspect the details of the LLT. The implementation is now split between
the Support and CodeGen libraries to allow TableGen to use this class without introducing layering concerns.

Thanks to Ahmed Bougacha for finding a reasonable way to avoid the layering issue and providing the version of this patch without that problem.

The problem with the previous commit appears to have been that TableGen was including CodeGen/LowLevelType.h instead of Support/LowLevelTypeImpl.h.

Reviewers: t.p.northover, qcolombet, rovka, aditya_nandakumar, ab, javed.absar

Subscribers: arsenm, nhaehnle, mgorny, dberris, llvm-commits, kristof.beyls

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297241 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 23:20:35 +00:00
Krzysztof Parzyszek
872fff124f [Hexagon] Check for presence before looking registers up in bit tracker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297240 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 23:12:04 +00:00
Krzysztof Parzyszek
cf301fc559 [Hexagon] Generate bitsplit instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297239 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 23:08:35 +00:00
Tim Northover
79f786fefd GlobalISel: use inserts for landingpad instead of sequences.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297237 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 23:04:06 +00:00
Evgeniy Stepanov
9616c18c37 Fix one-after-the-end type metadata handling in globalsplit.
Itanium ABI may have an address point one byte after the end of a
vtable. When such vtable global is split, the !type metadata needs to
follow the right vtable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297236 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 22:18:48 +00:00
Duncan P. N. Exon Smith
cb8ffd254b ADT: Fix SmallPtrSet iterators in reverse mode
Fix SmallPtrSet::iterator behaviour and creation ReverseIterate is true.

  - Any function that creates an iterator now uses
    SmallPtrSet::makeIterator, which creates an iterator that
    dereferences to the given pointer.

  - In reverse-iterate mode, initialze iterator::End with "CurArray"
    instead of EndPointer.

  - In reverse-iterate mode, the current node is iterator::Buffer[-1].
    iterator::operator* and SmallPtrSet::makeIterator are the only ones
    that need to know.

  - Fix the assertions for reverse-iterate mode.

This fixes the tests Danny B added in r297182, and adds a couple of
others to confirm that dereferencing does the right thing, regardless of
how the iterator was found, and that iteration works correctly from each
return from find.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297234 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 21:56:32 +00:00
Zachary Turner
dd8d300bd5 Fix source-lines test on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297233 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 21:53:21 +00:00
Sanjay Patel
b1dd2b4312 [InstCombine] shrink truncated splat shuffle (2nd try)
This was committed at r297155 and reverted at r297166 because of an
over-reaching clang test. That should be fixed with r297189.

This is one part of solving a recent bug report:
http://lists.llvm.org/pipermail/llvm-dev/2017-February/110293.html

This keeps with our general approach: changing arbitrary shuffles is off-limts,
but changing splat is ok. The transform is very similar to the existing
shrinkBitwiseLogic() canonicalization.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297232 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 21:45:16 +00:00
Chris Bieneman
f4f71cd77b [ObjectYAML] Fix issue with DWARF2 AddrSize 8
In my refactoring I introduced a bug where we were using the reference size instead of the offset size for DW_FORM_strp and similar forms.

This patch resolves the error and adds a test case testing all the DWARF forms for DWARF2 AddrSize 8. There is similar coverage already in the DWARFDebugInfoTest sources that covers the parser. Once I migrate the DWARFGenerator APIs to be built on the YAML tools they will be fully covered under the same tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297230 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 21:34:35 +00:00
Tim Northover
908d8eeae9 GlobalISel: fix legalization of G_INSERT
We were calculating incorrect extract/insert offsets by trying to be too
tricksy with min/max. It's clearer to just split the logic up into "register
starts before this segment" vs "after".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297226 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 21:24:33 +00:00
Simon Pilgrim
6e1685e3b1 Strip trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297225 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 21:16:38 +00:00
Gor Nishanov
2d33745172 [coroutines] Add handling for unwind coro.ends
Summary:
The purpose of coro.end intrinsic is to allow frontends to mark the cleanup and
other code that is only relevant during the initial invocation of the coroutine
and should not be present in resume and destroy parts.

In landing pads coro.end is replaced with an appropriate instruction to unwind to
caller. The handling of coro.end differs depending on whether the target is
using landingpad or WinEH exception model.

For landingpad based exception model, it is expected that frontend uses the
`coro.end`_ intrinsic as follows:

```
    ehcleanup:
      %InResumePart = call i1 @llvm.coro.end(i8* null, i1 true)
      br i1 %InResumePart, label %eh.resume, label %cleanup.cont

    cleanup.cont:
      ; rest of the cleanup

    eh.resume:
      %exn = load i8*, i8** %exn.slot, align 8
      %sel = load i32, i32* %ehselector.slot, align 4
      %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn, 0
      %lpad.val29 = insertvalue { i8*, i32 } %lpad.val, i32 %sel, 1
      resume { i8*, i32 } %lpad.val29

```
The `CoroSpit` pass replaces `coro.end` with ``True`` in the resume functions,
thus leading to immediate unwind to the caller, whereas in start function it
is replaced with ``False``, thus allowing to proceed to the rest of the cleanup
code that is only needed during initial invocation of the coroutine.

For Windows Exception handling model, a frontend should attach a funclet bundle
referring to an enclosing cleanuppad as follows:

```
    ehcleanup:
      %tok = cleanuppad within none []
      %unused = call i1 @llvm.coro.end(i8* null, i1 true) [ "funclet"(token %tok) ]
      cleanupret from %tok unwind label %RestOfTheCleanup
```

The `CoroSplit` pass, if the funclet bundle is present, will insert
``cleanupret from %tok unwind to caller`` before
the `coro.end`_ intrinsic and will remove the rest of the block.

Reviewers: majnemer

Reviewed By: majnemer

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297223 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 21:00:54 +00:00
Yaron Keren
debb02e97a Implement FreeMachineFunction::getPassName().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297222 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 20:59:08 +00:00
Ahmed Bougacha
360f1e7c17 [GlobalISel] Don't translate intrinsics with metadata parameters.
Some intrinsics take metadata parameters.  These all need custom
handling of some form, and cannot possibly be lowered generically to
G_INTRINSIC calls with vreg operands.
Reject them, instead of hitting an assert later in getOrCreateVReg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297209 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 20:53:09 +00:00
Ahmed Bougacha
12a80e817a [GlobalISel] Avoid invalidating ValToVReg when translating no-op bitcast.
When we translate a no-op (same type) bitcast, we try to be clever and
only emit a COPY if we already assigned a vreg to the defined value.
However, when we didn't, we tried to assign to a reference into the
ValToVReg DenseMap, even though the RHS of the assignment
(getOrCreateVReg) could potentially grow that DenseMap, invalidating the
reference.

Avoid that by getting the source vreg first.
I audited the rest of the translator; this is the only tricky case.

The test is quite unwieldy, as the problem is caused by the DenseMap
growing, which happens after the 47th mapped value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297208 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 20:53:06 +00:00
Ahmed Bougacha
429811130e [GlobalISel] Relax vector G_SELECT assertion.
For vector operands, the `select` instruction supports both vector and
non-vector conditions.  The MIR builder had an overly restrictive
assertion, that only accepted vector conditions for vector selects
(in effect implementing ISD::VSELECT).

Make it possible to express the full range of G_SELECTs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297207 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 20:53:03 +00:00
Ahmed Bougacha
fa62d55710 [GlobalISel] Add vector select translation test. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297206 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 20:53:00 +00:00
Ahmed Bougacha
027104480a [GlobalISel] Slightly clean up DBG_VALUE FP build code.
I messed up my rebases leading to r297200, and ended up with stale (but
working) code.  Fix it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297205 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 20:52:57 +00:00
Vitaly Buka
c3e4809203 [fuzzer] Don't crash if LLVMFuzzerMutate was called by CustomCrossOver
Reviewers: kcc

Subscribers: llvm-commits, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297202 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 20:37:38 +00:00
Ahmed Bougacha
80a7dbae8f [GlobalISel] Ignore %noreg when applying default regbank mapping.
When computing the mapping for non-generic instructions, we skipped
%noreg operands, because we can't always reason about their banks.

Also skip them when applying the mapping.  Otherwise, we could end
up with mappings that we can't apply.

While there, duplicate an assert to distinguish between the two
error conditions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297201 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 20:34:23 +00:00
Ahmed Bougacha
e8bbfecd51 [GlobalISel] Emit DBG_VALUE %noreg for non-int/fp constant values.
When a dbg_value has a constant operand that isn't representable in MI,
there isn't much we can do.  Use %noreg (0) for those situations.
This matches the SelectionDAG behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297200 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 20:34:20 +00:00
Ahmed Bougacha
cf71edc74d [GlobalISel] Add constant dbg.value translation tests. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297199 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 20:34:13 +00:00
Artem Belevich
85cbde2b32 [NVPTX] Fixed lowering of unaligned loads/stores of f16 scalars and vectors.
Differential Revision: https://reviews.llvm.org/D30672

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297198 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 20:33:38 +00:00
Arnold Schwaighofer
c20464cdad SjLjEHPrepare: Fix the pass for swifterror arguments
We cannot leave the identity copies 'select true, arg, undef' that this pass
inserts for arguments to simplify handling of values on swifterror arguments.

swifterror arguments have restrictions on their uses.

rdar://30839288

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297197 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 20:29:02 +00:00
Arnold Schwaighofer
43959eee19 Fix bugpoint to work with swifterror values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297196 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 20:28:59 +00:00
Konstantin Zhuravlyov
6b149f36d5 llvm-objdump: handle line numbers and source options for amdgpu objects
Differential Revision: https://reviews.llvm.org/D30679


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297193 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 20:17:11 +00:00
Konstantin Zhuravlyov
0578f3744f Fix C2712 build error on Windows
Move the __try/__except block outside of the set_thread_name function to avoid a conflict with object unwinding due to the use of the llvm::Storage.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297192 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 20:09:46 +00:00
Joel Jones
18b5c0bc71 [AArch64] Vulcan is now ThunderXT99
Broadcom Vulcan is now Cavium ThunderX2T99.

LLVM Bugzilla: http://bugs.llvm.org/show_bug.cgi?id=32113

Minor fixes for the alignments of loops and functions for
ThunderX T81/T83/T88 (better performance).

Patch was tested with SpecCPU2006.

Patch by Stefan Teleman

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297190 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 19:42:40 +00:00
Daniel Sanders
428e17c613 Revert r297177: Change LLT constructor string into an LLT-based object ...
More module problems. This time it only showed up in the stage 2 compile of
clang-x86_64-linux-selfhost-modules-2 but not the stage 1 compile.

Somehow, this change causes the build to need Attributes.gen before it's been
generated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297188 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 19:21:23 +00:00
Xin Tong
928a5d4eba [JumpThread] Simplify CmpInst-as-Condition branch-folding a bit.
Summary: Simplify CmpInst-as-Condition branch-folding a bit.

Reviewers: sanjoy, efriedma

Reviewed By: efriedma

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297186 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 18:59:09 +00:00
Pirama Arumuga Nainar
beecea156f [cmake] Include openmp with add_llvm_external_project
Summary:
Include projects/openmp into the build using add_llvm_external_project
instead of add_subdirectory.  This creates an option
LLVM_TOOL_OPENMP_BUILD that selects whether this project gets included
in an in-tree build.

Reviewers: beanz, AndreyChurbanov, jlpeyton

Subscribers: srhines, openmp-commits, llvm-commits, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297185 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 18:54:17 +00:00
Chris Bieneman
da6d07a965 [ObjectYAML] Add support for DWARF5 Unit header
In DWARF5 the Unit header added a new field, UnitType, and swapped the order of the address size and abbreviation offset fields.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297183 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 18:50:58 +00:00
Daniel Berlin
05382afa99 Add unit tests for changes to SmallPtrSet and PointerLikeTypeTraits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297182 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 18:47:52 +00:00
Daniel Berlin
434e38630c Add PointerLikeTypeTraits for const things, as long as there is one for the non-const version. Clang and other users have a number of types they use as pointers, and this avoids having to define both const and non-const versions of PointerLikeTraits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297181 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 18:47:50 +00:00
Daniel Berlin
3ebefaf7d2 Make SmallPtrSet count and find able to take const PtrType's
Summary:
For our set/map types, count/find normally take const references.
This works well for non-pointer types, but can suck for pointer
types.

DenseSet<int *> foo;
const int *b = nullptr;
foo.count(b) does not work

but the equivalent reference version does work
(patch to fix DenseSet/DenseMap coming up)
For SmallPtrSet, you have no such option.

The following will not work right now:
SmallPtrSet<int *> foo;
const int *b = nullptr;
foo.count(b);

This makes const correctness hard in some cases.
Example:
SmallPtrSet<Instruction *> InstructionsToErase;

You can't make this SmallPtrSet<const Instruction *> because then you
can't erase the instruction.  If I want to see if something is in the
set, I may only have a const Instruction *.  Given that count and find
are non-mutating, this should just work.

The places in our code base that do this resort to const_cast :(.

This patch makes count and find able to be used with const Instruction
* in the above SmallPtrSet examples.

This is a bit annoying because of where C++ applies the const, so we
have to remove the pointer type from the passed-in-type and rebuild it
with const.

Reviewers: dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297180 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 18:47:48 +00:00
Matthew Simpson
30bc56bd3c [LV] Consider users that are memory accesses in uniforms expansion step
When expanding the set of uniform instructions beyond the seed instructions
(e.g., consecutive pointers), we mark a new instruction uniform if all its
loop-varying users are uniform. We should also allow users that are consecutive
or interleaved memory accesses. This fixes cases where we have an instruction
that is used as the pointer operand of a consecutive access but also used by a
non-memory instruction that later becomes uniform as part of the expansion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297179 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 18:47:30 +00:00