]> granicus.if.org Git - llvm/log
llvm
8 years ago[AVX-512] Add additional test cases for broadcast intrinsics that demonstates that...
Craig Topper [Thu, 19 Jan 2017 02:34:25 +0000 (02:34 +0000)]
[AVX-512] Add additional test cases for broadcast intrinsics that demonstates that we don't fold the loads to use a broadcast instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292465 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PM] Add LoopVectorize to the default module pipeline
Michael Kuperstein [Thu, 19 Jan 2017 02:21:54 +0000 (02:21 +0000)]
[PM] Add LoopVectorize to the default module pipeline

LV no longer "requires" LCSSA and LoopSimplify, and instead forms
them internally as required. So, there's nothing preventing it from
being enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292464 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoLowerTypeTests: Implement exporting of type identifiers.
Peter Collingbourne [Thu, 19 Jan 2017 01:20:11 +0000 (01:20 +0000)]
LowerTypeTests: Implement exporting of type identifiers.

Type identifiers are exported by:
- Adding coarse-grained information about how to test the type
  identifier to the summary.
- Creating symbols in the object file (aliases and absolute symbols)
  containing fine-grained information about the type identifier.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292462 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoGlobalISel: Implement narrowing for G_LOAD
Justin Bogner [Thu, 19 Jan 2017 01:05:48 +0000 (01:05 +0000)]
GlobalISel: Implement narrowing for G_LOAD

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292461 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoGlobalISel: Fix text wrapping in a comment. NFC
Justin Bogner [Thu, 19 Jan 2017 01:04:46 +0000 (01:04 +0000)]
GlobalISel: Fix text wrapping in a comment. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292460 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUse an actual valid register in test
Matthias Braun [Thu, 19 Jan 2017 01:04:08 +0000 (01:04 +0000)]
Use an actual valid register in test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292459 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd -debug-info-for-profiling to emit more debug info for sample pgo profile collection
Dehao Chen [Thu, 19 Jan 2017 00:44:11 +0000 (00:44 +0000)]
Add -debug-info-for-profiling to emit more debug info for sample pgo profile collection

Summary:
SamplePGO binaries built with -gmlt to collect profile. The current -gmlt debug info is limited, and we need some additional info:

* start line of all subprograms
* linkage name of all subprograms
* standalone subprograms (functions that has neither inlined nor been inlined)

This patch adds these information to the -gmlt binary. The impact on speccpu2006 binary size (size increase comparing with -g0 binary, also includes data for -g binary, which does not change with this patch):

               -gmlt(orig) -gmlt(patched) -g
433.milc       4.68%       5.40%          19.73%
444.namd       8.45%       8.93%          45.99%
447.dealII     97.43%      115.21%        374.89%
450.soplex     27.75%      31.88%         126.04%
453.povray     21.81%      26.16%         92.03%
470.lbm        0.60%       0.67%          1.96%
482.sphinx3    5.77%       6.47%          26.17%
400.perlbench  17.81%      19.43%         73.08%
401.bzip2      3.73%       3.92%          12.18%
403.gcc        31.75%      34.48%         122.75%
429.mcf        0.78%       0.88%          3.89%
445.gobmk      6.08%       7.92%          42.27%
456.hmmer      10.36%      11.25%         35.23%
458.sjeng      5.08%       5.42%          14.36%
462.libquantum 1.71%       1.96%          6.36%
464.h264ref    15.61%      16.56%         43.92%
471.omnetpp    11.93%      15.84%         60.09%
473.astar      3.11%       3.69%          14.18%
483.xalancbmk  56.29%      81.63%         353.22%
geomean        15.60%      18.30%         57.81%

Debug info size change for -gmlt binary with this patch:

433.milc       13.46%
444.namd       5.35%
447.dealII     18.21%
450.soplex     14.68%
453.povray     19.65%
470.lbm        6.03%
482.sphinx3    11.21%
400.perlbench  8.91%
401.bzip2      4.41%
403.gcc        8.56%
429.mcf        8.24%
445.gobmk      29.47%
456.hmmer      8.19%
458.sjeng      6.05%
462.libquantum 11.23%
464.h264ref    5.93%
471.omnetpp    31.89%
473.astar      16.20%
483.xalancbmk  44.62%
geomean        16.83%

Reviewers: davidxl, echristo, dblaikie

Reviewed By: echristo, dblaikie

Subscribers: aprantl, probinson, llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292457 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LV] Run loop-simplify and LCSSA explicitly instead of "requiring" them
Michael Kuperstein [Thu, 19 Jan 2017 00:42:28 +0000 (00:42 +0000)]
[LV] Run loop-simplify and LCSSA explicitly instead of "requiring" them

This changes the vectorizer to explicitly use the loopsimplify and lcssa utils,
instead of "requiring" the transformations as if they were analyses.

This is not NFC, since it changes the LCSSA behavior - we no longer run LCSSA
for all loops, but rather only for the loops we expect to modify.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292456 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoLiveIntervalAnalysis: Cleanup; NFC
Matthias Braun [Thu, 19 Jan 2017 00:32:13 +0000 (00:32 +0000)]
LiveIntervalAnalysis: Cleanup; NFC

- Fix doxygen comments: Do not repeat name, remove duplicated doxygen
  comment (on declaration + implementation), etc.
- Use more range based for

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292455 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NVPTX] Fix lowering of fp16 ISD::FNEG.
Artem Belevich [Thu, 19 Jan 2017 00:14:45 +0000 (00:14 +0000)]
[NVPTX] Fix lowering of fp16 ISD::FNEG.

There's no neg.f16 instruction, so negation has to
be done via subtraction from zero.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292452 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SCEV] Make getUDivExactExpr handle non-nuw multiplies correctly.
Eli Friedman [Wed, 18 Jan 2017 23:56:42 +0000 (23:56 +0000)]
[SCEV] Make getUDivExactExpr handle non-nuw multiplies correctly.

To avoid regressions, make ScalarEvolution::createSCEV a bit more
clever.

Also get rid of some useless code in ScalarEvolution::howFarToZero
which was hiding this bug.

No new testcase because it's impossible to actually expose this bug:
we don't have any in-tree users of getUDivExactExpr besides the two
functions I just mentioned, and they both dodged the problem. I'll
try to add some interesting users in a followup.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292449 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPreserve domtree and loop-simplify for runtime unrolling.
Eli Friedman [Wed, 18 Jan 2017 23:26:37 +0000 (23:26 +0000)]
Preserve domtree and loop-simplify for runtime unrolling.

Mostly straightforward changes; we just didn't do the computation before.
One sort of interesting change in LoopUnroll.cpp: we weren't handling
dominance for children of the loop latch correctly, but
foldBlockIntoPredecessor hid the problem for complete unrolling.

Currently punting on loop peeling; made some minor changes to isolate
that problem to LoopUnrollPeel.cpp.

Adds a flag -unroll-verify-domtree; it verifies the domtree immediately
after we finish updating it. This is on by default for +Asserts builds.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292447 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTreat segment [B, E) as not overlapping block with boundaries [A, B)
Krzysztof Parzyszek [Wed, 18 Jan 2017 23:12:19 +0000 (23:12 +0000)]
Treat segment [B, E) as not overlapping block with boundaries [A, B)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292446 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Remove dead defs from the live set when expanding wstores
Krzysztof Parzyszek [Wed, 18 Jan 2017 23:11:40 +0000 (23:11 +0000)]
[Hexagon] Remove dead defs from the live set when expanding wstores

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292445 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert r291670 because it introduces a crash.
Michael Kuperstein [Wed, 18 Jan 2017 23:05:58 +0000 (23:05 +0000)]
Revert r291670 because it introduces a crash.

r291670 doesn't crash on the original testcase from PR31589,
but it crashes on a slightly more complex one.

PR31589 has the new reproducer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292444 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoImprove the `-filter-print-funcs` option to skip the banner for CGSCC pass when nothi...
Mehdi Amini [Wed, 18 Jan 2017 21:37:11 +0000 (21:37 +0000)]
Improve the `-filter-print-funcs` option to skip the banner for CGSCC pass when nothing is to be printed

Before, it would print a sequence of:

  *** IR Dump After Function Integration/Inlining ******
  *** IR Dump After Function Integration/Inlining ******
  *** IR Dump After Function Integration/Inlining ******
  ...

for every single function in the module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292442 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine] add tests for shl nsw with icmp eq/ne; NFCI
Sanjay Patel [Wed, 18 Jan 2017 21:31:21 +0000 (21:31 +0000)]
[InstCombine] add tests for shl nsw with icmp eq/ne; NFCI

These should be fixed with D28406.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292441 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine] add an assert to make a shl+icmp transform assumption explicit; NFCI
Sanjay Patel [Wed, 18 Jan 2017 21:16:12 +0000 (21:16 +0000)]
[InstCombine] add an assert to make a shl+icmp transform assumption explicit; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292440 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CodeGenPrepare] Fix a typo in the comment. NFC.
Haicheng Wu [Wed, 18 Jan 2017 21:12:10 +0000 (21:12 +0000)]
[CodeGenPrepare] Fix a typo in the comment. NFC.

encode => endcode.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292438 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine] remove a redundant check; NFCI
Sanjay Patel [Wed, 18 Jan 2017 20:09:59 +0000 (20:09 +0000)]
[InstCombine] remove a redundant check; NFCI

I missed deleting this check when I refactored this chunk in:
https://reviews.llvm.org/rL292260

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292433 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoThinLTOBitcodeWriter: Clear comdats on filtered globals.
Peter Collingbourne [Wed, 18 Jan 2017 20:03:02 +0000 (20:03 +0000)]
ThinLTOBitcodeWriter: Clear comdats on filtered globals.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292431 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoCloning: Copy comdats when cloning globals.
Peter Collingbourne [Wed, 18 Jan 2017 20:02:31 +0000 (20:02 +0000)]
Cloning: Copy comdats when cloning globals.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292430 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix up a comment. NFC.
Michael Kuperstein [Wed, 18 Jan 2017 19:05:48 +0000 (19:05 +0000)]
Fix up a comment. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292425 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LV] Allow reductions that have several uses outside the loop
Michael Kuperstein [Wed, 18 Jan 2017 19:02:52 +0000 (19:02 +0000)]
[LV] Allow reductions that have several uses outside the loop

We currently check whether a reduction has a single outside user. We don't
really need to require that - we just need to make sure a single value is
used externally. The number of external users of that value shouldn't actually
matter.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292424 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agocmake: Only sanitize use-after-scope if the host compiler supports it
Justin Bogner [Wed, 18 Jan 2017 19:01:58 +0000 (19:01 +0000)]
cmake: Only sanitize use-after-scope if the host compiler supports it

In r292256, we started adding -fsanitize-use-after-scope when using
the address sanitizer, but that flag wasn't always available. This
fixes the config to only add the flag if the host compiler supports
it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292423 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] Generate literals by the little end
Evandro Menezes [Wed, 18 Jan 2017 18:57:08 +0000 (18:57 +0000)]
[AArch64] Generate literals by the little end

ARM seems to prefer that long literals be formed from their little end in
order to promote the fusion of the instrs pairs MOV/MOVK and MOVK/MOVK on
Cortex A57 and others (v.  "Cortex A57 Software Optimisation Guide", section
4.14).

Differential revision: https://reviews.llvm.org/D28697

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292422 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NewGVN] We don't use postdom info anymore. Update.
Davide Italiano [Wed, 18 Jan 2017 18:42:28 +0000 (18:42 +0000)]
[NewGVN] We don't use postdom info anymore. Update.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292421 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ThinLTO] Add a recursive step in Metadata lazy-loading
Mehdi Amini [Wed, 18 Jan 2017 18:36:21 +0000 (18:36 +0000)]
[ThinLTO] Add a recursive step in Metadata lazy-loading

Summary:
Without this, we're stressing the RAUW of unique nodes,
which is a costly operation. This is intended to limit
the number of RAUW, and is very effective on the total
link-time of opt with ThinLTO, before:

  real 4m4.587s  user 15m3.401s  sys 0m23.616s

after:

  real 3m25.261s user 12m22.132s sys 0m24.152s

Reviewers: tejohnson, pcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292420 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[lit] Support sharding testsuites, for parallel execution.
Graydon Hoare [Wed, 18 Jan 2017 18:12:20 +0000 (18:12 +0000)]
[lit] Support sharding testsuites, for parallel execution.

Summary:
This change equips lit.py with two new options, --num-shards=M and
--run-shard=N (set by default from env vars LIT_NUM_SHARDS and LIT_RUN_SHARD).

The options must be used together, and N must be in 1..M.

Together these options effect only test selection: they partition the testsuite
into M equal-sized "shards", then select only the Nth shard. They can be used
in a cluster of test machines to achieve a very crude (static) form of
parallelism, with minimal configuration work.

Reviewers: modocache, ddunbar

Reviewed By: ddunbar

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292417 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SLP] Add a tests for a fix for PR30787.
Alexey Bataev [Wed, 18 Jan 2017 18:07:46 +0000 (18:07 +0000)]
[SLP] Add a tests for a fix for PR30787.

Add a test for PR30787: Failure to beneficially vectorize 'copyable'
elements in integer binary ops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292416 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AMDGPU] Do not allow register coalescer to create big superregs
Stanislav Mekhanoshin [Wed, 18 Jan 2017 17:30:05 +0000 (17:30 +0000)]
[AMDGPU] Do not allow register coalescer to create big superregs

Limit register coalescer by not allowing it to artificially increase
size of registers beyond dword. Such super-registers are in fact
register sequences and not distinct HW registers.

With more super-regs we would need to allocate adjacent registers
and constraint regalloc more than needed. Moreover, our super
registers are overlapping. For instance we have VGPR0_VGPR1_VGPR2,
VGPR1_VGPR2_VGPR3, VGPR2_VGPR3_VGPR4 etc, which complicates registers
allocation even more, resulting in excessive spilling.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292413 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoGlobalISel: Implement narrowing for G_STORE
Justin Bogner [Wed, 18 Jan 2017 17:29:54 +0000 (17:29 +0000)]
GlobalISel: Implement narrowing for G_STORE

Legalize stores of types that are too wide by breaking them up into
sequences of smaller stores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292412 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoGlobalISel: Correct copy-pasted comment. NFC
Justin Bogner [Wed, 18 Jan 2017 17:28:41 +0000 (17:28 +0000)]
GlobalISel: Correct copy-pasted comment. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292411 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDon't create a comdat group for a dropped def with initializer
Teresa Johnson [Wed, 18 Jan 2017 16:58:43 +0000 (16:58 +0000)]
Don't create a comdat group for a dropped def with initializer

Non-prevailing weak/linkonce odr symbols will be dropped by ThinLTO to
available_externally when possible. If they had an initializer in the
global_ctors list, a comdat group was being created. This code
already had logic to skip available_externally defs, but now the
EliminateAvailableExternally pass will drop these symbols to
declarations earlier. Change the check to skip all declarations for
linker (which includes available_externally along with declarations).

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292408 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert 292404 due to buildbot failures.
Kirill Bobyrev [Wed, 18 Jan 2017 16:34:25 +0000 (16:34 +0000)]
Revert 292404 due to buildbot failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292407 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Minor code cleanup to fix several clang-tidy warnings. NFC
Kirill Bobyrev [Wed, 18 Jan 2017 16:15:47 +0000 (16:15 +0000)]
[X86] Minor code cleanup to fix several clang-tidy warnings. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292404 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Create SubtargetFeatures from build attrs
Sam Parker [Wed, 18 Jan 2017 15:52:11 +0000 (15:52 +0000)]
[ARM] Create SubtargetFeatures from build attrs

An ELFObjectFile can now create SubtargetFeatures from the available
ARM build attributes, in a similar manner to MIPS. I've moved the
MIPS code into its own function and the ARM handler also has a
separate function.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292403 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoraw_fd_ostream: Make file handles non-inheritable by default
Pavel Labath [Wed, 18 Jan 2017 15:46:50 +0000 (15:46 +0000)]
raw_fd_ostream: Make file handles non-inheritable by default

Summary:
This makes the file descriptors on unix platform non-inheritable (O_CLOEXEC).

There is no change in behavior on windows, as the handles were already
non-inheritable there.

Reviewers: rnk, rafael

Subscribers: llvm-commits, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292401 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Assembler] Fix crash when assembling .quad for AArch32.
Chad Rosier [Wed, 18 Jan 2017 15:02:54 +0000 (15:02 +0000)]
[Assembler] Fix crash when assembling .quad for AArch32.

A 64-bit relocation does not exist in 32-bit ARMELF. Report an error
instead of crashing.

PR23870
Patch by Sanne Wouda (sanwou01).
Differential Revision: https://reviews.llvm.org/D28851

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292373 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[thumb,framelowering] Reset NoVRegs in Thumb1FrameLowering::emitPrologue.
Florian Hahn [Wed, 18 Jan 2017 15:01:22 +0000 (15:01 +0000)]
[thumb,framelowering] Reset NoVRegs in Thumb1FrameLowering::emitPrologue.

Summary:
In this function, virtual registers can be introduced (for example
through calls to emitThumbRegPlusImmInReg). doScavengeFrameVirtualRegs
will replace those virtual registers with concrete registers later on
in PrologEpilogInserter, which sets NoVRegs again.

This patch fixes the Codegen/Thumb/segmented-stacks.ll test case which
failed with expensive checks.
https://llvm.org/bugs/show_bug.cgi?id=27484

Reviewers: rnk, bkramer, olista01

Reviewed By: olista01

Subscribers: llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292372 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine][AVX2] Add DemandedElts support for VPERMD/VPERMPS shuffles
Simon Pilgrim [Wed, 18 Jan 2017 14:47:49 +0000 (14:47 +0000)]
[InstCombine][AVX2] Add DemandedElts support for VPERMD/VPERMPS shuffles

Simplify a vpermv shuffle mask based on the elements of the mask that are actually demanded.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292371 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRe-revert: [globalisel] Tablegen-erate current Register Bank Information
Daniel Sanders [Wed, 18 Jan 2017 14:26:12 +0000 (14:26 +0000)]
Re-revert: [globalisel] Tablegen-erate current Register Bank Information

More missing guards. My build didn't notice it due to a stale file left over
from a Global ISel build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292369 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine][AVX2] Tests showing missed opportunities to pass demanded elts through...
Simon Pilgrim [Wed, 18 Jan 2017 14:23:06 +0000 (14:23 +0000)]
[InstCombine][AVX2] Tests showing missed opportunities to pass demanded elts through a vpermd/vpermps shuffle

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292368 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRe-commit: [globalisel] Tablegen-erate current Register Bank Information
Daniel Sanders [Wed, 18 Jan 2017 14:17:50 +0000 (14:17 +0000)]
Re-commit: [globalisel] Tablegen-erate current Register Bank Information

Summary:
Adds a RegisterBank tablegen class that can be used to declare the register
banks and an associated tablegen pass to generate the necessary code.

Changes since last commit:
The new tablegen pass is now correctly guarded by LLVM_BUILD_GLOBAL_ISEL and
this should fix the buildbots however it may not be the whole fix. The previous
buildbot failures suggest there may be a memory bug lurking that I'm unable to
reproduce (including when using asan) or spot in the source. If they re-occur
on this commit then I'll need assistance from the bot owners to track it down.

Reviewers: t.p.northover, ab, rovka, qcolombet

Reviewed By: qcolombet

Subscribers: aditya_nandakumar, rengolin, kristof.beyls, vkalintiris, mgorny, dberris, llvm-commits, rovka

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292367 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Create objdump subtarget from build attrs
Sam Parker [Wed, 18 Jan 2017 13:52:12 +0000 (13:52 +0000)]
[ARM] Create objdump subtarget from build attrs

Enable an ELFObjectFile to read the its arm build attributes to
produce a target triple with a specific ARM architecture.
llvm-objdump now uses this functionality to automatically produce
a more accurate target.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292366 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine] Remove unnecessary intrinsics demanded elts handling
Simon Pilgrim [Wed, 18 Jan 2017 13:44:04 +0000 (13:44 +0000)]
[InstCombine] Remove unnecessary intrinsics demanded elts handling

As discussed on D28777 - we don't need to handle 'all element' shuffles inside InstCombiner::visitCallInst as InstCombiner::SimplifyDemandedVectorElts will do everything we need.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292365 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFixed parser error on windows shell evaluation of RUN script line
Simon Pilgrim [Wed, 18 Jan 2017 11:40:28 +0000 (11:40 +0000)]
Fixed parser error on windows shell evaluation of RUN script line

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292363 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Simplify umax knownbits test
Simon Pilgrim [Wed, 18 Jan 2017 11:20:31 +0000 (11:20 +0000)]
[X86][SSE] Simplify umax knownbits test

combineSRA doesn't detect sign bits splats that it does itself so just use -1 as the demanded input so that its already splatted

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292361 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Improve mul combine for negative multiplayer (2^c - 1)
Michael Zuckerman [Wed, 18 Jan 2017 09:31:13 +0000 (09:31 +0000)]
[X86] Improve mul combine for negative multiplayer (2^c - 1)

This patch improves the mul instruction combine function (combineMul)
by adding new layer of logic.
In this patch, we are adding the ability to fold (mul x, -((1 << c) -1))
or (mul x, -((1 << c) +1)) into (neg(X << c) -x) or (neg((x << c) + x) respective.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292358 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[XRay][Arm] Repair XRay table emission on Arm32 and add tests to identify...
Renato Golin [Wed, 18 Jan 2017 09:08:43 +0000 (09:08 +0000)]
Revert "[XRay][Arm] Repair XRay table emission on Arm32 and add tests to identify such problem earlier"

This reverts commit r292210, as it broke the Thumb buldbot with:

clang-5.0: error: the clang compiler does not support '-fxray-instrument
on thumbv7-unknown-linux-gnueabihf'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292357 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SystemZ] Proper handling of undef flag while expanding pseudo.
Jonas Paulsson [Wed, 18 Jan 2017 08:32:54 +0000 (08:32 +0000)]
[SystemZ] Proper handling of undef flag while expanding pseudo.

During post-RA pseudo expansion, an 'undef' flag of the source operand should
be propagated by emitGRX32Move().

Review: Ulrich Weigand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292353 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Fix for bugzilla 31576 - add support for "data32" instruction prefix
Marina Yatsina [Wed, 18 Jan 2017 08:07:51 +0000 (08:07 +0000)]
[X86] Fix for bugzilla 31576 - add support for "data32" instruction prefix

This patch fixes bugzilla 31576 (https://llvm.org/bugs/show_bug.cgi?id=31576).

"data32" instruction prefix was not defined in the llvm.
An exception had to be added to the X86 tablegen and AsmPrinter because both "data16" and "data32" are encoded to 0x66 (but in different modes).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292352 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopDeletion] (cleanup, NFC) Fix one more local variable that didn't
Chandler Carruth [Wed, 18 Jan 2017 02:43:01 +0000 (02:43 +0000)]
[LoopDeletion] (cleanup, NFC) Fix one more local variable that didn't
follow LLVM's naming conventions while I'm here.

Again, sorry I didn't spot this earlier to coalesce with other cleanup
changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292333 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PM] Teach LoopDeletion to correctly update the LPM when loops are
Chandler Carruth [Wed, 18 Jan 2017 02:41:26 +0000 (02:41 +0000)]
[PM] Teach LoopDeletion to correctly update the LPM when loops are
deleted.

I've expanded its test coverage a bit including adding one test that
will crash clearly without this change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292332 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopDeletion] (cleanup, NFC) Make this test actually test what it
Chandler Carruth [Wed, 18 Jan 2017 02:29:35 +0000 (02:29 +0000)]
[LoopDeletion] (cleanup, NFC) Make this test actually test what it
claims to test.

LoopSimplify was unifying the multiple exits in this test case, making
it never even test the multiple exit handling of LoopDeletion. Doh.

Now it works (thanks to a great idea from mkuper) and will fail if we
ever change something to make it stop working.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292331 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDAG: Consider nnan in isKnownNeverNaN
Matt Arsenault [Wed, 18 Jan 2017 02:10:08 +0000 (02:10 +0000)]
DAG: Consider nnan in isKnownNeverNaN

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292328 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert rL292292 since it causes a SEGV on sanitizer-x86_64-linux-fuzzer build bot.
Wei Mi [Wed, 18 Jan 2017 01:53:53 +0000 (01:53 +0000)]
Revert rL292292 since it causes a SEGV on sanitizer-x86_64-linux-fuzzer build bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292327 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] remove stale code
Kostya Serebryany [Wed, 18 Jan 2017 01:10:18 +0000 (01:10 +0000)]
[libFuzzer] remove stale code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292325 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[test-release.sh] Add Polly to the list of projects
Pengxuan Zheng [Wed, 18 Jan 2017 01:03:29 +0000 (01:03 +0000)]
[test-release.sh] Add Polly to the list of projects

Reviewers: zinob, hans, grosser

Reviewed By: hans, grosser

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292323 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WebAssembly] Update grow_memory's return type.
Dan Gohman [Wed, 18 Jan 2017 01:02:45 +0000 (01:02 +0000)]
[WebAssembly] Update grow_memory's return type.

The grow_memory instruction now returns the previous memory size. Add the
return type to the LLVM intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292322 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMIRParser: Allow regclass specification on operand
Matthias Braun [Wed, 18 Jan 2017 00:59:19 +0000 (00:59 +0000)]
MIRParser: Allow regclass specification on operand

You can now define the register class of a virtual register on the
operand itself avoiding the need to use a "registers:" block.

Example: "%0:gr64 = COPY %rax"

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292321 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Target, Transforms] Fix some Clang-tidy modernize and Include What You Use warnings...
Eugene Zelenko [Wed, 18 Jan 2017 00:57:48 +0000 (00:57 +0000)]
[Target, Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292320 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] exit(1) on failed merge
Kostya Serebryany [Wed, 18 Jan 2017 00:55:29 +0000 (00:55 +0000)]
[libFuzzer] exit(1) on failed merge

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292319 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] better link for trophies
Kostya Serebryany [Wed, 18 Jan 2017 00:45:02 +0000 (00:45 +0000)]
[libFuzzer] better link for trophies

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292318 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NVPTX] Support global variables of integer type larger than i64.
Justin Lebar [Wed, 18 Jan 2017 00:29:53 +0000 (00:29 +0000)]
[NVPTX] Support global variables of integer type larger than i64.

Reviewers: tra, majnemer

Subscribers: llvm-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292316 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago2 returns next to each other =). NFC
Xin Tong [Wed, 18 Jan 2017 00:26:17 +0000 (00:26 +0000)]
2 returns next to each other =). NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292315 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSkip loop header while we can when computing loop safety info
Xin Tong [Wed, 18 Jan 2017 00:15:11 +0000 (00:15 +0000)]
Skip loop header while we can when computing loop safety info

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292310 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LIT] Make util.executeCommand python3 friendly
Eric Fiselier [Wed, 18 Jan 2017 00:12:41 +0000 (00:12 +0000)]
[LIT] Make util.executeCommand python3 friendly

Summary: The parameter `input` to `subprocess.Popen.communicate(...)` must be an object of type `bytes` . This is strictly enforced in python3. This patch (1) allows `to_bytes` to be safely called redundantly. (2) Explicitly convert `input` within `executeCommand`. This allows for usages like `executeCommand(['clang++', '-'], input='int main() {}\n')`.

Reviewers: ddunbar, BinaryKhaos, modocache, dim, EricWF

Reviewed By: EricWF

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292308 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NVPTX] Standardize asm printer on "foo \tbar".
Justin Lebar [Wed, 18 Jan 2017 00:09:36 +0000 (00:09 +0000)]
[NVPTX] Standardize asm printer on "foo \tbar".

Some instructions were printed as "foo\tbar", but most are printed as
"foo \bar".  Standardize on the latter form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292306 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NVPTX] Clean up nested !strconcat calls.
Justin Lebar [Wed, 18 Jan 2017 00:09:19 +0000 (00:09 +0000)]
[NVPTX] Clean up nested !strconcat calls.

!strconcat is a variadic function; it will concatenate an arbitrary
number of strings.  There's no need to nest it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292305 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NVPTX] Implement min/max in tablegen, rather than with custom DAGComine logic.
Justin Lebar [Wed, 18 Jan 2017 00:09:01 +0000 (00:09 +0000)]
[NVPTX] Implement min/max in tablegen, rather than with custom DAGComine logic.

Summary:
This change also lets us use max.{s,u}16.  There's a vague warning in a
test about this maybe being less efficient, but I could not come up with
a case where the resulting SASS (sm_35 or sm_60) was different with or
without max.{s,u}16.  It's true that nvcc seems to emit only
max.{s,u}32, but even ptxas 7.0 seems to have no problem generating
efficient SASS from max.{s,u}16 (the casts up to i32 and back down to
i16 seem to be implicit and nops, happening via register aliasing).

In the absence of evidence, better to have fewer special cases, emit
more straightforward code, etc.  In particular, if a new GPU has 16-bit
min/max instructions, we want to be able to use them.

Reviewers: tra

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292304 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NVPTX] Lower integer absolute value idiom to abs instruction.
Justin Lebar [Wed, 18 Jan 2017 00:08:44 +0000 (00:08 +0000)]
[NVPTX] Lower integer absolute value idiom to abs instruction.

Summary: Previously we lowered it literally, to shifts and xors.

Reviewers: tra

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292303 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NVPTX] Improve lowering of llvm.ctpop.
Justin Lebar [Wed, 18 Jan 2017 00:08:27 +0000 (00:08 +0000)]
[NVPTX] Improve lowering of llvm.ctpop.

Summary:
Avoid an unnecessary conversion operation when using the result of
ctpop.i32 or ctpop.i16 as an i32, as in both cases the ptx instruction
we run returns an i32.

(Previously if we used the value as an i32, we'd do an unnecessary
zext+trunc.)

Reviewers: tra

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292302 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NVPTX] Add lowering for llvm.bitreverse.
Justin Lebar [Wed, 18 Jan 2017 00:08:10 +0000 (00:08 +0000)]
[NVPTX] Add lowering for llvm.bitreverse.

Reviewers: tra

Subscribers: llvm-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292301 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NVPTX] Fix function names in ctlz.ll test. Test-only change.
Justin Lebar [Wed, 18 Jan 2017 00:07:52 +0000 (00:07 +0000)]
[NVPTX] Fix function names in ctlz.ll test.  Test-only change.

Looks like a copy/paste mistake, all the functions in ctlz.ll were named
"ctpop".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292300 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NVPTX] Improve lowering of llvm.ctlz.
Justin Lebar [Wed, 18 Jan 2017 00:07:35 +0000 (00:07 +0000)]
[NVPTX] Improve lowering of llvm.ctlz.

Summary:
* Disable "ctlz speculation", which inserts a branch on every ctlz(x) which
  has defined behavior on x == 0 to check whether x is, in fact zero.

* Add DAG patterns that avoid re-truncating or re-expanding the result
  of the 16- and 64-bit ctz instructions.

Reviewers: tra

Subscribers: llvm-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292299 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[IR] Grammar police: "intact" is one word. NFC
Justin Lebar [Wed, 18 Jan 2017 00:07:18 +0000 (00:07 +0000)]
[IR] Grammar police: "intact" is one word.  NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292298 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine] add tests to show missed shrinkage; NFC
Sanjay Patel [Wed, 18 Jan 2017 00:03:23 +0000 (00:03 +0000)]
[InstCombine] add tests to show missed shrinkage; NFC

A patch to partially solve this:
https://reviews.llvm.org/D28625

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292296 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] add ATTRIBUTE_NO_SANITIZE_MEMORY to sanitizer hooks
Kostya Serebryany [Tue, 17 Jan 2017 23:50:21 +0000 (23:50 +0000)]
[libFuzzer] add ATTRIBUTE_NO_SANITIZE_MEMORY to sanitizer hooks

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292295 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIntroduce -unroll-partial-threshold to separate PartialThreshold from Threshold in...
Dehao Chen [Tue, 17 Jan 2017 23:39:33 +0000 (23:39 +0000)]
Introduce -unroll-partial-threshold to separate PartialThreshold from Threshold in loop unorller.

Summary: Partial unrolling should have separate threshold with full unrolling.

Reviewers: efriedma, mzolotukhin

Reviewed By: efriedma, mzolotukhin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292293 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterCoalescing] Remove partial redundent copy.
Wei Mi [Tue, 17 Jan 2017 23:39:07 +0000 (23:39 +0000)]
[RegisterCoalescing] Remove partial redundent copy.

The patch is to solve the performance problem described in PR27827.
Register coalescing sometimes cannot remove a copy because of interference.
But if we can find a reverse copy in one of the predecessor block of the copy,
the copy is partially redundent and we may remove the copy partially by moving
it to the predecessor block without the reverse copy.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292292 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix GettingStarted doc so that the example build command for cmake LLVM_ENABLE_PROJEC...
Mehdi Amini [Tue, 17 Jan 2017 23:23:08 +0000 (23:23 +0000)]
Fix GettingStarted doc so that the example build command for cmake LLVM_ENABLE_PROJECTS works on linux

I tested the previous one on macOS, however building libc++ on Linux
requires libcxxabi as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292290 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libfuzzer] fixing collected pc addresses for coverage
Mike Aizatsky [Tue, 17 Jan 2017 23:11:32 +0000 (23:11 +0000)]
[libfuzzer] fixing collected pc addresses for coverage

Summary: The causes google/ossfuzz#84

Reviewers: kcc

Subscribers: mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292289 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Add SparseBitVector::find_last().
Zachary Turner [Tue, 17 Jan 2017 23:09:21 +0000 (23:09 +0000)]
[ADT] Add SparseBitVector::find_last().

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292288 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] use table of recent compares for memcmp/strcmp (to unify the code between...
Kostya Serebryany [Tue, 17 Jan 2017 23:09:05 +0000 (23:09 +0000)]
[libFuzzer] use table of recent compares for memcmp/strcmp (to unify the code between cmp and memcmp handling)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292287 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] copy the options inside MutationDispatcher to avoid use-after-scope in...
Kostya Serebryany [Tue, 17 Jan 2017 23:05:07 +0000 (23:05 +0000)]
[libFuzzer] copy the options inside MutationDispatcher to avoid use-after-scope in mutator tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292286 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoGlobalISel: fix comparison order for G_FCMP
Tim Northover [Tue, 17 Jan 2017 23:04:01 +0000 (23:04 +0000)]
GlobalISel: fix comparison order for G_FCMP

As with G_ICMP we'd written the CSET instructions backwards.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292285 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoGlobalISel: add callseq instructions to record stack usage
Tim Northover [Tue, 17 Jan 2017 22:43:34 +0000 (22:43 +0000)]
GlobalISel: add callseq instructions to record stack usage

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292284 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoGlobalISel: correctly handle varargs
Tim Northover [Tue, 17 Jan 2017 22:30:10 +0000 (22:30 +0000)]
GlobalISel: correctly handle varargs

Some platforms (notably iOS) use a different calling convention for unnamed vs
named parameters in varargs functions, so we need to keep track of this
information when translating calls.

Since not many platforms are involved, the guts of the special handling is in
the ValueHandler class (with a generic implementation that should work for most
targets).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292283 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopDeletion] (cleanup, NFC) Use the dedicated helper to get a single
Chandler Carruth [Tue, 17 Jan 2017 22:28:52 +0000 (22:28 +0000)]
[LoopDeletion] (cleanup, NFC) Use the dedicated helper to get a single
unique exit block if available rather than rolling it ourselves.

This is a little disappointing because that helper doesn't do anything
clever to short-circuit the (surprisingly expensive) computation of all
exit blocks. What's worse is that the way we compute this is hopelessly,
hilariously inefficient. We're literally computing the same information
two different ways and multiple times each way:
- hasDedicatedExits computes the exit block set and then looks at the
  predecessors of each
- getExitingBlocks computes the set of loop blocks which have exiting
  successors
- getUniqueExitBlock(s) computes the set of non-loop blocks reached from
  loop blocks (sound familiar?)

Anyways, at some point we should clean all of this up in the LoopInfo
API, but for now just simplifying the user I'm about to touch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292282 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LV] Add requires asserts to test case
Matthew Simpson [Tue, 17 Jan 2017 22:21:33 +0000 (22:21 +0000)]
[LV] Add requires asserts to test case

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292280 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopDeletion] (cleanup, NFC) Fix another variable name to match LLVM
Chandler Carruth [Tue, 17 Jan 2017 22:19:56 +0000 (22:19 +0000)]
[LoopDeletion] (cleanup, NFC) Fix another variable name to match LLVM
conventions, missed this one in a previous cleanup patch (sorry).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292279 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GlobalISel] track predecessor mapping during switch lowering.
Tim Northover [Tue, 17 Jan 2017 22:13:50 +0000 (22:13 +0000)]
[GlobalISel] track predecessor mapping during switch lowering.

Correctly populating Machine PHIs relies on knowing exactly how the IR level
CFG was lowered to MachineIR. This needs to be tracked by any translation
phases that meddle (currently only SwitchInst handling).

This reapplies r291973 which was reverted because of testing failures. Fixes:

 + Don't return an ArrayRef to a local temporary.
 + Incorporate Kristof's suggested comment improvements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292278 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Split UMIN and UMAX known bits tests
Simon Pilgrim [Tue, 17 Jan 2017 22:12:25 +0000 (22:12 +0000)]
[X86][SSE] Split UMIN and UMAX known bits tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292277 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopDeletion] (cleanup, NFC) Remove a pointless comment.
Chandler Carruth [Tue, 17 Jan 2017 22:09:28 +0000 (22:09 +0000)]
[LoopDeletion] (cleanup, NFC) Remove a pointless comment.

I hope that for any code, it is changed only with good reason and only
when the author knows what they are doing...

There is of course good reason to comment here about the subtlety of the
process, and I've left that comment in tact.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292275 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopDeletion] (cleanup, NFC) Make simple helper functions static
Chandler Carruth [Tue, 17 Jan 2017 22:07:26 +0000 (22:07 +0000)]
[LoopDeletion] (cleanup, NFC) Make simple helper functions static
instead of members.

No state was being provided by the object so this seems strictly
simpler.

I've also tried to improve the name and comments for the functions to
more thoroughly document what they are doing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292274 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopDeletion] (cleanup, NFC) Stop passing around reference to a vector
Chandler Carruth [Tue, 17 Jan 2017 22:00:52 +0000 (22:00 +0000)]
[LoopDeletion] (cleanup, NFC) Stop passing around reference to a vector
that we know has exactly one element when all we are going to do is get
that one element out of it.

Instead, pass around that one element.

There are more simplifications to come in this code...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292273 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PM] Clean up variable and parameter names to match modern LLVM naming
Chandler Carruth [Tue, 17 Jan 2017 21:51:39 +0000 (21:51 +0000)]
[PM] Clean up variable and parameter names to match modern LLVM naming
conventions more conistently before hacking on this code to integrate
nicely with new PM's loop pass infrastructure. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292272 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSilence some Sphinx diagnostics in an attempt to get the documentation builder back...
Aaron Ballman [Tue, 17 Jan 2017 21:48:31 +0000 (21:48 +0000)]
Silence some Sphinx diagnostics in an attempt to get the documentation builder back to green (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/1895).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292271 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd a test case for LICM when promoting locals that may be read after the throw withi...
Xin Tong [Tue, 17 Jan 2017 21:26:36 +0000 (21:26 +0000)]
Add a test case for LICM when promoting locals that may be read after the throw within the loop. NFCI.

Summary: Add a test case for LICM when promoting locals that may be read after the throw within the loop.

Reviewers: eli.friedman, hfinkel, sanjoy

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292261 91177308-0d34-0410-b5e6-96231b3b80d8