platform/upstream/llvm.git
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.

llvm-svn: 356872

5 years ago[clang-tidy] Fix more false positives for bugprone-string-integer-assignment
Clement Courbet [Mon, 25 Mar 2019 08:18:00 +0000 (08:18 +0000)]
[clang-tidy] Fix more false positives for bugprone-string-integer-assignment

Summary:
And add various tests gleaned for our codebase.

See PR27723.

Reviewers: JonasToth, alexfh, xazax.hun

Subscribers: rnkovacs, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 356871

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.

llvm-svn: 356870

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.

llvm-svn: 356869

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.

llvm-svn: 356868

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

llvm-svn: 356867

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.

llvm-svn: 356866

5 years agoUn-revert "[coroutines][PR40978] Emit error for co_yield within catch block"
Brian Gesiak [Mon, 25 Mar 2019 00:53:10 +0000 (00:53 +0000)]
Un-revert "[coroutines][PR40978] Emit error for co_yield within catch block"

Summary:
https://reviews.llvm.org/D59076 added a new coroutine error that
prevented users from using 'co_await' or 'co_yield' within a exception
handler. However, it was reverted in https://reviews.llvm.org/rC356774
because it caused a regression in nested scopes in C++ catch statements,
as documented by https://bugs.llvm.org/show_bug.cgi?id=41171.

The issue was due to an incorrect use of a `clang::ParseScope`. To fix:

1. Add a regression test for catch statement parsing that mimics the bug
   report from https://bugs.llvm.org/show_bug.cgi?id=41171.
2. Re-apply the coroutines error patch from
   https://reviews.llvm.org/D59076, but this time with the correct
   ParseScope behavior.

Reviewers: GorNishanov, tks2103, rsmith, riccibruno, jbulow

Reviewed By: riccibruno

Subscribers: EricWF, jdoerfert, lewissbaker, cfe-commits

Tags: #clang

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

llvm-svn: 356865

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.

llvm-svn: 356864

5 years ago[X86] Make _bswap intrinsic a function instead of a macro to hopefully fix the chromi...
Craig Topper [Sun, 24 Mar 2019 18:00:20 +0000 (18:00 +0000)]
[X86] Make _bswap intrinsic a function instead of a macro to hopefully fix the chromium build.

This intrinsic was added in r356848 but was implemented as a macro to match gcc.

llvm-svn: 356862

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.

llvm-svn: 356861

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.

llvm-svn: 356860

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)

llvm-svn: 356859

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.

llvm-svn: 356858

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.

llvm-svn: 356857

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

llvm-svn: 356856

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

llvm-svn: 356855

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.

llvm-svn: 356854

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

llvm-svn: 356853

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

llvm-svn: 356852

5 years ago[pp-trace] Delete redundant clang::
Fangrui Song [Sun, 24 Mar 2019 07:31:21 +0000 (07:31 +0000)]
[pp-trace] Delete redundant clang::

And clarify command line options

llvm-svn: 356851

5 years ago[pp-trace] Wrap code in clang::pp_trace
Fangrui Song [Sun, 24 Mar 2019 07:21:32 +0000 (07:21 +0000)]
[pp-trace] Wrap code in clang::pp_trace

llvm-svn: 356850

5 years ago[pp-trace] Modernize the code
Fangrui Song [Sun, 24 Mar 2019 06:55:08 +0000 (06:55 +0000)]
[pp-trace] Modernize the code

Use InitLLVM and WithColor
Delete PPTraceConsumer, add the callback in PPTraceAction
Migrae to tooling::createExecutorFromCommandLineArgs
Don't specialize empty OutputFileName

llvm-svn: 356849

5 years ago[X86] Add BSR/BSF/BSWAP intrinsics to ia32intrin.h to match gcc.
Craig Topper [Sun, 24 Mar 2019 00:56:52 +0000 (00:56 +0000)]
[X86] Add BSR/BSF/BSWAP intrinsics to ia32intrin.h to match gcc.

Summary:
These are all implemented by icc as well.

I made bit_scan_forward/reverse forward to the __bsfd/__bsrq since we also have
__bsfq/__bsrq.

Note, when lzcnt is enabled the bsr intrinsics generates lzcnt+xor instead of bsr.

Reviewers: RKSimon, spatel

Subscribers: cfe-commits, llvm-commits

Tags: #clang

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

llvm-svn: 356848

5 years ago[WebAssembly] Fix test/Driver/wasm-toolchain.c in the presence of CLANG_DEFAULT_LINKER
Sam Clegg [Sun, 24 Mar 2019 00:03:41 +0000 (00:03 +0000)]
[WebAssembly] Fix test/Driver/wasm-toolchain.c in the presence of CLANG_DEFAULT_LINKER

This was broken in rL356817 (See https://reviews.llvm.org/D59721)

llvm-svn: 356847

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

llvm-svn: 356846

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

llvm-svn: 356845

5 years agoFix typos in compiler-rt/lib/builtins/atomic.c
Hubert Tong [Sat, 23 Mar 2019 18:39:54 +0000 (18:39 +0000)]
Fix typos in compiler-rt/lib/builtins/atomic.c

Summary:
This patch fixes typos in file compiler-rt/lib/builtins/atomic.c.

Reviewers: jasonliu, hubert.reinterpretcast, jfb

Reviewed By: jfb

Subscribers: t.p.northover, theraven, dberris, jfb, jdoerfert, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

Patch by Xing Xue.

llvm-svn: 356844

5 years agolibclang/CIndexer.cpp: Use loadquery() on AIX for path to library
Hubert Tong [Sat, 23 Mar 2019 18:10:45 +0000 (18:10 +0000)]
libclang/CIndexer.cpp: Use loadquery() on AIX for path to library

Summary:
`dladdr` is not available on AIX. Similar functionality is presented
through `loadquery`. This patch replaces a use of `dladdr` with a
version based on `loadquery`.

Reviewers: sfertile, xingxue, jasonliu

Reviewed By: xingxue

Subscribers: jsji, lhames, majnemer, asb, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 356843

5 years agoSync some doc changes ClangFormatStyleOptions.rst with doc comments in `Format.h`
Sylvestre Ledru [Sat, 23 Mar 2019 17:57:31 +0000 (17:57 +0000)]
Sync some doc changes ClangFormatStyleOptions.rst with doc comments in `Format.h`

Summary:
These changes were corrected directly in ClangFormatStyleOptions.rst (llvm-svn: 350192 and llvm-svn: 351976) but these sections can be produced automatically using `dump_format_style.py` so sync the corresponding doc comments in `Format.h` as well.

Patch by Ronald Wampler

Reviewers: eugene, sylvestre.ledru, djasper

Reviewed By: sylvestre.ledru

Subscribers: jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 356842

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.

llvm-svn: 356841

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.

llvm-svn: 356840

5 years agoFix unused variable warning. NFCI.
Simon Pilgrim [Sat, 23 Mar 2019 16:16:46 +0000 (16:16 +0000)]
Fix unused variable warning. NFCI.

llvm-svn: 356839

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

llvm-svn: 356838

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.

llvm-svn: 356837

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

llvm-svn: 356836

5 years ago[clang-format] Keep protobuf "package" statement on one line
Paul Hoad [Sat, 23 Mar 2019 14:43:41 +0000 (14:43 +0000)]
[clang-format] Keep protobuf "package" statement on one line

Summary:
Top-level "package" and "import" statements should generally be kept on one
line, for all languages.

Reviewers: sammccall, krasimir, MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: MyDeveloperDay, cfe-commits

Tags: #clang

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

Patch By: dchai (Donald Chai)

llvm-svn: 356835

5 years agoClang-format: add finer-grained options for putting all arguments on one line
Paul Hoad [Sat, 23 Mar 2019 14:37:58 +0000 (14:37 +0000)]
Clang-format: add finer-grained options for putting all arguments on one line

Summary:
Add two new options,
AllowAllArgumentsOnNextLine and
AllowAllConstructorInitializersOnNextLine.  These mirror the existing
AllowAllParametersOfDeclarationOnNextLine and allow me to support an
internal style guide where I work.  I think this would be generally
useful, some have asked for it on stackoverflow:

https://stackoverflow.com/questions/30057534/clang-format-binpackarguments-not-working-as-expected

https://stackoverflow.com/questions/38635106/clang-format-how-to-prevent-all-function-arguments-on-next-line

Reviewers: djasper, krasimir, MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: jkorous, MyDeveloperDay, aol-nnov, lebedev.ri, uohcsemaj, cfe-commits, klimek

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

Patch By: russellmcc  (Russell McClellan)

llvm-svn: 356834

5 years ago[clang-format] correctly format protobuf fields named "enum".
Paul Hoad [Sat, 23 Mar 2019 14:24:30 +0000 (14:24 +0000)]
[clang-format] correctly format protobuf fields named "enum".

Summary: Similar to TypeScript, "enum" is not a reserved word.

Reviewers: krasimir, MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: MyDeveloperDay, cfe-commits

Tags: #clang, #clang-tools-extra

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

Patch by: dchai (Donald Chai)

llvm-svn: 356833

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.

llvm-svn: 356832

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.

llvm-svn: 356831

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.

llvm-svn: 356830

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

llvm-svn: 356829

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

llvm-svn: 356828

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

llvm-svn: 356827

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.

llvm-svn: 356826

5 years ago[Reproducers] Fix GDB remote flakiness during replay
Jonas Devlieghere [Fri, 22 Mar 2019 23:33:17 +0000 (23:33 +0000)]
[Reproducers] Fix GDB remote flakiness during replay

This fixes the flakiness of the GDB remote reproducer during replay. It
was caused by a combination sending one ACK to many from the replay
server and the code that "flushes" any queued GDB remote packets in
GDBRemoteCommunicationClient::HandshakeWithServer.

The spurious ACK was the result of combining both implicit and explicit
handling of ACKs in the replay server. The handshake consists of an ACK
followed by an QStartNoAckMode. As long as we haven't seen any
QStartNoAckMode, we were sending implicit acknowledgments. So the first
ACK got acknowledged twice, once implicitly, and once as part of the
replay.

The reason we didn't notice this was the code in HandshakeWithServer
that "waits for any responses that might have been queued up in the
remote GDB server and flush them all". A 10ms timeout is used to move on
when no packets are left. If the second ACK didn't make it within those
10ms, all packets were offset by one.

llvm-svn: 356825

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

llvm-svn: 356824

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.

llvm-svn: 356823

5 years agoIRGen: Remove StructorType; thread GlobalDecl through more code. NFCI.
Peter Collingbourne [Fri, 22 Mar 2019 23:05:10 +0000 (23:05 +0000)]
IRGen: Remove StructorType; thread GlobalDecl through more code. NFCI.

This should make it easier to add more structor variants.

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

llvm-svn: 356822

5 years ago[clang-format][NFC] correct the release notes
Paul Hoad [Fri, 22 Mar 2019 22:47:34 +0000 (22:47 +0000)]
[clang-format][NFC] correct the release notes

Move the clang-format notes to the correct section

llvm-svn: 356821

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.

llvm-svn: 356820

5 years ago[ScriptInterpreter] Remove a warning and reformat comments.
Davide Italiano [Fri, 22 Mar 2019 22:38:49 +0000 (22:38 +0000)]
[ScriptInterpreter] Remove a warning and reformat comments.

llvm-svn: 356819

5 years agoFix a minor bug with std::next and prev not and negative numbers. In particular,...
Marshall Clow [Fri, 22 Mar 2019 22:32:20 +0000 (22:32 +0000)]
Fix a minor bug with std::next and prev not and negative numbers. In particular, std::prev cannot require Bidirectional Iterators, because you might 'go back' -1 places, which goes forward. Thanks to Ville and Jonathan for the bug report.

llvm-svn: 356818

5 years ago[WebAssembly] Make driver -pthread imply linker --shared-memory
Thomas Lively [Fri, 22 Mar 2019 22:25:37 +0000 (22:25 +0000)]
[WebAssembly] Make driver -pthread imply linker --shared-memory

Summary:
This eliminates a linker error the user might otherwise see about how
using the 'atomics' feature requires --shared-memory.

Reviewers: sbc100, aheejin

Subscribers: dschuff, jgravelle-google, sunfish, jfb, cfe-commits

Tags: #clang

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

llvm-svn: 356817

5 years ago[ScriptInterpreter] Make sure that PYTHONHOME is right.
Davide Italiano [Fri, 22 Mar 2019 22:19:57 +0000 (22:19 +0000)]
[ScriptInterpreter] Make sure that PYTHONHOME is right.

Summary:
For the only version of Python actually supported on Darwin.

<rdar://problem/40961425>

Reviewers: jingham, friss, JDevlieghere, aprantl, jasonmolenda

Subscribers: jdoerfert, llvm-commits, lldb-commits

Tags: #llvm

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

llvm-svn: 356816

5 years ago[LLD][COFF] Separate module descriptors creation from type/symbol merging
Alexandre Ganea [Fri, 22 Mar 2019 22:07:27 +0000 (22:07 +0000)]
[LLD][COFF] Separate module descriptors creation from type/symbol merging

Take module DBI creation out of PDBLinker::addObjFile() into its own function.

This is groundwork towards parallelizable type merging, as proposed in D59226.

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

llvm-svn: 356815

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

llvm-svn: 356814

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

llvm-svn: 356813

5 years agoSimplify PltSection.
Rui Ueyama [Fri, 22 Mar 2019 21:17:25 +0000 (21:17 +0000)]
Simplify PltSection.

Previously, `Entries` contains pairs of symbols and their indices.
The indices are always 0, x, 2x, 3x, ..., where x is the size of
relocation entry. We didn't have to store that values because we can
compute them when we consume them.

llvm-svn: 356812

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.

llvm-svn: 356811

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.

llvm-svn: 356810

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

llvm-svn: 356809

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

llvm-svn: 356808

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

llvm-svn: 356807

5 years agoRevert minidump changes
Jonas Devlieghere [Fri, 22 Mar 2019 20:46:46 +0000 (20:46 +0000)]
Revert minidump changes

This reverts the following two commits:

Revert "Extend r356573 (minidump UUID handling) to cover elf build-ids too"
Revert "Fix UUID decoding from minidump files"

Greg's original commit broke the sanitizer bot which has been red for
several days now.

http://green.lab.llvm.org/green/view/LLDB/job/lldb-sanitized/

llvm-svn: 356806

5 years ago[WebAssembly] Add linker options to control feature checking
Thomas Lively [Fri, 22 Mar 2019 20:43:06 +0000 (20:43 +0000)]
[WebAssembly] Add linker options to control feature checking

Summary:
Adds --check-features and --no-check-features. The default for now is
to enable the checking, but this might change in the future.

Also adds --features=foo,bar for precisely controlling the features
used in the output binary.

Depends on D59173.

Reviewers: sbc100, aheejin

Subscribers: dschuff, jgravelle-google, sunfish, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 356805

5 years ago[libc++] Update the list of symbols exported from libc++abi for new/delete
Louis Dionne [Fri, 22 Mar 2019 20:18:17 +0000 (20:18 +0000)]
[libc++] Update the list of symbols exported from libc++abi for new/delete

When libc++ does not provide new/delete, libc++abi now also provides the
aligned allocation and deallocation functions, so those should be part of
the re-export list for libc++.

llvm-svn: 356804

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

llvm-svn: 356803

5 years ago[clang-tidy] openmp-exception-escape - a new check
Roman Lebedev [Fri, 22 Mar 2019 19:46:25 +0000 (19:46 +0000)]
[clang-tidy] openmp-exception-escape - a new check

Summary:
Finally, we are here!

Analyzes OpenMP Structured Blocks and checks that no exception escapes
out of the Structured Block it was thrown in.

As per the OpenMP specification, structured block is an executable statement,
possibly compound, with a single entry at the top and a single exit at the
bottom. Which means, ``throw`` may not be used to to 'exit' out of the
structured block. If an exception is not caught in the same structured block
it was thrown in, the behaviour is undefined / implementation defined,
the program will likely terminate.

Reviewers: JonasToth, aaron.ballman, baloghadamsoftware, gribozavr

Reviewed By: aaron.ballman, gribozavr

Subscribers: mgorny, xazax.hun, rnkovacs, guansong, jdoerfert, cfe-commits, ABataev

Tags: #clang-tools-extra, #openmp, #clang

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

llvm-svn: 356802

5 years ago[clang-tidy] openmp-use-default-none - a new check
Roman Lebedev [Fri, 22 Mar 2019 19:46:12 +0000 (19:46 +0000)]
[clang-tidy] openmp-use-default-none - a new check

Summary:
Finds OpenMP directives that are allowed to contain `default` clause,
but either don't specify it, or the clause is specified but with the kind
other than `none`, and suggests to use `default(none)` clause.

Using `default(none)` clause changes the default variable visibility from
being implicitly determined, and thus forces developer to be explicit about the
desired data scoping for each variable.

Reviewers: JonasToth, aaron.ballman, xazax.hun, hokein, gribozavr

Reviewed By: JonasToth, aaron.ballman

Subscribers: jdoerfert, openmp-commits, klimek, sbenza, arphaman, Eugene.Zelenko, ABataev, mgorny, rnkovacs, guansong, cfe-commits

Tags: #clang-tools-extra, #openmp, #clang

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

llvm-svn: 356801

5 years ago[clang-tidy] A new OpenMP module
Roman Lebedev [Fri, 22 Mar 2019 19:46:01 +0000 (19:46 +0000)]
[clang-tidy] A new OpenMP module

Summary:
Just the empty skeleton.
Previously reviewed as part of D57113.

Reviewers: JonasToth, aaron.ballman, alexfh, xazax.hun, hokein, gribozavr

Reviewed By: JonasToth, gribozavr

Subscribers: jdoerfert, mgorny, rnkovacs, guansong, arphaman, cfe-commits

Tags: #clang-tools-extra, #openmp, #clang

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

llvm-svn: 356800

5 years ago[NFC] ExceptionEscapeCheck: small refactoring
Roman Lebedev [Fri, 22 Mar 2019 19:45:51 +0000 (19:45 +0000)]
[NFC] ExceptionEscapeCheck: small refactoring

Summary:
D59466 wants to analyse the `Stmt`, and `ExceptionEscapeCheck` does not
have that as a possible entry point.
This simplifies addition of `Stmt` analysis entry point.

Reviewers: baloghadamsoftware, JonasToth, gribozavr

Reviewed By: gribozavr

Subscribers: rnkovacs, cfe-commits

Tags: #clang-tools-extra, #clang

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

llvm-svn: 356799

5 years ago[libc++] Re-export the sjlj ABI v2 for ARM architectures
Louis Dionne [Fri, 22 Mar 2019 19:38:53 +0000 (19:38 +0000)]
[libc++] Re-export the sjlj ABI v2 for ARM architectures

We were previously not exporting the right ABI version of libc++abi.

llvm-svn: 356798

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.

llvm-svn: 356797

5 years ago[clang-tidy] Move all checks to the new registerPPCallbacks API
Alexander Kornienko [Fri, 22 Mar 2019 18:58:12 +0000 (18:58 +0000)]
[clang-tidy] Move all checks to the new registerPPCallbacks API

llvm-svn: 356796

5 years agoFix clang-move test.
Alexander Kornienko [Fri, 22 Mar 2019 18:52:10 +0000 (18:52 +0000)]
Fix clang-move test.

llvm-svn: 356795

5 years ago[clang] Add support for Exynos M5 (NFC)
Evandro Menezes [Fri, 22 Mar 2019 18:44:09 +0000 (18:44 +0000)]
[clang] Add support for Exynos M5 (NFC)

Add Exynos M5 test cases.

llvm-svn: 356794

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.

llvm-svn: 356793

5 years ago[clang-tidy] anyOf(hasName(..), hasName(..)) -> hasAnyName
Alexander Kornienko [Fri, 22 Mar 2019 18:37:45 +0000 (18:37 +0000)]
[clang-tidy] anyOf(hasName(..), hasName(..)) -> hasAnyName

+ a minor style fix

llvm-svn: 356792

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

llvm-svn: 356791

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.

llvm-svn: 356790

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

llvm-svn: 356789

5 years ago[clangd] Call the new ClangTidyCheck::registerPPCallbacks overload
Alexander Kornienko [Fri, 22 Mar 2019 18:16:51 +0000 (18:16 +0000)]
[clangd] Call the new ClangTidyCheck::registerPPCallbacks overload

llvm-svn: 356788

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

llvm-svn: 356787

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)

llvm-svn: 356786

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

llvm-svn: 356785

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)

llvm-svn: 356784

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

llvm-svn: 356783

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

llvm-svn: 356782

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

llvm-svn: 356781

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

llvm-svn: 356780

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

llvm-svn: 356779

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

llvm-svn: 356778

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

llvm-svn: 356777

5 years ago[ARM] Fix bug 39982 - pcs("aapcs-vfp") is not consistent
Carey Williams [Fri, 22 Mar 2019 16:20:45 +0000 (16:20 +0000)]
[ARM] Fix bug 39982 - pcs("aapcs-vfp") is not consistent

Correctly handle homogeneous aggregates when a
function's ABI is specified via the pcs attribute.

Bug: https://bugs.llvm.org/show_bug.cgi?id=39982
Differential Revision: https://reviews.llvm.org/D59094

llvm-svn: 356776

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

llvm-svn: 356775

5 years agoRevert "[coroutines][PR40978] Emit error for co_yield within catch block"
Brian Gesiak [Fri, 22 Mar 2019 16:08:29 +0000 (16:08 +0000)]
Revert "[coroutines][PR40978] Emit error for co_yield within catch block"

The commit https://reviews.llvm.org/rC356296 is causing a regression in nested
catch scopes, https://bugs.llvm.org/show_bug.cgi?id=41171. Revert this change
for now in order to un-break that problem report.

llvm-svn: 356774

5 years agoRevert "Move the rest of the sections over to DWARFContext."
Pavel Labath [Fri, 22 Mar 2019 16:07:58 +0000 (16:07 +0000)]
Revert "Move the rest of the sections over to DWARFContext."

This reverts commit r356682 because it breaks the DWO flavours of some
tests:
    lldb-Suite :: lang/c/const_variables/TestConstVariables.py
    lldb-Suite :: lang/c/local_variables/TestLocalVariables.py
    lldb-Suite :: lang/c/vla/TestVLA.py

llvm-svn: 356773

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

llvm-svn: 356772