]> granicus.if.org Git - llvm/log
llvm
5 years ago[llvm-objcopy] - Refactor the code. NFC.
George Rimar [Mon, 25 Mar 2019 12:34:25 +0000 (12:34 +0000)]
[llvm-objcopy] - Refactor the code. NFC.

The idea of the patch is about to move out the code to a new
helper static functions (to reduce the size of 'handleArgs' and to
isolate the parts of it's logic).

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

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

5 years ago[MIPS GlobalISel] Select copy for arguments from FPRBRegBank
Petar Avramovic [Mon, 25 Mar 2019 11:38:06 +0000 (11:38 +0000)]
[MIPS GlobalISel] Select copy for arguments from FPRBRegBank

Move selectCopy into MipsInstructionSelector class.
Select copy for arguments from FPRBRegBank for MIPS32.

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

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

5 years agogn build: Clean up README.rst a bit
Nico Weber [Mon, 25 Mar 2019 11:33:19 +0000 (11:33 +0000)]
gn build: Clean up README.rst a bit

- Make introduction a bit shorter
- Add a `git clone` step to Quick start
- Put command to run first in each of the Quick start steps
- Use ``code`` instead of `label` throughout; this is .rst not .md

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

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

5 years agogn build: Let get.py keep zip file in memory instead of using a temp file
Nico Weber [Mon, 25 Mar 2019 11:32:27 +0000 (11:32 +0000)]
gn build: Let get.py keep zip file in memory instead of using a temp file

The zip is small, and it's a bit less code this way.
No intended behavior change.

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

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

5 years ago[MIPS GlobalISel] Add floating point register bank
Petar Avramovic [Mon, 25 Mar 2019 11:30:46 +0000 (11:30 +0000)]
[MIPS GlobalISel] Add floating point register bank

Add floating point register bank for MIPS32.
Implement getRegBankFromRegClass for float register classes.

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

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

5 years ago[MIPS GlobalISel] Lower float and double arguments in registers
Petar Avramovic [Mon, 25 Mar 2019 11:23:41 +0000 (11:23 +0000)]
[MIPS GlobalISel] Lower float and double arguments in registers

Lower float and double arguments in registers for MIPS32.
When float/double argument is passed through gpr registers
select appropriate move instruction.

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

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

5 years ago[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`
Xing GUO [Mon, 25 Mar 2019 11:02:49 +0000 (11:02 +0000)]
[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`

Summary:
Currently, llvm-readobj can dump symbol version sections only in LLVM style. In this patch, I would like to separate these dumpers into GNU style and
LLVM style for future implementation.

Reviewers: grimar, jhenderson, mattd, rupprecht

Reviewed By: jhenderson, rupprecht

Subscribers: ormris, dyung, RKSimon, llvm-commits

Tags: #llvm

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

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

5 years agoFix the build with GCC 4.8 after r356783
Hans Wennborg [Mon, 25 Mar 2019 09:27:42 +0000 (09:27 +0000)]
Fix the build with GCC 4.8 after r356783

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

5 years ago[TTI] Move getIntrinsicCost to allow functions to be overridden. NFC
Sjoerd Meijer [Mon, 25 Mar 2019 08:54:47 +0000 (08:54 +0000)]
[TTI] Move getIntrinsicCost to allow functions to be overridden. NFC

Moving this to base class TargetTransformInfoImplCRTPBase allows static_cast to
a subtarget so that calls to e.g. getMemcpyCost actually go the overridden
functions.

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

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

5 years ago[ARM GlobalISel] 64-bit memops should be aligned
Diana Picus [Mon, 25 Mar 2019 08:54:29 +0000 (08:54 +0000)]
[ARM GlobalISel] 64-bit memops should be aligned

We currently use only VLDR/VSTR for all 64-bit loads/stores, so the
memory operands must be word-aligned. Mark aligned operations as legal
and narrow non-aligned ones to 32 bits.

While we're here, also mark non-power-of-2 loads/stores as unsupported.

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

5 years ago[X86] Update some of the getMachineNode calls from X86ISelDAGToDAG to also include...
Craig Topper [Mon, 25 Mar 2019 07:22:18 +0000 (07:22 +0000)]
[X86] Update some of the getMachineNode calls from X86ISelDAGToDAG to also include a VT for a EFLAGS result.

This makes the nodes consistent with how they would be emitted from the isel
table.

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

5 years ago[X86] When selecting (x << C1) op C2 as (x op (C2>>C1)) << C1, use the operation...
Craig Topper [Mon, 25 Mar 2019 06:53:45 +0000 (06:53 +0000)]
[X86] When selecting (x << C1) op C2 as (x op (C2>>C1)) << C1, use the operation VT for the target constant.

Normally when the nodes we use here(AND32ri8 for example) are selected their
immediates are just converted from ConstantSDNode to TargetConstantSDNode
without changing VT from the original operation VT. So we should still be
emitting them with the operation VT.

Theoretically this could expose more accurate opportunities for CSE.

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

5 years ago[X86] Remove GetLo8XForm and use GetLo32XForm instead. NFCI
Craig Topper [Mon, 25 Mar 2019 06:53:44 +0000 (06:53 +0000)]
[X86] Remove GetLo8XForm and use GetLo32XForm instead. NFCI

We were using this to create an AND32ri8 node from a 64-bit and, but that node
normally still uses a 32-bit immediate. So we should just truncate the existing
immediate to i32. We already verified it has the same value in bits 31:7.

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

5 years ago[X86] Remove a couple unused SDNodeXForms. NFC
Craig Topper [Mon, 25 Mar 2019 06:53:43 +0000 (06:53 +0000)]
[X86] Remove a couple unused SDNodeXForms. NFC

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

5 years agoRevert r356688 "[X86] Don't avoid folding multiple use sign extended 8-bit immediate...
Craig Topper [Mon, 25 Mar 2019 01:25:32 +0000 (01:25 +0000)]
Revert r356688 "[X86] Don't avoid folding multiple use sign extended 8-bit immediate into instructions under optsize."

Looking back over how the one use optimization works, I don't think this is the right way to fix this.

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

5 years ago[X86][SSE41] Start shuffle combining from ZERO_EXTEND_VECTOR_INREG (PR40685)
Simon Pilgrim [Sun, 24 Mar 2019 19:06:35 +0000 (19:06 +0000)]
[X86][SSE41] Start shuffle combining from ZERO_EXTEND_VECTOR_INREG (PR40685)

Enable SSE41 ZERO_EXTEND_VECTOR_INREG shuffle combines - for the PMOVZX(PSHUFD(V)) -> UNPCKH(V,0) pattern we reduce the shuffles (port5-bottleneck on Intel) at the expense of creating a zero (pxor v,v) and an extra register move - which is a good trade off as these are pretty cheap and in most cases it doesn't increase register pressure.

This also exposed a missed opportunity to use combine to ZERO_EXTEND_VECTOR_INREG with folded loads - even if we're in the float domain.

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

5 years ago[WebAssembly] Rename a variable in CFGSort (NFC)
Heejin Ahn [Sun, 24 Mar 2019 17:34:40 +0000 (17:34 +0000)]
[WebAssembly] Rename a variable in CFGSort (NFC)

Class `RegionInfo` was `SortUnitInfo` before, so the variables were
named `SUI`. Now the class name is `RegionInfo`, so this renames `SUI`
to `RI`, matching the class name.

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

5 years ago[LegalizeDAG] Expand i16 bswap directly to a rotate by 8 instead of relying on DAG...
Craig Topper [Sun, 24 Mar 2019 17:02:14 +0000 (17:02 +0000)]
[LegalizeDAG] Expand i16 bswap directly to a rotate by 8 instead of relying on DAG combine.

An i16 bswap can be implemented with an i16 rotate by 8. We previously emitted
a shift and OR sequence that DAG combine should be able to turn back into
rotate. But we might as well go there directly. If rotate isn't legal,
LegalizeDAG should further legalize it to either the opposite rotate, or the
shift and OR pattern.

I don't know of any way to get the existing DAG combine reliance to fail. So
I don't know any way to add new tests for this that wouldn't have worked
previously.

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

5 years ago[X86] Remove icmp undef from reduced tests
Simon Pilgrim [Sun, 24 Mar 2019 17:02:08 +0000 (17:02 +0000)]
[X86] Remove icmp undef from reduced tests

Pre-commit for D59363 (Add icmp UNDEF handling to SelectionDAG::FoldSetCC)

Approved by @spatel (Sanjay Patel)

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

5 years ago[X86][AVX] Start shuffle combining from ZERO_EXTEND_VECTOR_INREG (PR40685)
Simon Pilgrim [Sun, 24 Mar 2019 16:30:35 +0000 (16:30 +0000)]
[X86][AVX] Start shuffle combining from ZERO_EXTEND_VECTOR_INREG (PR40685)

Just enable this for AVX for now as SSE41 introduces extra register moves for the PMOVZX(PSHUFD(V)) -> UNPCKH(V,0) pattern (but otherwise helps reduce port5 usage on Intel targets).

Only AVX support is required for PR40685 as the issue is due to 8i8->8i32 zext shuffle leftovers.

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

5 years ago[CGP] Make several static functions member functions (NFC)
Teresa Johnson [Sun, 24 Mar 2019 15:18:50 +0000 (15:18 +0000)]
[CGP] Make several static functions member functions (NFC)

This is extracted from D59696 as suggested in the review. It is
preparation for making the DominatorTree a member variable.

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

5 years agoRecommit r356738 "[llvm-objcopy] - Implement replaceSectionReferences for GroupSectio...
George Rimar [Sun, 24 Mar 2019 14:41:45 +0000 (14:41 +0000)]
Recommit r356738 "[llvm-objcopy] - Implement replaceSectionReferences for GroupSection class."

Fix: r356853 + set AddressAlign to 4 in
Inputs/compress-debug-sections.yaml for the new group section introduced.

Original commit message:

Currently, llvm-objcopy incorrectly handles compression and decompression of the
sections from COMDAT groups, because we do not implement the
replaceSectionReferences for this type of the sections.

The patch does that.

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

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

5 years ago[x86] improve the default expansion of uaddsat/usubsat
Sanjay Patel [Sun, 24 Mar 2019 13:55:54 +0000 (13:55 +0000)]
[x86] improve the default expansion of uaddsat/usubsat

This is yet another step towards solving PR14613:
https://bugs.llvm.org/show_bug.cgi?id=14613

uaddsat X, Y --> (X >u (X + Y)) ? -1 : X + Y
usubsat X, Y --> (X >u Y) ? X - Y : 0

We can't count on a sane vector ISA, so override the default (umin/umax)
expansion of unsigned add/sub saturate in cases where we do not have umin/umax.

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

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

5 years ago[SLPVectorizer] shouldReorderOperands - just check for reordering. NFCI.
Simon Pilgrim [Sun, 24 Mar 2019 13:36:32 +0000 (13:36 +0000)]
[SLPVectorizer] shouldReorderOperands - just check for reordering. NFCI.

Remove the I.getOperand() calls from inside shouldReorderOperands - reorderInputsAccordingToOpcode should handle the creation of the operand lists and shouldReorderOperands should just check to see whether the i'th element should be commuted.

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

5 years ago[llvm-objcopy] - Report SHT_GROUP sections with invalid alignment.
George Rimar [Sun, 24 Mar 2019 13:31:08 +0000 (13:31 +0000)]
[llvm-objcopy] - Report SHT_GROUP sections with invalid alignment.

This patch fixes the reason of ubsan failure (UB detected)
happened after landing the D59638 (I had to revert it).
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/11760/steps/check-llvm%20ubsan/logs/stdio)

Problem is the following. Our implementation of GroupSection assumes that
its address is 4 bytes aligned when writes it:

template <class ELFT>
void ELFSectionWriter<ELFT>::visit(const GroupSection &Sec) {
  ELF::Elf32_Word *Buf =
      reinterpret_cast<ELF::Elf32_Word *>(Out.getBufferStart() + Sec.Offset);
...

But the test case for D59638 did not set AddressAlign in YAML. So address was
not 4 bytes aligned since Sec.Offset was odd. That triggered the issue.

This patch teaches llvm-objcopy to report an error for such sections (which should
not met in reality), what is better than having UB.

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

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

5 years ago[ConstantRange] Add getFull() + getEmpty() named constructors; NFC
Nikita Popov [Sun, 24 Mar 2019 09:34:40 +0000 (09:34 +0000)]
[ConstantRange] Add getFull() + getEmpty() named constructors; NFC

This adds ConstantRange::getFull(BitWidth) and
ConstantRange::getEmpty(BitWidth) named constructors as more readable
alternatives to the current ConstantRange(BitWidth, /* full */ false)
and similar. Additionally private getFull() and getEmpty() member
functions are added which return a full/empty range with the same bit
width -- these are commonly needed inside ConstantRange.cpp.

The IsFullSet argument in the ConstantRange(BitWidth, IsFullSet)
constructor is now mandatory for the few usages that still make use of it.

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

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

5 years agogn build: Merge r356820
Nico Weber [Sat, 23 Mar 2019 23:22:45 +0000 (23:22 +0000)]
gn build: Merge r356820

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

5 years agogn build: Add build files for modularize and pp-trace
Nico Weber [Sat, 23 Mar 2019 23:16:41 +0000 (23:16 +0000)]
gn build: Add build files for modularize and pp-trace

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

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

5 years agoFix unused variable warning on non-asserts builds. NFCI.
Simon Pilgrim [Sat, 23 Mar 2019 16:56:23 +0000 (16:56 +0000)]
Fix unused variable warning on non-asserts builds. NFCI.

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

5 years agoRemove unused function argument. NFCI.
Simon Pilgrim [Sat, 23 Mar 2019 16:20:34 +0000 (16:20 +0000)]
Remove unused function argument. NFCI.

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

5 years ago[DWARF] Delete a stray break and a stray comment. NFC
Fangrui Song [Sat, 23 Mar 2019 16:15:40 +0000 (16:15 +0000)]
[DWARF] Delete a stray break and a stray comment. NFC

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

5 years ago[X86][SLP] Show example of failure to uniformly commute splats for 'alt' shuffles.
Simon Pilgrim [Sat, 23 Mar 2019 16:14:04 +0000 (16:14 +0000)]
[X86][SLP] Show example of failure to uniformly commute splats for 'alt' shuffles.

If either the main/alt opcodes isn't commutable we may end up with the splats not correctly commuted to the same side.

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

5 years ago[x86] reduce code duplication; NFC
Sanjay Patel [Sat, 23 Mar 2019 15:00:52 +0000 (15:00 +0000)]
[x86] reduce code duplication; NFC

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

5 years ago[SLPVectorizer] reorderInputsAccordingToOpcode - use InstructionState directly. NFCI.
Simon Pilgrim [Sat, 23 Mar 2019 13:44:06 +0000 (13:44 +0000)]
[SLPVectorizer] reorderInputsAccordingToOpcode - use InstructionState directly. NFCI.

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

5 years ago[LowerSwitch] Use ConstantRange::fromKnownBits(); NFC
Nikita Popov [Sat, 23 Mar 2019 12:48:54 +0000 (12:48 +0000)]
[LowerSwitch] Use ConstantRange::fromKnownBits(); NFC

Using an unsigned range to stay NFC, but a signed range would really
be more useful here.

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

5 years ago[SLPVectorizer] Don't repeat VL.size() call. NFCI.
Simon Pilgrim [Sat, 23 Mar 2019 12:11:25 +0000 (12:11 +0000)]
[SLPVectorizer] Don't repeat VL.size() call. NFCI.

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

5 years ago [DebugInfo] follow up for "add SectionedAddress to DebugInfo interfaces"
Alexey Lapshin [Sat, 23 Mar 2019 08:08:40 +0000 (08:08 +0000)]
  [DebugInfo] follow up for "add SectionedAddress to DebugInfo interfaces"

  [Symbolizer] Add getModuleSectionIndexForAddress() helper routine

  The https://reviews.llvm.org/D58194 patch changed symbolizer interface.
  Particularily it requires not only Address but SectionIndex also.
  Note object::SectionedAddress parameter:

  Expected<DILineInfo> symbolizeCode(const std::string &ModuleName,
                                   object::SectionedAddress ModuleOffset,
                                   StringRef DWPName = "");

  There are callers of symbolizer which do not know particular section index.
  That patch creates getModuleSectionIndexForAddress() routine which
  will detect section index for the specified address. Thus if caller
  set ModuleOffset.SectionIndex into object::SectionedAddress::UndefSection
  state then symbolizer would detect section index using
  getModuleSectionIndexForAddress routine.

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

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

5 years ago[gn] Add clang-tools-extra/clang-tidy/tool/BUILD.gn
Vitaly Buka [Sat, 23 Mar 2019 02:31:23 +0000 (02:31 +0000)]
[gn] Add clang-tools-extra/clang-tidy/tool/BUILD.gn

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

5 years ago[gn] Add clang-tools-extra/clang-tidy/tool/BUILD.gn
Vitaly Buka [Sat, 23 Mar 2019 02:20:48 +0000 (02:20 +0000)]
[gn] Add clang-tools-extra/clang-tidy/tool/BUILD.gn

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

5 years agoDisable MachO TBD write tests for Windows.
Juergen Ributzka [Sat, 23 Mar 2019 00:03:23 +0000 (00:03 +0000)]
Disable MachO TBD write tests for Windows.

The tests are failing on the windows bots. I am disabling them for now.
This is a followup to r356820.

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

5 years ago[Legacy][TimePasses] allow -time-passes reporting into a custom stream
Fedor Sergeev [Fri, 22 Mar 2019 23:11:08 +0000 (23:11 +0000)]
[Legacy][TimePasses] allow -time-passes reporting into a custom stream

As a followup to newpm -time-passes fix (D59366), now adding a similar
functionality to legacy time-passes.

Enhancing llvm::reportAndResetTimings to accept an optional stream
for reporting output. By default it still reports into the stream created
by CreateInfoOutputFile (-info-output-file).

Also fixing to actually reset after printing as declared.

Reviewed By: philip.pfaffe
Differential Revision: https://reviews.llvm.org/D59416

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

5 years agoFollowup for r356820 to fix the bots.
Juergen Ributzka [Fri, 22 Mar 2019 23:10:51 +0000 (23:10 +0000)]
Followup for r356820 to fix the bots.

Try using a move constructor instead.

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

5 years ago[TextAPI] TBD Reader/Writer
Juergen Ributzka [Fri, 22 Mar 2019 22:46:52 +0000 (22:46 +0000)]
[TextAPI] TBD Reader/Writer

Add basic infrastructure for reading and writting TBD files (version 1 - 3).

The TextAPI library is not used by anything yet (besides the unit tests). Tool
support will be added in a separate commit.

The TBD format is currently documented in the implementation file (TextStub.cpp).

https://reviews.llvm.org/D53945

Update: This contains changes to fix issues discovered by the bots:
 - add parentheses to silence warnings.
 - rename variables
 - use PlatformType from BinaryFormat
 - Trying if switching from a vector to an array will appeas the bots.
 - Replace the tuple with a struct to work around an explicit constructor bug.
 - This fixes an issue where we were leaking the YAML document if there was a
   parsing error.

Updated the license information in all files.

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

5 years ago[SLP] Remove redundancy of performing operand reordering twice: once in buildTree...
Simon Pilgrim [Fri, 22 Mar 2019 21:27:11 +0000 (21:27 +0000)]
[SLP] Remove redundancy of performing operand reordering twice: once in buildTree() and later in vectorizeTree().

This is a refactoring patch that removes the redundancy of performing operand reordering twice, once in buildTree() and later in vectorizeTree().
To achieve this we need to keep track of the operands within the TreeEntry struct while building the tree, and later in vectorizeTree() we are just accessing them from the TreeEntry in the right order.

This patch is the first in a series of patches that will allow for better operand reordering across chains of instructions (e.g., a chain of ADDs), as presented here: https://www.youtube.com/watch?v=gIEn34LvyNo

Patch by: @vporpo (Vasileios Porpodas)

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

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

5 years ago[pdb] Add -type-stats and sort stats by descending size
Reid Kleckner [Fri, 22 Mar 2019 21:22:13 +0000 (21:22 +0000)]
[pdb] Add -type-stats and sort stats by descending size

Summary:
It prints this on chromium browser_tests.exe.pdb:

  Types
           Total: 5647475 entries ( 371,897,512 bytes,   65.85 avg)
  --------------------------------------------------------------------------
        LF_CLASS:  397894 entries ( 119,537,780 bytes,  300.43 avg)
    LF_STRUCTURE:  236351 entries (  83,208,084 bytes,  352.05 avg)
    LF_FIELDLIST:  291003 entries (  66,087,920 bytes,  227.10 avg)
    LF_MFUNCTION: 1884176 entries (  52,756,928 bytes,   28.00 avg)
      LF_POINTER: 1149030 entries (  13,877,344 bytes,   12.08 avg)
      LF_ARGLIST:  789980 entries (  12,436,752 bytes,   15.74 avg)
   LF_METHODLIST:  361498 entries (   8,351,008 bytes,   23.10 avg)
         LF_ENUM:   16069 entries (   6,108,340 bytes,  380.13 avg)
    LF_PROCEDURE:  269374 entries (   4,309,984 bytes,   16.00 avg)
     LF_MODIFIER:  235602 entries (   2,827,224 bytes,   12.00 avg)
        LF_UNION:    9131 entries (   2,072,168 bytes,  226.94 avg)
      LF_VFTABLE:     323 entries (     207,784 bytes,  643.29 avg)
        LF_ARRAY:    6639 entries (     106,380 bytes,   16.02 avg)
      LF_VTSHAPE:     126 entries (       6,472 bytes,   51.37 avg)
     LF_BITFIELD:     278 entries (       3,336 bytes,   12.00 avg)
        LF_LABEL:       1 entries (           8 bytes,    8.00 avg)

The PDB is overall 1.9GB, so the LF_CLASS and LF_STRUCTURE declarations
account for about 10% of the overall file size. I was surprised to find
that on average LF_FIELDLIST records are short. Maybe this is because
there are many more types with short member lists than there are
instantiations with lots of members, like std::vector.

Reviewers: aganea, zturner

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years agoRevert "[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU...
Douglas Yung [Fri, 22 Mar 2019 21:07:57 +0000 (21:07 +0000)]
Revert "[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`"

This reverts commit 94a0cffe250c1cd6b8fea5607be502cadf617bdc (r356764).

This change was originally committed in r356764, but then partially
reverted in r356777 due to "bad changes". This caused test failures
because the test changes committed along with the original change
were not reverted, so this change reverts the rest of the changes.

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

5 years ago[TargetLowering] SimplifyDemandedBits trunc(srl(x, C1)) - early out for out of range...
Simon Pilgrim [Fri, 22 Mar 2019 20:53:49 +0000 (20:53 +0000)]
[TargetLowering] SimplifyDemandedBits trunc(srl(x, C1)) - early out for out of range C1. NFCI.

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

5 years ago[ARM] Don't form "ands" when it isn't scheduled correctly.
Eli Friedman [Fri, 22 Mar 2019 20:49:15 +0000 (20:49 +0000)]
[ARM] Don't form "ands" when it isn't scheduled correctly.

In r322972/r323136, the iteration here was changed to catch cases at the
beginning of a basic block... but we accidentally deleted an important
safety check.  Restore that check to the way it was.

Fixes https://bugs.llvm.org/show_bug.cgi?id=41116

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

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

5 years ago[X86] Use xmm registers to implement 64-bit popcnt on 32-bit targets if possible...
Craig Topper [Fri, 22 Mar 2019 20:47:02 +0000 (20:47 +0000)]
[X86] Use xmm registers to implement 64-bit popcnt on 32-bit targets if possible if popcnt instruction is not available

On 32-bit targets without popcnt, we currently expand 64-bit popcnt to sequences of arithmetic and logic ops for each 32-bit half and then add the 32 bit halves together. If we have xmm registers we can use use those to implement the operation instead. This results in less instructions then doing two separate 32-bit popcnt sequences.

This mitigates some of PR41151 for the i64 on i686 case when we have SSE2.

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

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

5 years ago[X86] Use movq for i64 atomic load on 32-bit targets when sse2 is enable
Craig Topper [Fri, 22 Mar 2019 20:46:56 +0000 (20:46 +0000)]
[X86] Use movq for i64 atomic load on 32-bit targets when sse2 is enable

We used a lock cmpxchg8b to do i64 atomic loads. But if we have SSE2 we can do better and use a plain movq to do the load instead.

I tried to just use an f64 atomic load and add isel patterns to MOVSD(which the domain fixing pass can turn to MOVQ), but the atomic_load SDNode in TargetSelectionDAG.td requires the type to be integer.

So I've emitted VZEXT_LOAD instead which should be selected by isel to a MOVQ. Hopefully we don't need a specific atomic flavor of this. I kept the memory operand from the original AtomicSDNode. I wasn't sure if I might need to set the MOVolatile flag?

I've left some FIXMEs for improvements we can do without SSE2.

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

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

5 years agoFix non-determinism in Reassociate caused by address coincidences
Daniel Sanders [Fri, 22 Mar 2019 20:16:35 +0000 (20:16 +0000)]
Fix non-determinism in Reassociate caused by address coincidences

Summary:
Between building the pair map and querying it there are a few places that
erase and create Values. It's rare but the address of these newly created
Values is occasionally the same as a just-erased Value that we already
have in the pair map. These coincidences should be accounted for to avoid
non-determinism.

Thanks to Roman Tereshin for the test case.

Reviewers: rtereshin, bogner

Reviewed By: rtereshin

Subscribers: mgrang, llvm-commits

Tags: #llvm

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

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

5 years ago[KnownBits] Add const to some methods. NFC
Bjorn Pettersson [Fri, 22 Mar 2019 19:36:51 +0000 (19:36 +0000)]
[KnownBits] Add const to some methods. NFC

Add "const" to the trunc, zext, sext and zextOrTrunc
methods to make it clear that they aren't updating
the object itself.

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

5 years ago[AArch64, ARM] Add support for Exynos M5
Evandro Menezes [Fri, 22 Mar 2019 18:42:14 +0000 (18:42 +0000)]
[AArch64, ARM] Add support for Exynos M5

Add Exynos M5 support and test cases.

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

5 years ago[ARM] [NFC] Use tGPR in patterns where appropriate.
Eli Friedman [Fri, 22 Mar 2019 18:37:26 +0000 (18:37 +0000)]
[ARM] [NFC] Use tGPR in patterns where appropriate.

This doesn't have any practical effect at the moment, as far as I know,
because high registers aren't allocatable in Thumb1 mode. But it might
matter in the future.

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

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

5 years ago[SLP] fix variables names in test; NFC
Sanjay Patel [Fri, 22 Mar 2019 18:33:11 +0000 (18:33 +0000)]
[SLP] fix variables names in test; NFC

'tmpXXX' conflicts with the auto-generated script regex names.
That could cause mask a bug or fail if the output changes.

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

5 years agoIR: Support parsing numeric block ids, and emit them in textual output.
James Y Knight [Fri, 22 Mar 2019 18:27:13 +0000 (18:27 +0000)]
IR: Support parsing numeric block ids, and emit them in textual output.

Just as as llvm IR supports explicitly specifying numeric value ids
for instructions, and emits them by default in textual output, now do
the same for blocks.

This is a slightly incompatible change in the textual IR format.

Previously, llvm would parse numeric labels as string names. E.g.
  define void @f() {
    br label %"55"
  55:
    ret void
  }
defined a label *named* "55", even without needing to be quoted, while
the reference required quoting. Now, if you intend a block label which
looks like a value number to be a name, you must quote it in the
definition too (e.g. `"55":`).

Previously, llvm would print nameless blocks only as a comment, and
would omit it if there was no predecessor. This could cause confusion
for readers of the IR, just as unnamed instructions did prior to the
addition of "%5 = " syntax, back in 2008 (PR2480).

Now, it will always print a label for an unnamed block, with the
exception of the entry block. (IMO it may be better to print it for
the entry-block as well. However, that requires updating many more
tests.)

Thus, the following is supported, and is the canonical printing:
  define i32 @f(i32, i32) {
    %3 = add i32 %0, %1
    br label %4

  4:
    ret i32 %3
  }

New test cases covering this behavior are added, and other tests
updated as required.

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

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

5 years ago[X86] Regenerate powi tests to include i686 x87/sse targets
Simon Pilgrim [Fri, 22 Mar 2019 18:04:28 +0000 (18:04 +0000)]
[X86] Regenerate powi tests to include i686 x87/sse targets

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

5 years ago[X86] Add PR13897 test case (i128 mul on i686)
Simon Pilgrim [Fri, 22 Mar 2019 17:52:21 +0000 (17:52 +0000)]
[X86] Add PR13897 test case (i128 mul on i686)

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

5 years ago[ValueTracking] Avoid redundant known bits calculation in computeOverflowForSignedAdd()
Nikita Popov [Fri, 22 Mar 2019 17:51:40 +0000 (17:51 +0000)]
[ValueTracking] Avoid redundant known bits calculation in computeOverflowForSignedAdd()

We're already computing the known bits of the operands here. If the
known bits of the operands can determine the sign bit of the result,
we'll already catch this in signedAddMayOverflow(). The only other
way (and as the comment already indicates) we'll get new information
from computing known bits on the whole add, is if there's an assumption
on it.

As such, we change the code to only compute known bits from assumptions,
instead of computing full known bits on the add (which would unnecessarily
recompute the known bits of the operands as well).

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

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

5 years ago[X86] lowerShuffleAsBitMask - ensure float bit masks are the correct width (PR41203)
Simon Pilgrim [Fri, 22 Mar 2019 17:23:55 +0000 (17:23 +0000)]
[X86] lowerShuffleAsBitMask - ensure float bit masks are the correct width (PR41203)

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

5 years ago[AliasAnalysis] Second prototype to cache BasicAA / anyAA state.
Alina Sbirlea [Fri, 22 Mar 2019 17:22:19 +0000 (17:22 +0000)]
[AliasAnalysis] Second prototype to cache BasicAA / anyAA state.

Summary:
Adding contained caching to AliasAnalysis. BasicAA is currently the only one using it.

AA changes:
- This patch is pulling the caches from BasicAAResults to AAResults, meaning the getModRefInfo call benefits from the IsCapturedCache as well when in "batch mode".
- All AAResultBase implementations add the QueryInfo member to all APIs. AAResults APIs maintain wrapper APIs such that all alias()/getModRefInfo call sites are unchanged.
- AA now provides a BatchAAResults type as a wrapper to AAResults. It keeps the AAResults instance and a QueryInfo instantiated to batch mode. It delegates all work to the AAResults instance with the batched QueryInfo. More API wrappers may be needed in BatchAAResults; only the minimum needed is currently added.

MemorySSA changes:
- All walkers are now templated on the AA used (AliasAnalysis=AAResults or BatchAAResults).
- At build time, we optimize uses; now we create a local walker (lives only as long as OptimizeUses does) using BatchAAResults.
- All Walkers have an internal AA and only use that now, never the AA in MemorySSA. The Walkers receive the AA they will use when built.

- The walker we use for queries after the build is instantiated on AliasAnalysis and is built after building MemorySSA and setting AA.
- All static methods doing walking are now templated on AliasAnalysisType if they are used both during build and after. If used only during build, the method now only takes a BatchAAResults. If used only after build, the method now takes an AliasAnalysis.

Subscribers: sanjoy, arsenm, jvesely, nhaehnle, jlebar, george.burgess.iv, llvm-commits

Tags: #llvm

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

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

5 years ago[Tests] Add masked.gather tests for non-constant masks + speculation possibilities
Philip Reames [Fri, 22 Mar 2019 16:39:04 +0000 (16:39 +0000)]
[Tests] Add masked.gather tests for non-constant masks + speculation possibilities

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

5 years ago[ConstantFolding] Fix GetConstantFoldFPValue to avoid cast overflow.
Bixia Zheng [Fri, 22 Mar 2019 16:37:37 +0000 (16:37 +0000)]
[ConstantFolding] Fix GetConstantFoldFPValue to avoid cast overflow.

Summary:
In C++, the behavior of casting a double value that is beyond the range
of a single precision floating-point to a float value is undefined. This
change replaces such a cast with APFloat::convert to convert the value,
which is consistent with how we convert a double value to a half value.

Reviewers: sanjoy

Subscribers: lebedev.ri, sanjoy, jlebar, llvm-commits

Tags: #llvm

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

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

5 years agoMake clang-move use same file naming convention as other tools
Nico Weber [Fri, 22 Mar 2019 16:34:39 +0000 (16:34 +0000)]
Make clang-move use same file naming convention as other tools

In all the other clang-foo tools, the main library file is called
Foo.cpp and the file in the tool/ folder is called ClangFoo.cpp.
Do this for clang-move too.

No intended behavior change.

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

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

5 years ago[tests] Add a generic masked.gather test to show sometimes we can't transform
Philip Reames [Fri, 22 Mar 2019 16:30:56 +0000 (16:30 +0000)]
[tests] Add a generic masked.gather test to show sometimes we can't transform

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

5 years ago[tests] Add tests for converting masked.load to load speculatively
Philip Reames [Fri, 22 Mar 2019 16:26:57 +0000 (16:26 +0000)]
[tests] Add tests for converting masked.load to load speculatively

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

5 years ago[llvm-readobj] Revert bad changes
Xing GUO [Fri, 22 Mar 2019 16:20:54 +0000 (16:20 +0000)]
[llvm-readobj] Revert bad changes

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

5 years ago[Tests] Use valid alignment in masked.gather tests
Philip Reames [Fri, 22 Mar 2019 16:20:24 +0000 (16:20 +0000)]
[Tests] Use valid alignment in masked.gather tests

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

5 years agogn build: Merge r356750
Nico Weber [Fri, 22 Mar 2019 16:00:16 +0000 (16:00 +0000)]
gn build: Merge r356750

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

5 years agogn build: Merge r356570
Nico Weber [Fri, 22 Mar 2019 15:58:33 +0000 (15:58 +0000)]
gn build: Merge r356570

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

5 years agogn build: Merge r356662
Nico Weber [Fri, 22 Mar 2019 15:56:33 +0000 (15:56 +0000)]
gn build: Merge r356662

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

5 years agogn build: Merge r356692
Nico Weber [Fri, 22 Mar 2019 15:54:29 +0000 (15:54 +0000)]
gn build: Merge r356692

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

5 years agoInstCombineSimplifyDemanded: Allow v3 results for AMDGCN buffer and image intrinsics
Tim Renouf [Fri, 22 Mar 2019 15:53:50 +0000 (15:53 +0000)]
InstCombineSimplifyDemanded: Allow v3 results for AMDGCN buffer and image intrinsics

This helps to avoid the situation where RA spots that only 3 of the
v4f32 result of a load are used, and immediately reallocates the 4th
register for something else, requiring a stall waiting for the load.

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

Change-Id: I947661edfd5715f62361a02b100f14aeeada29aa

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

5 years agogn build: Merge r356753
Nico Weber [Fri, 22 Mar 2019 15:50:24 +0000 (15:50 +0000)]
gn build: Merge r356753

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

5 years agogn build: Merge r356652 (and follow-up r56655)
Nico Weber [Fri, 22 Mar 2019 15:48:11 +0000 (15:48 +0000)]
gn build: Merge r356652 (and follow-up r56655)

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

5 years agogn build: Merge r356729
Nico Weber [Fri, 22 Mar 2019 15:43:06 +0000 (15:43 +0000)]
gn build: Merge r356729

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

5 years ago[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`
Xing GUO [Fri, 22 Mar 2019 15:42:13 +0000 (15:42 +0000)]
[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`

Summary:
Currently, llvm-readobj can dump symbol version sections only in LLVM style. In this patch, I would like to separate these dumpers into GNU style and
LLVM style for future implementation.

Reviewers: grimar, jhenderson, mattd, rupprecht

Reviewed By: rupprecht

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[x86] auto-generate complete test checks; NFC
Sanjay Patel [Fri, 22 Mar 2019 15:33:59 +0000 (15:33 +0000)]
[x86] auto-generate complete test checks; NFC

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

5 years ago[x86] auto-generate complete test checks; NFC
Sanjay Patel [Fri, 22 Mar 2019 15:33:55 +0000 (15:33 +0000)]
[x86] auto-generate complete test checks; NFC

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

5 years ago[x86] add 'nounwind' to tests to reduce noise; NFC
Sanjay Patel [Fri, 22 Mar 2019 15:33:51 +0000 (15:33 +0000)]
[x86] add 'nounwind' to tests to reduce noise; NFC

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

5 years ago[x86] auto-generate complete checks for test; NFC
Sanjay Patel [Fri, 22 Mar 2019 15:33:47 +0000 (15:33 +0000)]
[x86] auto-generate complete checks for test; NFC

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

5 years ago[AMDGPU] Use three- and five-dword result type in image ops
Tim Renouf [Fri, 22 Mar 2019 15:21:11 +0000 (15:21 +0000)]
[AMDGPU] Use three- and five-dword result type in image ops

Some image ops return three or five dwords.  Previously, we modeled that
with a 4 or 8 dword register class.  The register allocator could
cleverly spot that some subregs were dead and allocate something else
there, but that caused the de-optimization that waitcnt insertion would
think that the result was used immediately.

This commit allows such an image op to have a result with a three or
five dword result, avoiding the above de-optimization.

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

Change-Id: I3651211bbd7ed22721ee7b9fefd7bcc60a809d8b

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

5 years ago[AMDGPU] Implemented dwordx3 variants of buffer/tbuffer load/store intrinsics
Tim Renouf [Fri, 22 Mar 2019 14:58:02 +0000 (14:58 +0000)]
[AMDGPU] Implemented dwordx3 variants of buffer/tbuffer load/store intrinsics

Now we have vec3 MVTs, this commit implements dwordx3 variants of the
buffer intrinsics.

On gfx6, a dwordx3 buffer load intrinsic is implemented as a dwordx4
instruction, and a dwordx3 buffer store intrinsic is not supported.
We need to support the dwordx3 load intrinsic because it is generated by
subtarget-unaware code in InstCombine.

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

Change-Id: I016729d8557b98a52f529638ae97c340a5922a4e

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

5 years ago[SLPVectorizer] Add test related to SLP Throttling support, NFCI.
Dinar Temirbulatov [Fri, 22 Mar 2019 14:50:53 +0000 (14:50 +0000)]
[SLPVectorizer] Add test related to SLP Throttling support, NFCI.

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

5 years ago[ObjectYAML] Add basic minidump generation support
Pavel Labath [Fri, 22 Mar 2019 14:47:26 +0000 (14:47 +0000)]
[ObjectYAML] Add basic minidump generation support

Summary:
This patch adds the ability to read a yaml form of a minidump file and
write it out as binary. Apart from the minidump header and the stream
directory, only three basic stream kinds are supported:
- Text: This kind is used for streams which contain textual data. This
  is typically the contents of a /proc file on linux (e.g.
  /proc/PID/maps). In this case, we just put the raw stream contents
  into the yaml.
- SystemInfo: This stream contains various bits of information about the
  host system in binary form. We expose the data in a structured form.
- Raw: This kind is used as a fallback when we don't have any special
  knowledge about the stream. In this case, we just print the stream
  contents in hex.

For this code to be really useful, more stream kinds will need to be
added (particularly for things like lists of memory regions and loaded
modules). However, these can be added incrementally.

Reviewers: jhenderson, zturner, clayborg, aprantl

Subscribers: mgorny, lemo, llvm-commits, lldb-commits

Tags: #llvm

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

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

5 years ago[llvm-exegesis] Fix compilation before c++17.
Clement Courbet [Fri, 22 Mar 2019 13:37:39 +0000 (13:37 +0000)]
[llvm-exegesis] Fix compilation before c++17.

ClusteringTest.cpp:25:23: error: constexpr variable cannot have non-literal type 'const llvm::exegesis::(anonymous namespace)::(lambda at /home/buildslave/ps4-buildslave4/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/unittests/tools/llvm-exegesis/ClusteringTest.cpp:25:35)'
static constexpr auto HasPoints = [](const std::vector<int> &Indices) {

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

5 years ago[llvm-exegesis] Add clustering test.
Clement Courbet [Fri, 22 Mar 2019 13:13:12 +0000 (13:13 +0000)]
[llvm-exegesis] Add clustering test.

Summary: To show that dbscan is insensitive to the order of the points.

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

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

5 years ago[llvm-objcopy]Add coverage for --split-dwo and --output-format
James Henderson [Fri, 22 Mar 2019 12:45:27 +0000 (12:45 +0000)]
[llvm-objcopy]Add coverage for --split-dwo and --output-format

Also fix up a couple of minor issues in the test being updated, where
FileCheck could match on incorrect output and fix the test case order to
match the struct order.

Reviewed by: grimar

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

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

5 years agoRevert r356738 "[llvm-objcopy] - Implement replaceSectionReferences for GroupSection...
George Rimar [Fri, 22 Mar 2019 12:14:04 +0000 (12:14 +0000)]
Revert r356738 "[llvm-objcopy] - Implement replaceSectionReferences for GroupSection class."

Seems this broke ubsan bot:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/11760

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

5 years ago[RISCV] Add basic RV32E definitions and MC layer support
Alex Bradbury [Fri, 22 Mar 2019 11:21:40 +0000 (11:21 +0000)]
[RISCV] Add basic RV32E definitions and MC layer support

The RISC-V ISA defines RV32E as an alternative "base" instruction set
encoding, that differs from RV32I by having only 16 rather than 32 registers.
This patch adds basic definitions for RV32E as well as MC layer support
(assembling, disassembling) and tests. The only supported ABI on RV32E is
ILP32E.

Add a new RISCVFeatures::validate() helper to RISCVUtils which can be called
from codegen or MC layer libraries to validate the combination of TargetTriple
and FeatureBitSet. Other targets have similar checks (e.g. erroring if SPE is
enabled on PPC64 or oddspreg + o32 ABI on Mips), but they either duplicate the
checks (Mips), or fail to check for both codegen and MC codepaths (PPC).

Codegen for the ILP32E ABI support and RV32E codegen are left for a future
patch/patches.

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

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

5 years ago[RISCV] Optimize emission of SELECT sequences
Alex Bradbury [Fri, 22 Mar 2019 10:45:03 +0000 (10:45 +0000)]
[RISCV] Optimize emission of SELECT sequences

This patch optimizes the emission of a sequence of SELECTs with the same
condition, avoiding the insertion of unnecessary control flow. Such a sequence
often occurs when a SELECT of values wider than XLEN is legalized into two
SELECTs with legal types. We have identified several use cases where the
SELECTs could be interleaved with other instructions. Therefore, we extend the
sequence to include non-SELECT instructions if we are able to detect that the
non-SELECT instructions do not impact the optimization.

This patch supersedes https://reviews.llvm.org/D59096, which attempted to
address this issue by introducing a new SelectionDAG node. Hat tip to Eli
Friedman for his feedback on how to best handle this issue.

Differential Revision: https://reviews.llvm.org/D59355
Patch by Luís Marques.

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

5 years ago[RISCV] Allow conversion of CC logic to bitwise logic
Alex Bradbury [Fri, 22 Mar 2019 10:39:22 +0000 (10:39 +0000)]
[RISCV] Allow conversion of CC logic to bitwise logic

Indicates in the TargetLowering interface that conversions from CC logic to
bitwise logic are allowed. Adds tests that show the benefit when optimization
opportunities are detected. Also adds tests that show that when the optimization
is not applied correct code is generated (but opportunities for other
optimizations remain).

Differential Revision: https://reviews.llvm.org/D59596
Patch by Luís Marques.

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

5 years ago[llvm-objcopy] - Fix a st_name of the first symbol table entry.
George Rimar [Fri, 22 Mar 2019 10:28:56 +0000 (10:28 +0000)]
[llvm-objcopy] - Fix a st_name of the first symbol table entry.

Spec says about the first symbol table entry that index 0 both designates the first entry in the table
and serves as the undefined symbol index. It should have zero value.
Hence the first symbol table entry has no name. And so has to have a st_name == 0.
(http://refspecs.linuxbase.org/elf/gabi4+/ch4.symtab.html)

Currently, we do not emit zero value for the first symbol table entry.
That happens because we add empty strings to the string builder, which
for each such case adds a zero byte:
(https://github.com/llvm-mirror/llvm/blob/master/lib/MC/StringTableBuilder.cpp#L185)
After the string optimization performed it might return non zero indexes for the
empty string requested.

The patch fixes this issue for the case above and other sections with no names.

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

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

5 years ago[llvm-objcopy] - Implement replaceSectionReferences for GroupSection class.
George Rimar [Fri, 22 Mar 2019 10:24:37 +0000 (10:24 +0000)]
[llvm-objcopy] - Implement replaceSectionReferences for GroupSection class.

Currently, llvm-objcopy incorrectly handles compression and decompression of the
sections from COMDAT groups, because we do not implement the
replaceSectionReferences for this type of the sections.

The patch does that.

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

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

5 years ago[llvm-objcopy]Add support for *-freebsd output formats
James Henderson [Fri, 22 Mar 2019 10:21:09 +0000 (10:21 +0000)]
[llvm-objcopy]Add support for *-freebsd output formats

GNU objcopy can support output formats like elf32-i386-freebsd and
elf64-x86-64-freebsd. The only difference from their regular non-freebsd
counterparts that I have observed is that the freebsd versions set the
OS/ABI field to ELFOSABI_FREEBSD. This patch sets the OS/ABI field
according based on the format whenever --output-format is specified.

Reviewed by: rupprecht, grimar

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

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

5 years ago[RISCV][NFC] Add test case to MC/RISCV/linker-relaxation.s showing incorrect relocati...
Alex Bradbury [Fri, 22 Mar 2019 10:20:21 +0000 (10:20 +0000)]
[RISCV][NFC] Add test case to MC/RISCV/linker-relaxation.s showing incorrect relocations being emitted

A follow-up patch will fix this case.

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

5 years ago[AMDGPU] Added v5i32 and v5f32 register classes
Tim Renouf [Fri, 22 Mar 2019 10:11:21 +0000 (10:11 +0000)]
[AMDGPU] Added v5i32 and v5f32 register classes

They are not used by anything yet, but a subsequent commit will start
using them for image ops that return 5 dwords.

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

Change-Id: I63e1904081e39a6d66e4eb96d51df25ad399d271

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

5 years ago[RISCV][NFC] Expand test/MC/RISCV/linker-relaxation.s tests
Alex Bradbury [Fri, 22 Mar 2019 06:05:52 +0000 (06:05 +0000)]
[RISCV][NFC] Expand test/MC/RISCV/linker-relaxation.s tests

Add more complete CHECK lines for the relocations generated when relaxation is
enabled, and add cases where a locally defined symbol is referenced.

Two instances of pcrel_lo(defined_symbol) are commented out, as they will
produce an error. A follow-up patch will fix this.

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

5 years ago[X86] Add 32-bit command lines with and without SSE2 to atomic-non-integer.ll. NFC
Craig Topper [Fri, 22 Mar 2019 04:28:40 +0000 (04:28 +0000)]
[X86] Add 32-bit command lines with and without SSE2 to atomic-non-integer.ll. NFC

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

5 years ago[BPF] fix flaky btf unit test static-var-derived-type.ll
Yonghong Song [Fri, 22 Mar 2019 02:54:47 +0000 (02:54 +0000)]
[BPF] fix flaky btf unit test static-var-derived-type.ll

The DataSecEentries is defined as an unordered_map since
order does not really matter.
  std::unordered_map<std::string, std::unique_ptr<BTFKindDataSec>>
      DataSecEntries;
This seems causing the test static-var-derived-type.ll flaky
as two sections ".bss" and ".readonly" have undeterministic
ordering when performing map iterating, which decides the
output assembly code sequence of BTF_KIND_DATASEC entries.

Fix the test to have only one data section to remove
flakiness.

Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356731 91177308-0d34-0410-b5e6-96231b3b80d8