OSDN Git Service
Eric Christopher [Thu, 29 Jun 2017 23:28:47 +0000 (23:28 +0000)]
To help readability of mightUseCTR pull out the inline asm handling support into a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306762
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 29 Jun 2017 23:28:45 +0000 (23:28 +0000)]
Make the PPCCTRLoops pass depend on being able to access the TargetMachine and clean up accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306761
91177308-0d34-0410-b5e6-
96231b3b80d8
Taewook Oh [Thu, 29 Jun 2017 23:11:24 +0000 (23:11 +0000)]
Remove redundant copy in recurrences
Summary:
If there is a chain of instructions formulating a recurrence, commuting operands can help removing a redundant copy. In the following example code,
```
BB#1: ; Loop Header
%vreg0<def> = COPY %vreg13<kill>; GR32:%vreg0,%vreg13
...
BB#6: ; Loop Latch
%vreg2<def> = COPY %vreg15<kill>; GR32:%vreg2,%vreg15
%vreg10<def,tied1> = ADD32rr %vreg1<kill,tied0>, %vreg0<kill>, %EFLAGS<imp-def,dead>; GR32:%vreg10,%vreg1,%vreg0
%vreg3<def,tied1> = ADD32rr %vreg2<kill,tied0>, %vreg10<kill>, %EFLAGS<imp-def,dead>; GR32:%vreg3,%vreg2,%vreg10
CMP32ri8 %vreg3, 10, %EFLAGS<imp-def>; GR32:%vreg3
%vreg13<def> = COPY %vreg3<kill>; GR32:%vreg13,%vreg3
JL_1 <BB#1>, %EFLAGS<imp-use,kill>
```
Existing two-address generation pass generates following code:
```
BB#1:
%vreg0<def> = COPY %vreg13<kill>; GR32:%vreg0,%vreg13
...
BB#6:
Predecessors according to CFG: BB#5 BB#4
%vreg2<def> = COPY %vreg15<kill>; GR32:%vreg2,%vreg15
%vreg10<def> = COPY %vreg1<kill>; GR32:%vreg10,%vreg1
%vreg10<def,tied1> = ADD32rr %vreg10<tied0>, %vreg0<kill>, %EFLAGS<imp-def,dead>; GR32:%vreg10,%vreg0
%vreg3<def> = COPY %vreg10<kill>; GR32:%vreg3,%vreg10
%vreg3<def,tied1> = ADD32rr %vreg3<tied0>, %vreg2<kill>, %EFLAGS<imp-def,dead>; GR32:%vreg3,%vreg2
CMP32ri8 %vreg3, 10, %EFLAGS<imp-def>; GR32:%vreg3
%vreg13<def> = COPY %vreg3<kill>; GR32:%vreg13,%vreg3
JL_1 <BB#1>, %EFLAGS<imp-use,kill>
JMP_1 <BB#7>
```
This is suboptimal because the assembly code generated has a redundant copy at the end of #BB6 to feed %vreg13 to BB#1:
```
.LBB0_6:
addl %esi, %edi
addl %ebx, %edi
cmpl $10, %edi
movl %edi, %esi
jl .LBB0_1
```
This redundant copy can be elimiated by making instructions in the recurrence chain to compute the value "into" the register that actually holds the feedback value. In this example, this can be achieved by commuting %vreg0 and %vreg1 to compute %vreg10. With that change, code after two-address generation becomes
```
BB#1:
%vreg0<def> = COPY %vreg13<kill>; GR32:%vreg0,%vreg13
...
BB#6: derived from LLVM BB %bb7
Predecessors according to CFG: BB#5 BB#4
%vreg2<def> = COPY %vreg15<kill>; GR32:%vreg2,%vreg15
%vreg10<def> = COPY %vreg0<kill>; GR32:%vreg10,%vreg0
%vreg10<def,tied1> = ADD32rr %vreg10<tied0>, %vreg1<kill>, %EFLAGS<imp-def,dead>; GR32:%vreg10,%vreg1
%vreg3<def> = COPY %vreg10<kill>; GR32:%vreg3,%vreg10
%vreg3<def,tied1> = ADD32rr %vreg3<tied0>, %vreg2<kill>, %EFLAGS<imp-def,dead>; GR32:%vreg3,%vreg2
CMP32ri8 %vreg3, 10, %EFLAGS<imp-def>; GR32:%vreg3
%vreg13<def> = COPY %vreg3<kill>; GR32:%vreg13,%vreg3
JL_1 <BB#1>, %EFLAGS<imp-use,kill>
JMP_1 <BB#7>
```
and the final assembly does not have redundant copy:
```
.LBB0_6:
addl %edi, %eax
addl %ebx, %eax
cmpl $10, %eax
jl .LBB0_1
```
Reviewers: qcolombet, MatzeB, wmi
Reviewed By: wmi
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31821
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306758
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Shen [Thu, 29 Jun 2017 23:08:38 +0000 (23:08 +0000)]
[ThinkLTO] Invoke build(Thin)?LTOPreLinkDefaultPipeline.
Previously it doesn't actually invoke the designated new PM builder
functions.
This patch moves NameAnonGlobalPass out from PassBuilder, as Chandler
points out that PassBuilder is used for non-O0 builds, and for
optimizations only.
Differential Revision: https://reviews.llvm.org/D34728
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306756
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Thu, 29 Jun 2017 22:57:37 +0000 (22:57 +0000)]
[CFLAA] Remove unneded function declaration. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306754
91177308-0d34-0410-b5e6-
96231b3b80d8
Dinar Temirbulatov [Thu, 29 Jun 2017 21:56:33 +0000 (21:56 +0000)]
[SLPVectorizer] Moving Entry->NeedToGather check out of inner loop,
since it is invariant there. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306749
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Thu, 29 Jun 2017 20:59:47 +0000 (20:59 +0000)]
Revert "[mips] Fix multiprecision arithmetic."
This reverts commit r305389. This broke chromium builds, so reverting
while I investigate further.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306741
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 29 Jun 2017 20:43:35 +0000 (20:43 +0000)]
[AArch64] Silence an unused variable warning in Release builds. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306738
91177308-0d34-0410-b5e6-
96231b3b80d8
Keno Fischer [Thu, 29 Jun 2017 20:28:59 +0000 (20:28 +0000)]
[CodeGenPrepare] Don't create inttoptr for ni ptrs
Summary:
Arguably non-integral pointers probably shouldn't show up here at all,
but since the backend doesn't complain and this takes valid (according
to the Verifier) IR and makes it invalid, make sure not to introduce
any inttoptr instructions if we're dealing with non-integral pointers.
Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D33110
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306737
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 29 Jun 2017 20:15:08 +0000 (20:15 +0000)]
Attempt to fix Orc JIT test timeouts
I think there are some destruction ordering issues here. The
ShouldDelete map seems to be getting destroyed before the shared_ptr
deleter lambda accesses it. In any case, this avoids inserting elements
into the map during shutdown.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306736
91177308-0d34-0410-b5e6-
96231b3b80d8
Spyridoula Gravani [Thu, 29 Jun 2017 20:13:05 +0000 (20:13 +0000)]
[DWARF] Added verification checks for the .apple_names section.
This patch verifies the number of atoms, the validity of the form for each atom, as well as the validity of the
hashdata. For hashdata, we're verifying that the hashdata offset is correct and that the offset in the .debug_info for
each DIE in the hashdata is also valid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306735
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Clegg [Thu, 29 Jun 2017 19:35:17 +0000 (19:35 +0000)]
Remove `inline` keyword from inline `classof` methods
The style guide states that the explicit `inline`
should not be used with inline methods. classof is
very common inline method with a fair amount on
inconsistency:
$ git grep classof ./include | grep inline | wc -l
230
$ git grep classof ./include | grep -v inline | wc -l
257
I chose to target this method rather the larger change
since this method is easily cargo-culted (I did it at
least once). I considered doing the larger change and
removing all occurrences but that would be a much larger
change.
Differential Revision: https://reviews.llvm.org/D33906
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306731
91177308-0d34-0410-b5e6-
96231b3b80d8
Keno Fischer [Thu, 29 Jun 2017 19:13:11 +0000 (19:13 +0000)]
[AliasSetTracker] Don't drop AA MD so eagerly
Summary:
When we have patterns like
loop:
%la = load %ptr, !tbaa
%lba = load %ptr, !tbaa !noalias
AliasSetTracker would previously think that the two types of annotation for
the pointer conflict, dropping both for the purpose of determining alias sets.
That is clearly way too conservative, as the tbaa is still valid whether or
not one of the memory accesses has additional AA metadata. We could go
one step further and attempt to properly merge the AA metadata,
but it's not clear that that would be worth it since that may introduce
additional MD nodes, which may be undesirable since this is merely an
Analysis.
Reviewers: hfinkel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32139
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306727
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gesiak [Thu, 29 Jun 2017 18:56:25 +0000 (18:56 +0000)]
[opt-viewer] Add progress indicators (PR33522)
Summary:
Provide feedback to users of opt-diff.py, opt-stats.py, and opt-viewer.py,
on how many YAML files have finished being processed, and how many HTML
files have been generated. This feedback is particularly helpful for
opt-viewer.py, which may take a long time to complete when given many
large YAML files as input.
The progress indicators use simple output such as the following:
```
Reading YAML files...
9 of 1197
```
Test plan:
Run `utils/opt-viewer/opt-*.py` on a CentOS and macOS machine, using
Python 3.4 and Python 2.7 respectively, and ensure the output is
formatted well on both.
Reviewers: anemet, davidxl
Reviewed By: anemet
Subscribers: simon.f.whittaker, llvm-commits
Differential Revision: https://reviews.llvm.org/D34735
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306726
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexandre Isoard [Thu, 29 Jun 2017 18:48:56 +0000 (18:48 +0000)]
Reverting r306695 while investigating failing test case.
Failing test case:
Transforms/LoopVectorize.iv_outside_user.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306723
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gesiak [Thu, 29 Jun 2017 18:47:31 +0000 (18:47 +0000)]
[opt-viewer] Python 3 support in opt-viewer.py
Summary:
Minor changes that allow opt-stats.py to support both Python 2 and 3.
In addition to the same dictionary iterator changes that were necessary
in https://reviews.llvm.org/D34564, this diff also:
* Explcitly converts strings to bytes when reading from and writing to stdin
and stdout.
* No longer uses dictionaries as a sort key for optimization remarks.
Dictionary sort order in Python 2 is pretty esoteric anyway, so it's
not clear that the additional sorting had a benefit for end users
(for details, https://stackoverflow.com/a/
3484456/679254 is a good
resource on Python 2 dictionary sort order).
Reviewers: anemet, davidxl
Reviewed By: anemet
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34647
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306720
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Clegg [Thu, 29 Jun 2017 18:29:05 +0000 (18:29 +0000)]
llvm-nm: Add support for symbol demangling (-C/--demangle)
Differential Revision: https://reviews.llvm.org/D34668
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306718
91177308-0d34-0410-b5e6-
96231b3b80d8
Xin Tong [Thu, 29 Jun 2017 18:04:31 +0000 (18:04 +0000)]
[OrderedInst] Add const to constant parameter. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306717
91177308-0d34-0410-b5e6-
96231b3b80d8
Hiroshi Inoue [Thu, 29 Jun 2017 18:03:28 +0000 (18:03 +0000)]
fix trivial typo, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306716
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Kuderski [Thu, 29 Jun 2017 17:53:35 +0000 (17:53 +0000)]
[Dominators] Rearrange access specifiers in DominatorTreeBase
Summary:
This patch makes DominatorTreeBase more readable by putting most important members on top of the class.
Before, the class looked like that: private -> protected (including data members) -> public -> protected.
The patch changes it to: protected (data members only) -> public -> protected -> public.
Reviewers: dberlin, sanjoy, chandlerc
Reviewed By: dberlin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34527
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306714
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Kuderski [Thu, 29 Jun 2017 17:50:19 +0000 (17:50 +0000)]
[Dominators] Remove DominatorBase class
Summary:
DominatorBase class was only used by DominatorTreeBase. It didn't provide any useful abstractions, nor simplified anything, so I see no point keeping it.
This commit removes the DominatorBase class and moves its content into DominatorTreeBase.
This is the first patch in a series that tries to make all DomTrees have a single virtual root, which will allow to further simplify code (especially when it comes to incremental updates).
Reviewers: dberlin, sanjoy, chandlerc
Reviewed By: dberlin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34493
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306713
91177308-0d34-0410-b5e6-
96231b3b80d8
Xin Tong [Thu, 29 Jun 2017 17:48:12 +0000 (17:48 +0000)]
Remove useless header. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306712
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Kuderski [Thu, 29 Jun 2017 17:45:51 +0000 (17:45 +0000)]
[Dominators] Add parent and sibling property verification (non-hacky)
Summary:
This patch adds an additional level of verification - it checks parent and sibling properties of a tree. By definition, every tree with these two properties is a dominator tree.
It is possible to run those check by running llvm with `-verify-dom-info=1`.
Bootstrapping clang and building the llvm test suite with this option enabled doesn't yield any errors.
Reviewers: dberlin, sanjoy, chandlerc
Reviewed By: dberlin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34482
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306711
91177308-0d34-0410-b5e6-
96231b3b80d8
Leo Li [Thu, 29 Jun 2017 17:03:34 +0000 (17:03 +0000)]
[ConstantHoisting] Avoid hoisting constants in GEPs that index into a struct type.
Summary:
Indices for GEPs that index into a struct type should always be
constants. This added more checks in `collectConstantCandidates:` which make
sure constants for GEP pointer type are not hoisted.
This fixed Bug https://bugs.llvm.org/show_bug.cgi?id=33538
Reviewers: ributzka, rnk
Reviewed By: ributzka
Subscribers: efriedma, llvm-commits, srhines, javed.absar, pirama
Differential Revision: https://reviews.llvm.org/D34576
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306704
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Thu, 29 Jun 2017 17:01:14 +0000 (17:01 +0000)]
PredicateInfo: Use OrderedInstructions instead of our homemade
version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306703
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Thu, 29 Jun 2017 17:01:10 +0000 (17:01 +0000)]
NewGVN: Remove useless test in addPhiOfOps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306702
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Thu, 29 Jun 2017 17:01:03 +0000 (17:01 +0000)]
Remove unneeded else from OrderedInstructions::dominates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306701
91177308-0d34-0410-b5e6-
96231b3b80d8
Paul Robinson [Thu, 29 Jun 2017 16:52:08 +0000 (16:52 +0000)]
[DWARF] NFC: DWARFDataExtractor combines relocs with DataExtractor.
Requires callers to directly associate relocations with a DataExtractor
used to read data from a DWARF section, which helps a callee not make
assumptions about which section it is reading.
This is the next step in reducing DWARFFormValue's dependence on DWARFUnit.
Differential Revision: https://reviews.llvm.org/D34704
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306699
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexandre Isoard [Thu, 29 Jun 2017 16:29:04 +0000 (16:29 +0000)]
ScalarEvolution: Add URem support
In LLVM IR the following code:
%r = urem <ty> %t, %b
is equivalent to:
%q = udiv <ty> %t, %b
%s = mul <ty> nuw %q, %b
%r = sub <ty> nuw %t, %q ; (t / b) * b + (t % b) = t
As UDiv, Mul and Sub are already supported by SCEV, URem can be
implemented with minimal effort this way.
Note: While SRem and SDiv are also related this way, SCEV does not
provides SDiv yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306695
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gesiak [Thu, 29 Jun 2017 16:20:31 +0000 (16:20 +0000)]
[opt-viewer] opt-viewer.py takes -o argument
Summary:
Change how the output directory is specified when invoking
opt-viewer.py, from `opt-viewer.py yaml_file_one yaml_file_two output_dir` to
`opt-viewer.py -o output_dir yaml_file_one yaml_file_two`.
This makes it easier to pipe the results of another command into
opt-viewer.py. For example:
```
find . -name "*.yaml" -print | xargs /path/to/opt-viewer.py -o html
```
Reviewers: anemet, davidxl
Reviewed By: anemet
Subscribers: fhahn, llvm-commits
Differential Revision: https://reviews.llvm.org/D34711
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306694
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Thu, 29 Jun 2017 15:55:59 +0000 (15:55 +0000)]
[Hexagon] Keep all phi nodes when building DFG in addr-mode-opt
The dead phis are needed for finding correct would-be reaching defs
in register propagation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306690
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Thu, 29 Jun 2017 15:48:11 +0000 (15:48 +0000)]
[DAG] Fold FrameIndex offset into BaseIndexOffset analysis. NFCI.
Relanding after restricting equalBaseIndex to not erroneuosly consider
a FrameIndices stemming from alloca from being comparable as its
offset is set post-selectionDAG.
Pull FrameIndex comparision reasoning from DAGCombiner::isAlias to
general BaseIndexOffset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306688
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Leviant [Thu, 29 Jun 2017 15:38:47 +0000 (15:38 +0000)]
[llvm-objdump] Handle invalid instruction gracefully on ARM
Differential revision: https://reviews.llvm.org/D34813
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306687
91177308-0d34-0410-b5e6-
96231b3b80d8
Yonghong Song [Thu, 29 Jun 2017 15:18:54 +0000 (15:18 +0000)]
bpf: remove unnecessary truncate operation
For networking-type bpf program, it often needs to access
packet data. A context data structure is provided to the bpf
programs with two fields:
u32 data;
u32 data_end;
User can access these two fields with ctx->data and ctx->data_end.
During program verification process, the kernel verifier modifies
the bpf program with loading of actual pointer value from kernel
data structure.
r = ctx->data ===> r = actual data start ptr
r = ctx->data_end ===> r = actual data end ptr
A typical program accessing ctx->data like
char *data_ptr = (char *)(long)ctx->data
will result in a 32-bit load followed by a zero extension.
Such an operation is combined into a single LDW in DAG combiner
as bpf LDW does zero extension automatically.
In cases like the below (which can be a result of global value numbering
and partial redundancy elimination before insn selection):
B1:
u32 a = load-32-bit &ctx->data
u64 pa = zext a
...
B2:
u32 b = load-32-bit &ctx->data
u64 pb = zext b
...
B3:
u32 m = PHI(a, b)
u64 pm = zext m
In B3, "pm = zext m" cannot be removed, which although is legal
from compiler perspective, will generate incorrect code after
kernel verification.
This patch recognizes this pattern and traces through PHI node
to see whether the operand of "zext m" is defined with LDWs or not.
If it is, the "zext m" itself can be removed.
The patch also recognizes the pattern where the load and use of
the load value not in the same basic block, where truncate operation
may be removed as well.
The patch handles 1-byte, 2-byte and 4-byte truncation.
Two test cases are added to verify the transformation happens properly
for the above code pattern.
Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306685
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikolai Bozhenov [Thu, 29 Jun 2017 14:51:54 +0000 (14:51 +0000)]
[NFC] Use stdin for some tests instead of positional argument.
Summary: Otherwise unexpected matches with the path to the tests might happen.
Reviewers: rengolin, spatel, efriedma, RKSimon
Reviewed By: spatel
Subscribers: n.bozhenov, javed.absar, llvm-commits
Patch by Andrei Elovikov <andrei.elovikov@intel.com>
Differential Revision: https://reviews.llvm.org/D32994
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306684
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Neilson [Thu, 29 Jun 2017 14:21:28 +0000 (14:21 +0000)]
Restore original intent of memset instcombine test
Summary:
The original intent of test/Transforms/InstCombine/memset.ll was to test for lowering of llvm.memset into stores when the size of the memset is 1, 2, 4, or 8. Sometime between then and now the test has stopped testing for that, but remained passing due to testing for the absence of llvm.memset calls rather than the presence of store instructions. Right now this test ends up with an empty function body because the alloca is eliminated as safe-to-remove, which results in the llvm.memset calls's being eliminated due to their pointer args being undef; so it is not testing for conversion of llvm.memset into store instructions at all.
This change alters the test to verify that store instructions are created, and moves the target of the memset to an arg of the proc to avoid it being eliminated as unused.
Reviewers: anna, efriedma
Reviewed By: efriedma
Subscribers: efriedma, llvm-commits
Differential Revision: https://reviews.llvm.org/D34642
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306681
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Neilson [Thu, 29 Jun 2017 14:17:50 +0000 (14:17 +0000)]
Explicitly check for presence of correct results in instcombine memmove test
Summary:
Rather than testing for expected results, test/Transforms/InstCombine/memmove.ll is testing for the absence of calls to llvm.memmove.
In the case of test3, the test has stopped testing for materialization of loads/stores, but remained passing due to testing for the absence of llvm.memset calls rather than the presence of load/store instructions. Right now this test ends up with an empty function body because the alloca is eliminated as safe-to-remove, which results in the llvm.memmove calls being eliminated due to a pointer arg being undef; so it is not testing for conversion of llvm.memmove into load/store instructions at all.
Reviewers: eli.friedman, anna, efriedma
Reviewed By: efriedma
Subscribers: efriedma, llvm-commits
Differential Revision: https://reviews.llvm.org/D34645
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306679
91177308-0d34-0410-b5e6-
96231b3b80d8
Hiroshi Inoue [Thu, 29 Jun 2017 14:13:38 +0000 (14:13 +0000)]
[PowerPC] fix potential verification error on __tls_get_addr
This patch fixes a verification error with -verify-machineinstrs while expanding __tls_get_addr by not creating ADJCALLSTACKUP and ADJCALLSTACKDOWN if there is another ADJCALLSTACKUP in this basic block since nesting ADJCALLSTACKUP/ADJCALLSTACKDOWN is not allowed.
Here, ADJCALLSTACKUP and ADJCALLSTACKDOWN are created as a fence for instruction scheduling to avoid _tls_get_addr is scheduled before mflr in the prologue (https://bugs.llvm.org//show_bug.cgi?id=25839). So if another ADJCALLSTACKUP exists before _tls_get_addr, we do not need to create a new ADJCALLSTACKUP.
Differential Revision: https://reviews.llvm.org/D34347
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306678
91177308-0d34-0410-b5e6-
96231b3b80d8
George Rimar [Thu, 29 Jun 2017 14:05:18 +0000 (14:05 +0000)]
[DWARF] - Fix message reporting about broken relocation.
Because of mistake introduced in r306517,
wrong variable ("name" instead of "Name") was used
in error message.
As a result it reported section name instead of
relocation name.
This file still needs cleanup to match LLVM coding style
and more tests I think.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306677
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 29 Jun 2017 13:58:24 +0000 (13:58 +0000)]
Revert "r306529 - [X86] Correct dwarf unwind information in function epilogue"
I am 99% sure that this breaks the PPC ASAN build bot:
http://lab.llvm.org:8011/builders/sanitizer-ppc64be-linux/builds/3112/steps/64-bit%20check-asan/logs/stdio
If it doesn't go back to green, we can recommit (and fix the original
commit message at the same time :) ).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306676
91177308-0d34-0410-b5e6-
96231b3b80d8
Florian Hahn [Thu, 29 Jun 2017 13:55:23 +0000 (13:55 +0000)]
[TBAA] Remove metadata keyword from IR examples in comments (NFC).
The metadata keyword has been removed from the IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306675
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeny Astigeevich [Thu, 29 Jun 2017 13:42:12 +0000 (13:42 +0000)]
[TargetTransformInfo, API] Add a list of operands to TTI::getUserCost
The changes are a result of discussion of https://reviews.llvm.org/D33685.
It solves the following problem:
1. We can inform getGEPCost about simplified indices to help it with
calculating the cost. But getGEPCost does not take into account the
context which GEPs are used in.
2. We have getUserCost which can take the context into account but we cannot
inform about simplified indices.
With the changes getUserCost will have access to additional information
as getGEPCost has.
The one parameter getUserCost is also provided.
Differential Revision: https://reviews.llvm.org/D34057
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306674
91177308-0d34-0410-b5e6-
96231b3b80d8
Pavel Labath [Thu, 29 Jun 2017 13:15:31 +0000 (13:15 +0000)]
Recommit "[Support] Add RetryAfterSignal helper function"
The difference from the previous version is the use of decltype, as the
implementation of std::result_of in libc++ did not work correctly for
variadic function like open(2).
Original summary:
This function retries an operation if it was interrupted by a signal
(failed with EINTR). It's inspired by the TEMP_FAILURE_RETRY macro in
glibc, but I've turned that into a template function. I've also added a
fail-value argument, to enable the function to be used with e.g.
fopen(3), which is documented to fail for any reason that open(2) can
fail (which includes EINTR).
The main user of this function will be lldb, but there were also a
couple of uses within llvm that I could simplify using this function.
Reviewers: zturner, silvas, joerg
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D33895
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306671
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Thu, 29 Jun 2017 12:08:28 +0000 (12:08 +0000)]
[GlobalISel][X86] Support vector type G_MERGE_VALUES selection.
Summary:
Support vector type G_MERGE_VALUES selection. For now G_MERGE_VALUES marked as legal for any type, so nothing to do in legalizer.
Split from https://reviews.llvm.org/D33665
Reviewers: qcolombet, t.p.northover, zvi, guyblank
Reviewed By: guyblank
Subscribers: rovka, kristof.beyls, guyblank, llvm-commits
Differential Revision: https://reviews.llvm.org/D33958
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306665
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 29 Jun 2017 11:13:39 +0000 (11:13 +0000)]
[X86][SSE] Dropped -mcpu from palignr tests
Use triple and attribute only for consistency
Add AVX tests as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306664
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 29 Jun 2017 11:11:37 +0000 (11:11 +0000)]
[X86][SSE] Regenerate shuffle test with update_llc_test_checks.py
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306663
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 29 Jun 2017 11:09:53 +0000 (11:09 +0000)]
[X86][SSE] Dropped -mcpu from vector shift tests
Use triple and attribute only for consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306662
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 29 Jun 2017 11:08:11 +0000 (11:08 +0000)]
[X86][SSE] Dropped -mcpu from zero insertion tests
Use triple and attribute only for consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306661
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zuckerman [Thu, 29 Jun 2017 10:00:33 +0000 (10:00 +0000)]
[LLVM][X86][Goldmont] Adding new target-cpu: Goldmont
[LLVM SIDE]
Connecting the GoldMont processor to his feature.
Reviewers:
1. igorb
2. zvi
3. delena
4. RKSimon
5. craig.topper
Differential Revision: https://reviews.llvm.org/D34504
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306658
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 29 Jun 2017 09:46:01 +0000 (09:46 +0000)]
Test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306657
91177308-0d34-0410-b5e6-
96231b3b80d8
Dinar Temirbulatov [Thu, 29 Jun 2017 08:46:18 +0000 (08:46 +0000)]
[SLPVectorizer] Introducing getTreeEntry() helper function [NFC]
Differential Revision: https://reviews.llvm.org/D34756
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306655
91177308-0d34-0410-b5e6-
96231b3b80d8
Florian Hahn [Thu, 29 Jun 2017 08:45:31 +0000 (08:45 +0000)]
[ARM] Add tGPRwithpc register class and use it for TBB/THH
Summary:
TBB and THH allow using a Thumb GPR or the PC as destination operand.
A few machine verifier failures where due to those instructions not
expecting PC as destination operand.
Add -verify-machineinstrs to test/CodeGen/ARM/jump-table-tbh.ll to add
test coverage even if expensive checks are disabled.
Reviewers: MatzeB, t.p.northover, jmolloy
Reviewed By: MatzeB
Subscribers: aemerson, javed.absar, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D34610
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306654
91177308-0d34-0410-b5e6-
96231b3b80d8
Martin Storsjo [Thu, 29 Jun 2017 06:30:56 +0000 (06:30 +0000)]
[BinaryFormat] Identify AArch64 COFF files
Differential Revision: https://reviews.llvm.org/D34742
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306647
91177308-0d34-0410-b5e6-
96231b3b80d8
Zvi Rackover [Thu, 29 Jun 2017 06:22:01 +0000 (06:22 +0000)]
[X86] Adding shuffle tests demonstrating missed vcompress opportunities. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306646
91177308-0d34-0410-b5e6-
96231b3b80d8
David L. Jones [Thu, 29 Jun 2017 04:37:35 +0000 (04:37 +0000)]
[lit] Re-apply: Fix some convoluted logic around Unicode encoding, and de-duplicate across modules that used it.
(Take 2: this patch re-applies r306625, which was reverted in r306629. This
patch includes only trivial fixes.)
In Python2 and Python3, the various (non-)?Unicode string types are sort of
spaghetti. Python2 has unicode support tacked on via the 'unicode' type, which
is distinct from 'str' (which are bytes). Python3 takes the "unicode-everywhere"
approach, with 'str' representing a Unicode string.
Both have a 'bytes' type. In Python3, it is the only way to represent raw bytes.
However, in Python2, 'bytes' is an alias for 'str'. This leads to interesting
problems when an interface requires a precise type, but has to run under both
Python2 and Python3.
The previous logic appeared to be correct in all cases, but went through more
layers of indirection than necessary. This change does the necessary conversions
in one shot, with documentation about which paths might be taken in Python2 or
Python3.
Changes from r306625: some tests just print binary outputs, so in those cases,
fall back to str() in Python3. For googletests, add one missing call to
to_string().
(Tested by verifying the visible breakage with Python3. Verified that everything
works in py2 and py3.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306643
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 29 Jun 2017 02:51:58 +0000 (02:51 +0000)]
llvm-profdata: Indirect infrequently used fields to reduce memory usage
Examining a large profile example, it seems relatively few records have
non-empty IndirectCall and MemOP data, so indirecting these through a
unique_ptr (non-null only when they are non-empty) Reduces memory usage
on this particular example from 14GB to 10GB according to valgrind's
massif.
I suspect it'd still be worth moving InstrProfWriter to its own data
structure that had Counts and the indirected IndirectCall+MemOP, and did
not include the Name, Hash, or Error fields. This would reduce the size
of this dominant data structure by half of this new, lower amount.
(Name(2), Hash(1), Error(1) ~= Counts(vector, 3), ValueProfData
(unique_ptr, 1))
-> From code review feedback, might actually refactor InstrProfRecord
itself to have a sub-struct with all the counts, and use that from
InstrProfWriter, rather than InstrProfWriter owning its own data
structure for this.
Reviewers: davidxl
Differential Revision: https://reviews.llvm.org/D34694
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306631
91177308-0d34-0410-b5e6-
96231b3b80d8
David L. Jones [Thu, 29 Jun 2017 02:22:49 +0000 (02:22 +0000)]
Revert "[lit] Fix some convoluted logic around Unicode encoding, and de-duplicate across modules that used it."
This reverts r306625.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306629
91177308-0d34-0410-b5e6-
96231b3b80d8
David L. Jones [Thu, 29 Jun 2017 01:03:56 +0000 (01:03 +0000)]
Fix spelling: uncode -> unicode.
Remember kids: there is no 'I' in str or bytes, but there is ALWAYS an
'I' in unicode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306626
91177308-0d34-0410-b5e6-
96231b3b80d8
David L. Jones [Thu, 29 Jun 2017 01:03:55 +0000 (01:03 +0000)]
[lit] Fix some convoluted logic around Unicode encoding, and de-duplicate across modules that used it.
Summary:
In Python2 and Python3, the various (non-)?Unicode string types are sort of
spaghetti. Python2 has unicode support tacked on via the 'unicode' type, which
is distinct from 'str' (which are bytes). Python3 takes the "unicode-everywhere"
approach, with 'str' representing a Unicode string.
Both have a 'bytes' type. In Python3, it is the only way to represent raw bytes.
However, in Python2, 'bytes' is an alias for 'str'. This leads to interesting
problems when an interface requires a precise type, but has to run under both
Python2 and Python3.
The previous logic appeared to be correct in all cases, but went through more
layers of indirection than necessary. This change does the necessary conversions
in one shot, with documentation about which paths might be taken in Python2 or
Python3.
Reviewers: zturner, modocache
Subscribers: llvm-commits, sanjoy
Differential Revision: https://reviews.llvm.org/D34793
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306625
91177308-0d34-0410-b5e6-
96231b3b80d8
David L. Jones [Thu, 29 Jun 2017 01:01:03 +0000 (01:01 +0000)]
[lit] Remove dead code not referenced in the LLVM SVN repo.
Summary:
This change removes the intermediate 'FileBasedTest' format from lit. This
format is only ever used by the ShTest format, so the logic can be moved into
ShTest directly.
In order to better clarify what the TestFormat subclasses do, I fleshed out the
TestFormat base class with Python's notion of abstract methods, using
@abc.abstractmethod. This gives a convenient way to document the expected
interface, without the risk of instantiating an abstract class (that's what
ABCMeta does -- it raises an exception if you try to instantiate a class which
has abstract methods, but not if you instantiate a subclass that implements
them).
Reviewers: zturner, modocache
Subscribers: sanjoy, llvm-commits
Differential Revision: https://reviews.llvm.org/D34792
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306623
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Beckmann [Thu, 29 Jun 2017 00:17:26 +0000 (00:17 +0000)]
Revert "Replace trivial use of external rc.exe by writing our own .res file."
This reverts commit
d4c7e9fc63c10dbab0c30186ef8575474a704496.
This is done in order to address the failure of CrWinClangLLD etc. bots.
These throw an error of "side-by-side configuration is incorrect" during
compilation, which sounds suspiciously related to these manifest
changes.
Revert "Switch external cvtres.exe for llvm's own resource library."
This reverts commit
71fe8ef283a9dab9a3f21432c98466cbc23990d1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306618
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 29 Jun 2017 00:07:08 +0000 (00:07 +0000)]
[InstCombine] In visitXor, use m_Not on the instruction itself instead of looking for all ones in Op1. This is consistent with 3 other not checks before this one. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306617
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Thu, 29 Jun 2017 00:05:44 +0000 (00:05 +0000)]
[CodeView] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306616
91177308-0d34-0410-b5e6-
96231b3b80d8
Keno Fischer [Wed, 28 Jun 2017 23:36:40 +0000 (23:36 +0000)]
[InstCombine] Retain TBAA when narrowing memory accesses
Summary:
As discussed on the mailing list it is legal to propagate TBAA to loads/stores
from/to smaller regions of a larger load tagged with TBAA. Do so for
(load->extractvalue)=>(gep->load) and similar foldings.
Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D31954
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306615
91177308-0d34-0410-b5e6-
96231b3b80d8
Mandeep Singh Grang [Wed, 28 Jun 2017 23:15:16 +0000 (23:15 +0000)]
[NFC] Remove multiple semicolons
Reviewers: bogner, whitequark, mgrang
Reviewed By: mgrang
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34785
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306613
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian McCarthy [Wed, 28 Jun 2017 22:47:40 +0000 (22:47 +0000)]
Introduce symbol cache to PDB NativeSession
Instead of creating symbols directly in the findChildren methods of the native
symbol implementations, they will rely on the NativeSession to act as a factory
for these types. This lets NativeSession cache the NativeRawSymbols in its
new symbol cache and makes that cache the source of unique IDs for the symbols.
Right now, this affects only NativeCompilandSymbols. There's no external
change yet, so I think the existing tests are still sufficient. Coming soon
are patches to extend this to built-in types and enums.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306610
91177308-0d34-0410-b5e6-
96231b3b80d8
Xin Tong [Wed, 28 Jun 2017 22:35:54 +0000 (22:35 +0000)]
Revert "Make OrderedInstructions and OrderedBasicBlock use AssertingVH, to try and catch mistakes"
This reverts commit
50ec560f05dcb8a1be18be442660d0305bc7de25.
It catches some bug in NewGVN it seems. I am in middle of something and will not be able to investigate
Revert for now.
http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/6268
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306608
91177308-0d34-0410-b5e6-
96231b3b80d8
Xin Tong [Wed, 28 Jun 2017 22:12:22 +0000 (22:12 +0000)]
Make OrderedInstructions and OrderedBasicBlock use AssertingVH, to try and catch mistakes
Summary: Make OrderedInstructions and OrderedBasicBlock use AssertingVH to try and catch mistakes
Reviewers: efriedma
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34780
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306605
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 28 Jun 2017 21:38:50 +0000 (21:38 +0000)]
AMDGPU: Remove SITypeRewriter
This was an old workaround for using v16i8 in some old intrinsics
for resource descriptors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306603
91177308-0d34-0410-b5e6-
96231b3b80d8
David L. Jones [Wed, 28 Jun 2017 21:14:13 +0000 (21:14 +0000)]
[lit] Remove dead code (not referenced anywhere), and clarify some function names.
Summary:
The dead code seems to be unreferenced, according to textual search across the
LLVM SVN repo.
The clarification part of this change alters the name of a module-level function
so that it is different from the name of the class-methods that call it.
Currently, there are no erroneous references, but stylistically (c.f. PEP-8),
internal "helper" functions should generally be named accordingly by prepending
an underscore. (I also chose to add '_impl', which isn't necessary, but helps me
at least to mentally disambiguate the interface and implementation functions.)
Reviewers: zturner, modocache
Subscribers: sanjoy, llvm-commits
Differential Revision: https://reviews.llvm.org/D34775
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306600
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 28 Jun 2017 21:10:31 +0000 (21:10 +0000)]
Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306599
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Wed, 28 Jun 2017 20:25:50 +0000 (20:25 +0000)]
Fold fneg and fabs like multiplications
Given no NaNs and no signed zeroes it folds:
(fmul X, (select (fcmp X > 0.0), -1.0, 1.0)) -> (fneg (fabs X))
(fmul X, (select (fcmp X > 0.0), 1.0, -1.0)) -> (fabs X)
Differential Revision: https://reviews.llvm.org/D34579
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306592
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 28 Jun 2017 20:02:35 +0000 (20:02 +0000)]
[InstCombine] add tests for icmp with bitreversed ops; NFC
This is similar enough to bswap that we might as well handle them together in one patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306591
91177308-0d34-0410-b5e6-
96231b3b80d8
Mandeep Singh Grang [Wed, 28 Jun 2017 19:37:38 +0000 (19:37 +0000)]
[AArch64] Make assert messages uniform and general [NFC]
Summary: Make assert messages related to Darwin, ELF and COFF uniform.
Reviewers: rnk, ruiu, compnerd, t.p.northover
Reviewed By: t.p.northover
Subscribers: t.p.northover, aemerson, rengolin, javed.absar, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D34730
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306589
91177308-0d34-0410-b5e6-
96231b3b80d8
Geoff Berry [Wed, 28 Jun 2017 19:36:10 +0000 (19:36 +0000)]
[AArch64][Falkor] Attempt to fix Windows buildbots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306588
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 28 Jun 2017 19:26:37 +0000 (19:26 +0000)]
Reuse existing variables. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306586
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 28 Jun 2017 18:59:18 +0000 (18:59 +0000)]
Break up long lines, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306585
91177308-0d34-0410-b5e6-
96231b3b80d8
Geoff Berry [Wed, 28 Jun 2017 18:53:09 +0000 (18:53 +0000)]
[AArch64][Falkor] Try to avoid exhausting HW prefetcher resources when unrolling.
Reviewers: t.p.northover, mcrosier
Subscribers: aemerson, rengolin, javed.absar, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D34533
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306584
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 28 Jun 2017 18:24:02 +0000 (18:24 +0000)]
Reuse existing variable. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306582
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Kuderski [Wed, 28 Jun 2017 18:15:45 +0000 (18:15 +0000)]
[Dominators] Move helper functions into SemiNCAInfo
Summary: Helper functions (DFSPass, ReverseDFSPass, Eval) need SemiNCAInfo anyway, so it's simpler to have them there as member functions. This also makes them simpler by removing template boilerplate.
Reviewers: dberlin, sanjoy, chandlerc
Reviewed By: dberlin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34427
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306579
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 28 Jun 2017 18:08:40 +0000 (18:08 +0000)]
[BBVectorize][X86] Regenerate simple tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306578
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 28 Jun 2017 18:07:29 +0000 (18:07 +0000)]
[InstCombine] Remove 64-bit bit width restriction from m_ConstantInt(uint64_t*&)
I think we only need to make sure the value fits in 64-bits not that bit width is 64-bit.
This helps places that use this for shift amounts since the shift amount needs to be the same bitwidth as the LHS, but can't be larger than the bit width.
Differential Revision: https://reviews.llvm.org/D34737
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306577
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Kuderski [Wed, 28 Jun 2017 18:00:36 +0000 (18:00 +0000)]
[Dominators] Move SemiNCAInfo and helper functions out of DominatorTreeBase
Summary:
This moves SemiNCAInfo from DeminatorTreeBase to GenericDomTreeConstruction. It also put helper functions used during tree constructions in the same file.
The point of this change is to further clean up DominatorTreeBase and make it easier to construct and verify (in future patches).
Reviewers: dberlin, sanjoy, chandlerc
Reviewed By: dberlin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34420
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306576
91177308-0d34-0410-b5e6-
96231b3b80d8
Ayal Zaks [Wed, 28 Jun 2017 17:59:33 +0000 (17:59 +0000)]
[LV] Fix PR33613 - retain order of insertelement per part
r306381 caused PR33613, by reversing the order in which insertelements were
generated per unroll part. This patch fixes PR33613 by retraining this order,
placing each set of insertelements per part immediately after the last scalar
being packed for this part. Includes a test case derived from PR33613.
Reference: https://bugs.llvm.org/show_bug.cgi?id=33613
Differential Revision: https://reviews.llvm.org/D34760
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306575
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Kuderski [Wed, 28 Jun 2017 17:56:09 +0000 (17:56 +0000)]
[Dominators] Move IDoms out of DominatorTreeBase and put them in SNCAInfo
Summary: The temporary IDoms map was used only during DomTree calculation. We can move it to SNCAInfo so that it's no longer a DominatorTreeBase member.
Reviewers: sanjoy, dberlin, chandlerc
Reviewed By: dberlin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34317
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306574
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 28 Jun 2017 17:56:07 +0000 (17:56 +0000)]
Fix PR33625.
We were failing to convert this expression to pcrel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306573
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Kuderski [Wed, 28 Jun 2017 17:43:54 +0000 (17:43 +0000)]
[Dominators] Move InfoRec outside of DominatorTreeBase
Summary:
The InfoRec struct is used only during tree construction, so there is no point having it as a DominatorTreeBase member.
This patch moves it into the Calculate function instead and makes it pass it to its helper functions.
Reviewers: sanjoy, dberlin, chandlerc
Reviewed By: dberlin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34305
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306572
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 28 Jun 2017 17:40:20 +0000 (17:40 +0000)]
[BBVectorize] Regenerate simple tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306571
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 28 Jun 2017 17:23:13 +0000 (17:23 +0000)]
Don't repeat name in comment and format. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306568
91177308-0d34-0410-b5e6-
96231b3b80d8
Chih-Hung Hsieh [Wed, 28 Jun 2017 17:12:51 +0000 (17:12 +0000)]
Another test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306567
91177308-0d34-0410-b5e6-
96231b3b80d8
Geoff Berry [Wed, 28 Jun 2017 17:01:15 +0000 (17:01 +0000)]
[LoopUnroll] Fix bug in computeUnrollCount causing it to not honor MaxCount
Reviewers: sanjoy, anna, reames, apilipenko, igor-laevsky, mkuper
Subscribers: mcrosier, llvm-commits, mzolotukhin
Differential Revision: https://reviews.llvm.org/D34532
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306564
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 28 Jun 2017 16:56:45 +0000 (16:56 +0000)]
[InstCombine] add tests for icmp with bswapped operands; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306563
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Kuderski [Wed, 28 Jun 2017 16:54:34 +0000 (16:54 +0000)]
[Dominators] Move number to node mapping out of DominatorTreeBase
Summary: Number to node mapping in DominatorTreeBase is used only during calculation, so there is no point keeping is as a member variable. This patch moves this mapping to Calculate function and passes it to helper functions. It also makes the name more descriptive.
Reviewers: sanjoy, dberlin, davide, chandlerc
Reviewed By: dberlin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34295
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306562
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 28 Jun 2017 16:39:06 +0000 (16:39 +0000)]
[InstCombine] use local variable to reduce code; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306560
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 28 Jun 2017 16:02:00 +0000 (16:02 +0000)]
Rangify loops, formatting changes, use bool instead of unsigned, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306557
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 28 Jun 2017 16:00:16 +0000 (16:00 +0000)]
Don't repeat names and reformat. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306556
91177308-0d34-0410-b5e6-
96231b3b80d8
Geoff Berry [Wed, 28 Jun 2017 15:53:17 +0000 (15:53 +0000)]
[LoopUnroll] Pass SCEV to getUnrollingPreferences hook. NFCI.
Reviewers: sanjoy, anna, reames, apilipenko, igor-laevsky, mkuper
Subscribers: jholewinski, arsenm, mzolotukhin, nemanjai, nhaehnle, javed.absar, mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D34531
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306554
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 28 Jun 2017 15:46:16 +0000 (15:46 +0000)]
Missed a check for UndefVI in r306466
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306553
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Wed, 28 Jun 2017 15:16:03 +0000 (15:16 +0000)]
[globalisel][tablegen] Post-commit review nits for r306388. NFC
One early exit and a missing assert string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306552
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexandros Lamprineas [Wed, 28 Jun 2017 15:09:11 +0000 (15:09 +0000)]
[AArch64] AArch64CondBrTuningPass generates wrong branch instructions
Some conditional branch instructions generated by this pass are checking
the wrong condition code. The instructions TBZ and TBNZ are transformed
into B.GE and B.LT instead of B.PL and B.MI respectively. They should
only be checking the Negative bit.
Differential Revision: https://reviews.llvm.org/D34743
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306550
91177308-0d34-0410-b5e6-
96231b3b80d8