platform/upstream/llvm.git
6 years agoCleanup Reduction helpers by using ArrayRef(NoneType) constructor. NFCI.
Simon Pilgrim [Fri, 6 Apr 2018 17:25:06 +0000 (17:25 +0000)]
Cleanup Reduction helpers by using ArrayRef(NoneType) constructor. NFCI.

Pointed out by @abataev on D45366.

llvm-svn: 329431

6 years ago[AMDGPU][MC][GFX9] Added instruction s_endpgm_ordered_ps_done
Dmitry Preobrazhensky [Fri, 6 Apr 2018 17:25:00 +0000 (17:25 +0000)]
[AMDGPU][MC][GFX9] Added instruction s_endpgm_ordered_ps_done

See bug 36844: https://bugs.llvm.org/show_bug.cgi?id=36844

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

Reviewers: artem.tamazov, arsenm, timcorringham
llvm-svn: 329430

6 years ago[InstCombine] limit nsz: -(X - Y) --> Y - X to hasOneUse()
Sanjay Patel [Fri, 6 Apr 2018 17:24:08 +0000 (17:24 +0000)]
[InstCombine] limit nsz: -(X - Y) --> Y - X to hasOneUse()

As noted in the post-commit discussion for r329350, we shouldn't
generally assume that fsub is the same cost as fneg.

llvm-svn: 329429

6 years ago[clang-tidy] Sort includes; NFC
George Burgess IV [Fri, 6 Apr 2018 17:22:36 +0000 (17:22 +0000)]
[clang-tidy] Sort includes; NFC

llvm-svn: 329428

6 years agoAdd additional tests from D45336
Simon Pilgrim [Fri, 6 Apr 2018 17:18:44 +0000 (17:18 +0000)]
Add additional tests from D45336

llvm-svn: 329427

6 years ago[lldb-server] Set a more generous timeout when testing gdbremote.
Davide Italiano [Fri, 6 Apr 2018 17:17:20 +0000 (17:17 +0000)]
[lldb-server] Set a more generous timeout when testing gdbremote.

One of our downstream bot is struggling under load,  but this
value should be enough for everyone.

llvm-svn: 329426

6 years agoAdd additional tests from D45366
Simon Pilgrim [Fri, 6 Apr 2018 17:15:56 +0000 (17:15 +0000)]
Add additional tests from D45366

llvm-svn: 329425

6 years ago[X686] Add appropriate ReadAfterLd for the register input to memory forms of ADC...
Craig Topper [Fri, 6 Apr 2018 17:12:18 +0000 (17:12 +0000)]
[X686] Add appropriate ReadAfterLd for the register input to memory forms of ADC/SBB.

llvm-svn: 329424

6 years agoRevert "Cleanup DWARFCompileUnit and DWARFUnit in preparation for adding DWARFTypeUnit"
Jan Kratochvil [Fri, 6 Apr 2018 17:11:13 +0000 (17:11 +0000)]
Revert "Cleanup DWARFCompileUnit and DWARFUnit in preparation for adding DWARFTypeUnit"

The reverted commit changed DWARFUnit from https://reviews.llvm.org/D40466 and
https://reviews.llvm.org/D42892 that was prepared for DWARFPartialUnit and
made from it a superclass for DWARFTypeUnit.  DWARFUnit's intention was:
DWARFUnit->DWARFSomeNameUnit->DWARFCompileUnit
DWARFUnit->DWARFSomeNameUnit->DWARFTypeUnit
DWARFUnit->DWARFPartialUnit

Discussed at: https://reviews.llvm.org/D45170

This reverts commit r329305.

llvm-svn: 329423

6 years ago[compiler-rt][dfsan][mips] UnXPASS a consistently passing test
Simon Dardis [Fri, 6 Apr 2018 17:03:36 +0000 (17:03 +0000)]
[compiler-rt][dfsan][mips] UnXPASS a consistently passing test

llvm-svn: 329422

6 years agoStrip trailing whitespace. NFCI.
Simon Pilgrim [Fri, 6 Apr 2018 17:01:54 +0000 (17:01 +0000)]
Strip trailing whitespace. NFCI.

llvm-svn: 329421

6 years ago[HIP] define __CUDA_ARCH_=1 for amdgcn targets
Yaxun Liu [Fri, 6 Apr 2018 16:43:42 +0000 (16:43 +0000)]
[HIP] define __CUDA_ARCH_=1 for amdgcn targets

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

llvm-svn: 329420

6 years ago[AMDGPU][MC][GFX9] Added instructions *saveexec*, *wrexec* and *bitreplicate*
Dmitry Preobrazhensky [Fri, 6 Apr 2018 16:35:11 +0000 (16:35 +0000)]
[AMDGPU][MC][GFX9] Added instructions *saveexec*, *wrexec* and *bitreplicate*

See bug 36840: https://bugs.llvm.org/show_bug.cgi?id=36840

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

Reviewers: artem.tamazov, arsenm, timcorringham
llvm-svn: 329419

6 years ago[InstCombine] add test for fsub+fneg with extra use; NFC
Sanjay Patel [Fri, 6 Apr 2018 16:30:52 +0000 (16:30 +0000)]
[InstCombine] add test for fsub+fneg with extra use; NFC

llvm-svn: 329418

6 years ago[X86] Remove InstRWs for basic arithmetic instructions from Sandy Bridge scheduler...
Craig Topper [Fri, 6 Apr 2018 16:29:31 +0000 (16:29 +0000)]
[X86] Remove InstRWs for basic arithmetic instructions from Sandy Bridge scheduler model.

We can get this right through WriteALU and friends now.

llvm-svn: 329417

6 years ago[X86] Attempt to model basic arithmetic instructions in the Haswell/Broadwell/Skylake...
Craig Topper [Fri, 6 Apr 2018 16:16:48 +0000 (16:16 +0000)]
[X86] Attempt to model basic arithmetic instructions in the Haswell/Broadwell/Skylake scheduler models without InstRWs

Summary:
This patch removes InstRW overrides for basic arithmetic/logic instructions. To do this I've added the store address port to RMW. And used a WriteSequence to make the latency additive. It does not cover ADC/SBB because they have different latency.

Apparently we were inconsistent about whether the store has latency or not thus the test changes.

I've also left out Sandy Bridge because the load latency there is currently 4 cycles and should be 5.

Reviewers: RKSimon, andreadb

Reviewed By: andreadb

Subscribers: llvm-commits

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

llvm-svn: 329416

6 years ago[X86] Add an extra store address cycle to WriteRMW in the Sandy Bridge/Broadwell...
Craig Topper [Fri, 6 Apr 2018 16:16:46 +0000 (16:16 +0000)]
[X86] Add an extra store address cycle to WriteRMW in the Sandy Bridge/Broadwell/Haswell/Skylake scheduler model.

Even those the address was calculated for the load, its calculated again for the store.

llvm-svn: 329415

6 years ago[X86] Merge itineraries for CLC, CMC, and STC.
Craig Topper [Fri, 6 Apr 2018 16:16:43 +0000 (16:16 +0000)]
[X86] Merge itineraries for CLC, CMC, and STC.

These are very simple flag setting instructions that appear to only be a single uop. They're unlikely to need this separation.

llvm-svn: 329414

6 years ago[CostModel][X86] Regenerate bit count cost tests with update_analyze_test_checks.py
Simon Pilgrim [Fri, 6 Apr 2018 16:14:27 +0000 (16:14 +0000)]
[CostModel][X86] Regenerate bit count cost tests with update_analyze_test_checks.py

llvm-svn: 329413

6 years ago[InstCombine] add potential calloc tests and regenerate checks; NFC
Sanjay Patel [Fri, 6 Apr 2018 16:06:08 +0000 (16:06 +0000)]
[InstCombine] add potential calloc tests and regenerate checks; NFC

D45344 is proposing to remove the use restriction that made the calloc
transform safe, but it doesn't currently address the problematic example
given inD16337. Add a test to make sure that doesn't break.

llvm-svn: 329412

6 years ago[OPENMP, NVPTX] Fix codegen for the teams reduction.
Alexey Bataev [Fri, 6 Apr 2018 16:03:36 +0000 (16:03 +0000)]
[OPENMP, NVPTX] Fix codegen for the teams reduction.

Added NUW flags for all the add|mul|sub operations + replaced sdiv by udiv
as we operate on unsigned values only (addresses, converted to integers)

llvm-svn: 329411

6 years ago[CostModel][X86] Regenerate vector shuffle cost tests with update_analyze_test_checks.py
Simon Pilgrim [Fri, 6 Apr 2018 16:00:28 +0000 (16:00 +0000)]
[CostModel][X86] Regenerate vector shuffle cost tests with update_analyze_test_checks.py

llvm-svn: 329410

6 years ago[GlobalOpt] Fix support for casts in ctors.
Mircea Trofin [Fri, 6 Apr 2018 15:54:47 +0000 (15:54 +0000)]
[GlobalOpt] Fix support for casts in ctors.

Summary:
Fixing an issue where initializations of globals where constructors use
casts were silently translated to 0-initialization.

Reviewers: davidxl, evgeny777

Reviewed By: evgeny777

Subscribers: llvm-commits

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

llvm-svn: 329409

6 years ago[AMDGPU][MC][VI][GFX9] Added s_atc_probe* instructions
Dmitry Preobrazhensky [Fri, 6 Apr 2018 15:48:39 +0000 (15:48 +0000)]
[AMDGPU][MC][VI][GFX9] Added s_atc_probe* instructions

See bug 36839: https://bugs.llvm.org/show_bug.cgi?id=36839

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

Reviewers: artem.tamazov, arsenm, timcorringham
llvm-svn: 329408

6 years ago[CostModel][X86] Regenerate bswap/bitreverse cost tests with update_analyze_test_chec...
Simon Pilgrim [Fri, 6 Apr 2018 15:46:26 +0000 (15:46 +0000)]
[CostModel][X86] Regenerate bswap/bitreverse cost tests with update_analyze_test_checks.py

llvm-svn: 329407

6 years ago[ARC] Add <.f> suffix for F32_GEN4_{DOP|SOP}.
Pete Couperus [Fri, 6 Apr 2018 15:43:11 +0000 (15:43 +0000)]
[ARC] Add <.f> suffix for F32_GEN4_{DOP|SOP}.

Add disassembler support for instructions which writeback STATUS32.
https://reviews.llvm.org/D45148

Patch by Yan Luo! (Yan.Luo2@synopsys.com)

llvm-svn: 329404

6 years ago[llvm-mca] Do not separate iterations with a newline in the timeline view.
Andrea Di Biagio [Fri, 6 Apr 2018 15:30:02 +0000 (15:30 +0000)]
[llvm-mca] Do not separate iterations with a newline in the timeline view.

Also, update a few tests to minimize the diff in D45369.
No functional change intended.

llvm-svn: 329403

6 years ago[CostModel][X86] Regenerate integer extension/truncation cost tests with update_analy...
Simon Pilgrim [Fri, 6 Apr 2018 15:28:26 +0000 (15:28 +0000)]
[CostModel][X86] Regenerate integer extension/truncation cost tests with update_analyze_test_checks.py

llvm-svn: 329402

6 years ago[CostModel][X86] Regenerate integer division/remainder tests with update_analyze_test...
Simon Pilgrim [Fri, 6 Apr 2018 15:23:26 +0000 (15:23 +0000)]
[CostModel][X86] Regenerate integer division/remainder tests with update_analyze_test_checks.py

llvm-svn: 329401

6 years ago[CostModel][X86] Regenerate vector shift cost tests with update_analyze_test_checks.py
Simon Pilgrim [Fri, 6 Apr 2018 15:14:34 +0000 (15:14 +0000)]
[CostModel][X86] Regenerate vector shift cost tests with update_analyze_test_checks.py

llvm-svn: 329400

6 years agoFix typos in clang
Alexander Kornienko [Fri, 6 Apr 2018 15:14:32 +0000 (15:14 +0000)]
Fix typos in clang

Found via codespell -q 3 -I ../clang-whitelist.txt
Where whitelist consists of:

  archtype
  cas
  classs
  checkk
  compres
  definit
  frome
  iff
  inteval
  ith
  lod
  methode
  nd
  optin
  ot
  pres
  statics
  te
  thru

Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few
files that have dubious fixes reverted.)

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

llvm-svn: 329399

6 years ago[CostModel][X86] Regenerate int<->fp cost tests with update_analyze_test_checks.py
Simon Pilgrim [Fri, 6 Apr 2018 15:12:36 +0000 (15:12 +0000)]
[CostModel][X86] Regenerate int<->fp cost tests with update_analyze_test_checks.py

llvm-svn: 329398

6 years ago[AMDGPU][MC][GFX9] Added s_dcache_discard* instructions
Dmitry Preobrazhensky [Fri, 6 Apr 2018 15:08:42 +0000 (15:08 +0000)]
[AMDGPU][MC][GFX9] Added s_dcache_discard* instructions

See bug 36838: https://bugs.llvm.org/show_bug.cgi?id=36838

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

Reviewers: artem.tamazov, arsenm, timcorringham
llvm-svn: 329397

6 years ago[LoopUnroll] Make LoopPeeling respect the AllowPeeling preference.
Chad Rosier [Fri, 6 Apr 2018 13:57:21 +0000 (13:57 +0000)]
[LoopUnroll] Make LoopPeeling respect the AllowPeeling preference.

The SimpleLoopUnrollPass isn't suppose to perform loop peeling.

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

llvm-svn: 329395

6 years ago[Hexagon] Remove default values from lambda parameters
Krzysztof Parzyszek [Fri, 6 Apr 2018 13:51:48 +0000 (13:51 +0000)]
[Hexagon] Remove default values from lambda parameters

llvm-svn: 329394

6 years agoFollowup for r329293: Temporarily disable the breaking test on windows.
Philip Pfaffe [Fri, 6 Apr 2018 13:39:16 +0000 (13:39 +0000)]
Followup for r329293: Temporarily disable the breaking test on windows.

This test is failing on windows bots. Disable it temporarily to unbreak
the windows bots.

llvm-svn: 329393

6 years agoDWARFVerifier: validate information in name index entries
Pavel Labath [Fri, 6 Apr 2018 13:34:12 +0000 (13:34 +0000)]
DWARFVerifier: validate information in name index entries

Summary:
This patch add checks to verify that the information in the name index
entries is consistent with the debug_info section. Specifically, we
check that entries point to valid DIEs, and their names, tags, and
compile units match the information in the debug_info sections.

These checks are only run if the previous checks did not find any errors
in the name index headers. Attempting to proceed with the checks anyway
would likely produce a lot of spurious errors and the verification code
would need to be very careful to avoid crashing.

I also add a couple of more checks to the abbreviation-validation code
to verify that some attributes are always present (an index without a
DW_IDX_die_offset attribute is fairly useless).

The entry verification works only on indexes without any type units - I
haven't attempted to extend it to type units, as we don't even have a
DWARF v5-compatible type unit generator at the moment.

Reviewers: JDevlieghere, aprantl, dblaikie

Subscribers: llvm-commits

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

llvm-svn: 329392

6 years agoAllow the creation of human-friendly ASTDumper to arbitrary output stream
Alexander Kornienko [Fri, 6 Apr 2018 13:01:12 +0000 (13:01 +0000)]
Allow the creation of human-friendly ASTDumper to arbitrary output stream

Summary:
`ASTPrinter` allows setting the ouput to any O-Stream, but that printer creates source-code-like syntax (and is also marked with a `FIXME`). The nice, colourful, mostly human-readable `ASTDumper` only works on the standard output, which is not feasible in case a user wants to see the AST of a file through a code navigation/comprehension tool.

This small addition of an overload solves generating a nice colourful AST block for the users of a tool I'm working on, [[ http://github.com/Ericsson/CodeCompass | CodeCompass ]], as opposed to having to duplicate the behaviour of definitions that only exist in the anonymous namespace of implementation TUs related to this module.

Reviewers: alexfh, klimek, rsmith

Reviewed By: alexfh

Subscribers: rnkovacs, dkrupp, gsd, xazax.hun, cfe-commits, #clang

Tags: #clang

Patch by Whisperity!

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

llvm-svn: 329391

6 years ago[UpdateTestChecks] Add update_analyze_test_checks.py for cost model analysis generation
Simon Pilgrim [Fri, 6 Apr 2018 12:36:27 +0000 (12:36 +0000)]
[UpdateTestChecks] Add update_analyze_test_checks.py for cost model analysis generation

The script allows the auto-generation of checks for cost model tests to speed up their creation and help improve coverage, which will help a lot with PR36550.

If the need arises we can add support for other analyze passes as well, but the cost models was the one I needed to get done - at the moment it just warns that any other analysis mode is unsupported.

I've regenerated a couple of x86 test files to show the effect.

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

llvm-svn: 329390

6 years ago[X86][SandyBridge] Add (V)DPPS memory fold latencies
Simon Pilgrim [Fri, 6 Apr 2018 11:25:21 +0000 (11:25 +0000)]
[X86][SandyBridge] Add (V)DPPS memory fold latencies

Noticed this during D44654

llvm-svn: 329389

6 years ago[X86][SandyBridge] SBWriteResPair +5cy Memory Folds
Simon Pilgrim [Fri, 6 Apr 2018 11:00:51 +0000 (11:00 +0000)]
[X86][SandyBridge] SBWriteResPair +5cy Memory Folds

As mentioned on D44647, this patch increases the default memory latency to +5cy , which more closely matches what most custom cases are doing for reg-mem instructions.

I've bumped LoadLatency, ReadAfterLd and WriteLoad values to 5cy to be consistent.

As Sandy Bridge is currently our default generic model, this affects a lot of scheduling tests...

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

llvm-svn: 329388

6 years agoTweak an assert message in the verifier
Hans Wennborg [Fri, 6 Apr 2018 10:20:19 +0000 (10:20 +0000)]
Tweak an assert message in the verifier

llvm-svn: 329387

6 years ago[X86][SkylakeServer] Merge 2 InstRW entries to the same sched group. NFCI.
Simon Pilgrim [Fri, 6 Apr 2018 10:16:36 +0000 (10:16 +0000)]
[X86][SkylakeServer] Merge 2 InstRW entries to the same sched group. NFCI.

llvm-svn: 329386

6 years agoEntryExitInstrumenter: Handle musttail calls
Hans Wennborg [Fri, 6 Apr 2018 10:14:09 +0000 (10:14 +0000)]
EntryExitInstrumenter: Handle musttail calls

Inserting instrumentation between a musttail call and ret instruction
would create invalid IR. Instead, treat musttail calls as function
exits.

llvm-svn: 329385

6 years ago[ELF] Don't write to the source directory in test.
Benjamin Kramer [Fri, 6 Apr 2018 10:05:47 +0000 (10:05 +0000)]
[ELF] Don't write to the source directory in test.

llvm-svn: 329384

6 years ago[NFC] Add missing end of line symbols
Max Kazantsev [Fri, 6 Apr 2018 09:47:06 +0000 (09:47 +0000)]
[NFC] Add missing end of line symbols

llvm-svn: 329383

6 years ago[MIR] Add support for MachineFrameInfo::LocalFrameSize
Francis Visoiu Mistrih [Fri, 6 Apr 2018 08:56:25 +0000 (08:56 +0000)]
[MIR] Add support for MachineFrameInfo::LocalFrameSize

MFI.LocalFrameSize was not serialized.

It is usually set from LocalStackSlotAllocation, so if that pass doesn't
run it is impossible do deduce it from the stack objects. Until now, this
information was lost.

llvm-svn: 329382

6 years ago[debug_loc] Fix typo in DWARFExpression constructor
Pavel Labath [Fri, 6 Apr 2018 08:49:57 +0000 (08:49 +0000)]
[debug_loc] Fix typo in DWARFExpression constructor

Summary:
The positions of the DwarfVersion and AddressSize arguments were
reversed, which caused parsing for dwarf opcodes which contained
address-size-dependent operands (such as DW_OP_addr). Amusingly enough,
none of the address-size asserts fired, as dwarf version was always 4,
which is a valid address size.

I ran into this when constructing weird inputs for the DWARF verifier. I
I add a test case as hand-written dwarf -- I am not sure how to trigger
this differently, as having a DW_OP_addr inside a location list is a
fairly non-standard thing to do.

Fixing this error exposed a bug in the debug_loc.dwo parser, which was
always being constructed with an address size of 0. I fix that as well
by following the pattern in the non-dwo parser of picking up the address
size from the first compile unit (which is technically not correct, but
probably good enough in practice).

Reviewers: JDevlieghere, aprantl, dblaikie

Subscribers: llvm-commits

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

llvm-svn: 329381

6 years ago[clangd] move comment to the right place. NFC
Sam McCall [Fri, 6 Apr 2018 07:48:21 +0000 (07:48 +0000)]
[clangd] move comment to the right place. NFC

llvm-svn: 329380

6 years ago[NFC] Loosen restriction on preheader to fix buildbot
Max Kazantsev [Fri, 6 Apr 2018 07:23:45 +0000 (07:23 +0000)]
[NFC] Loosen restriction on preheader to fix buildbot

llvm-svn: 329379

6 years ago[XRay][clang] Only run driver test for Linux and FreeBSD
Dean Michael Berris [Fri, 6 Apr 2018 06:09:57 +0000 (06:09 +0000)]
[XRay][clang] Only run driver test for Linux and FreeBSD

This is a follow-up to D45354, which we should have only been running on
Linux and FreeBSD for specific targets.

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

llvm-svn: 329378

6 years ago[PowerPC] allow D-form VSX load/store when accessing FrameIndex without offset
Hiroshi Inoue [Fri, 6 Apr 2018 05:41:16 +0000 (05:41 +0000)]
[PowerPC] allow D-form VSX load/store when accessing FrameIndex without offset

VSX D-form load/store instructions of POWER9 require the offset be a multiple of 16 and a helper`isOffsetMultipleOf` is used to check this.
So far, the helper handles FrameIndex + offset case, but not handling FrameIndex without offset case. Due to this, we are missing opportunities to exploit D-form instructions when accessing an object or array allocated on stack.
For example, x-form store (stxvx) is used for int a[4] = {0}; instead of d-form store (stxv). For larger arrays, D-form instruction is not used when accessing the first 16-byte. Using D-form instructions reduces register pressure as well as instructions.

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

llvm-svn: 329377

6 years ago[XRay][clang] Add a flag to enable/disable linking XRay deps explicitly
Dean Michael Berris [Fri, 6 Apr 2018 05:28:54 +0000 (05:28 +0000)]
[XRay][clang] Add a flag to enable/disable linking XRay deps explicitly

Summary:
This change introduces `-fxray-link-deps` and `-fnoxray-link-deps`. The
`-fnoxray-link-deps` allows for directly controlling which specific XRay
runtime to link. The default is for clang to link the XRay runtime that
is shipped with the compiler (if there are any), but users may want to
explicitly add the XRay dependencies from other locations or other
means.

Reviewers: eizan, echristo, chandlerc

Reviewed By: eizan

Subscribers: cfe-commits

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

llvm-svn: 329376

6 years agoMark <span> as "In progress"
Marshall Clow [Fri, 6 Apr 2018 04:43:27 +0000 (04:43 +0000)]
Mark <span> as "In progress"

llvm-svn: 329375

6 years ago[debugserver] Fix LC_BUILD_VERSION load command handling.
Frederic Riss [Fri, 6 Apr 2018 04:28:12 +0000 (04:28 +0000)]
[debugserver] Fix LC_BUILD_VERSION load command handling.

Summary:
In one of the 2 places the LC_BUILD_VERSION load command is handled, there
is a bug preventing us from actually handling them (the address where to
read the load command was not updated). This patch factors reading the
deployment target load commands into a helper and adds testing for the 2
code paths calling the helper.

The testing is a little bit complicated because the only times those load
commands matter is when debugging a simulator process. I added a new
decorator to check that a specific SDK is available. The actual testing was
fairly easy once I knew how to run a simulated process.

Reviewers: jasonmolenda, labath

Subscribers: lldb-commits

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

llvm-svn: 329374

6 years ago[LLVM-C] Fill Out LLVMCallConv
Robert Widmann [Fri, 6 Apr 2018 04:02:39 +0000 (04:02 +0000)]
[LLVM-C] Fill Out LLVMCallConv

Summary: Bring LLVMCallConv up to date with latest [[ http://llvm.org/doxygen/CallingConv_8h_source.html | CallConv ]]

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: llvm-commits

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

llvm-svn: 329373

6 years ago[XRay][clang] Consolidate runtime and link-time flag processing (NFC)
Dean Michael Berris [Fri, 6 Apr 2018 03:53:04 +0000 (03:53 +0000)]
[XRay][clang] Consolidate runtime and link-time flag processing (NFC)

Summary:
This change fixes http://llvm.org/PR36985 to define a single place in
CommonArgs.{h,cpp} where XRay runtime flags and link-time dependencies
are processed for all toolchains that support XRay instrumentation. This
is a refactoring of the same functionality spread across multiple
toolchain definitions.

Reviewers: echristo, devnexen, eizan

Reviewed By: eizan

Subscribers: emaste, cfe-commits

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

llvm-svn: 329372

6 years agoChange which file we print when a symbol cannot be ordered.
Rafael Espindola [Fri, 6 Apr 2018 03:36:19 +0000 (03:36 +0000)]
Change which file we print when a symbol cannot be ordered.

Currently there are a few odd things about the warning about symbols
that cannot be ordered. This patch fixes:

* When there is an undefined symbol that resolves to a shared file, we
  were printing the location of the undefined reference.

* If there are multiple comdats, we were reporting them all.

llvm-svn: 329371

6 years agoCOFF: Create output sections early. NFCI.
Peter Collingbourne [Fri, 6 Apr 2018 03:25:49 +0000 (03:25 +0000)]
COFF: Create output sections early. NFCI.

With this, all output sections are created in one place. This will make
it simpler to implement merging of builtin sections.

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

llvm-svn: 329370

6 years ago[LLVM-C] Audit Inline Assembly APIs for Consistency
Robert Widmann [Fri, 6 Apr 2018 02:31:29 +0000 (02:31 +0000)]
[LLVM-C] Audit Inline Assembly APIs for Consistency

Summary:
- Add a missing getter for module-level inline assembly
- Add a missing append function for module-level inline assembly
- Deprecate LLVMSetModuleInlineAsm and replace it with LLVMSetModuleInlineAsm2 which takes an explicit length parameter
- Deprecate LLVMConstInlineAsm and replace it with LLVMGetInlineAsm, a function that allows passing a dialect and is not mis-classified as a constant operation

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: llvm-commits

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

llvm-svn: 329369

6 years agoUpdate method names in documentation.
Rafael Espindola [Fri, 6 Apr 2018 01:21:48 +0000 (01:21 +0000)]
Update method names in documentation.

They were renamed in r328848.

llvm-svn: 329368

6 years agoDon't ignore addend when a SHF_MERGE section is dead.
Rafael Espindola [Fri, 6 Apr 2018 01:10:33 +0000 (01:10 +0000)]
Don't ignore addend when a SHF_MERGE section is dead.

This is similar to r329219, but for the entire section. Like r329219 I
don't expect this to have any real impact, it is just more consistent
and simpler.

llvm-svn: 329367

6 years agoCMake option to allow enabling experimental new pass manager by default
Petr Hosek [Fri, 6 Apr 2018 00:53:00 +0000 (00:53 +0000)]
CMake option to allow enabling experimental new pass manager by default

This CMake flag allows setting the default value for the
-f[no]-experimental-new-pass-manager flag.

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

llvm-svn: 329366

6 years agoFix lld-x86_64-darwin13 build fails.
Manoj Gupta [Thu, 5 Apr 2018 23:23:29 +0000 (23:23 +0000)]
Fix lld-x86_64-darwin13 build fails.

Use double braces in std::array initialization
to keep Darwin builders happy.

llvm-svn: 329363

6 years ago[InstCombine] FP: Z - (X - Y) --> Z + (Y - X)
Sanjay Patel [Thu, 5 Apr 2018 23:21:15 +0000 (23:21 +0000)]
[InstCombine] FP: Z - (X - Y) --> Z + (Y - X)

This restores what was lost with rL73243 but without
re-introducing the bug that was present in the old code.

Note that we already have these transforms if the ops are
marked 'fast' (and I assume that's happening somewhere in
the code added with rL170471), but we clearly don't need
all of 'fast' for these transforms.

llvm-svn: 329362

6 years agoFix test added in r329301 to work properly with Windows paths.
Douglas Yung [Thu, 5 Apr 2018 22:58:14 +0000 (22:58 +0000)]
Fix test added in r329301 to work properly with Windows paths.

llvm-svn: 329361

6 years ago[InstCombine] add FP tests for Z - (X - Y); NFC
Sanjay Patel [Thu, 5 Apr 2018 22:56:54 +0000 (22:56 +0000)]
[InstCombine] add FP tests for Z - (X - Y); NFC

A fold for this pattern was removed at rL73243 to fix PR4374:
https://bugs.llvm.org/show_bug.cgi?id=4374
...and apparently there were no tests that went with that fold.

llvm-svn: 329360

6 years agoAttempt to fix Mips breakages.
Manoj Gupta [Thu, 5 Apr 2018 22:47:25 +0000 (22:47 +0000)]
Attempt to fix Mips breakages.

Summary:
Replace ArrayRefs by actual std::array objects so that there are
no dangling references.

Reviewers: rsmith, gkistanova

Subscribers: sdardis, arichardson, llvm-commits

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

llvm-svn: 329359

6 years ago[dotest] --skip-category should append and not override.
Davide Italiano [Thu, 5 Apr 2018 22:46:39 +0000 (22:46 +0000)]
[dotest] --skip-category should append and not override.

<rdar://problem/38566150>

llvm-svn: 329358

6 years ago[Sema] Revert r329346 because of memory sanitizer failures.
Eugene Zelenko [Thu, 5 Apr 2018 22:15:42 +0000 (22:15 +0000)]
[Sema] Revert r329346 because of memory sanitizer failures.

llvm-svn: 329357

6 years agoX86 Tests: Add a case for combining sdiv by a splatted pow2 negative. NFC.
Zvi Rackover [Thu, 5 Apr 2018 21:57:20 +0000 (21:57 +0000)]
X86 Tests: Add a case for combining sdiv by a splatted pow2 negative. NFC.

Noticed test was missing while working on D42479.

llvm-svn: 329356

6 years ago[RuntimeDyld][PowerPC] Add a test case for r329335.
Lang Hames [Thu, 5 Apr 2018 21:56:55 +0000 (21:56 +0000)]
[RuntimeDyld][PowerPC] Add a test case for r329335.

Checks that calls to different sections go to the function's global entry point,
rather than the local one.

llvm-svn: 329355

6 years ago[X86] Separate CDQ and CDQE in the scheduler model.
Craig Topper [Thu, 5 Apr 2018 21:56:19 +0000 (21:56 +0000)]
[X86] Separate CDQ and CDQE in the scheduler model.

According to Agner's data, CDQE is closer to CWDE.

llvm-svn: 329354

6 years ago[IR] Change std::sort to llvm::sort in response to r327219
Mandeep Singh Grang [Thu, 5 Apr 2018 21:52:24 +0000 (21:52 +0000)]
[IR] Change std::sort to llvm::sort in response to r327219

r327219 added wrappers to std::sort which randomly shuffle the container before
sorting.  This will help in uncovering non-determinism caused due to undefined
sorting order of objects having the same key.

To make use of that infrastructure we need to invoke llvm::sort instead of
std::sort.

Note: This patch is one of a series of patches to replace *all* std::sort to
llvm::sort.  Refer D44363 for a list of all the required patches.

llvm-svn: 329353

6 years agoAdd a couple more tests for DR372.
Richard Smith [Thu, 5 Apr 2018 21:49:20 +0000 (21:49 +0000)]
Add a couple more tests for DR372.

llvm-svn: 329352

6 years ago[X86] Add MOVZPQILo2PQIrr to the Sandy Bridge scheduler model
Craig Topper [Thu, 5 Apr 2018 21:40:32 +0000 (21:40 +0000)]
[X86] Add MOVZPQILo2PQIrr to the Sandy Bridge scheduler model

llvm-svn: 329351

6 years ago[InstCombine] nsz: -(X - Y) --> Y - X
Sanjay Patel [Thu, 5 Apr 2018 21:37:17 +0000 (21:37 +0000)]
[InstCombine] nsz: -(X - Y) --> Y - X

This restores part of the fold that was removed with rL73243 (PR4374).

llvm-svn: 329350

6 years ago[InstCombine][NFC] Regenerate select-of-bittest.ll with instnamer pass
Roman Lebedev [Thu, 5 Apr 2018 21:34:59 +0000 (21:34 +0000)]
[InstCombine][NFC] Regenerate select-of-bittest.ll with instnamer pass

As requested by spatel in https://reviews.llvm.org/D45329

llvm-svn: 329349

6 years ago[InstCombine] [NFC] Add more tests for getting rid of select of bittest (D45108,...
Roman Lebedev [Thu, 5 Apr 2018 21:34:53 +0000 (21:34 +0000)]
[InstCombine] [NFC] Add more tests for getting rid of select of bittest (D45108, PR36950 / PR17564)

Summary:
More tests for D45108:
* One use tests
* allow shift to be a variable, too

Reviewers: spatel, craig.topper

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 329348

6 years ago[X86] Add LEAVE instruction to the scheduler models using the same data as LEAVE64...
Craig Topper [Thu, 5 Apr 2018 21:16:26 +0000 (21:16 +0000)]
[X86] Add LEAVE instruction to the scheduler models using the same data as LEAVE64. Make LEAVE/LEAVE64 more correct on Sandy Bridge.

This is the 32-bit mode version of LEAVE64. It should be at least somewhat similar to LEAVE64.

The Sandy Bridge version was missing a load port use.

llvm-svn: 329347

6 years ago[Sema] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Thu, 5 Apr 2018 21:09:03 +0000 (21:09 +0000)]
[Sema] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 329346

6 years ago[DWARF v5][NFC]: Refactor DebugRnglists to prepare for the support of the DW_AT_ranges
Wolfgang Pieb [Thu, 5 Apr 2018 21:01:49 +0000 (21:01 +0000)]
[DWARF v5][NFC]: Refactor DebugRnglists to prepare for the support of the DW_AT_ranges
 attribute in conjunction with .debug_rnglists.

Reviewers: JDevlieghere

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

llvm-svn: 329345

6 years ago[X86][SSE] Add floating point add/mul fast-math vector.reduce tests
Simon Pilgrim [Thu, 5 Apr 2018 21:01:21 +0000 (21:01 +0000)]
[X86][SSE] Add floating point add/mul fast-math vector.reduce tests

Strict versions aren't working at all (PR36732) and the accumulators aren't supported (PR36734)

llvm-svn: 329344

6 years ago[X86][SSE] Add floating point min/max vector.reduce tests
Simon Pilgrim [Thu, 5 Apr 2018 20:54:55 +0000 (20:54 +0000)]
[X86][SSE] Add floating point min/max vector.reduce tests

llvm-svn: 329343

6 years agoPR36992: do not store beyond the dsize of a class object unless we know
Richard Smith [Thu, 5 Apr 2018 20:52:58 +0000 (20:52 +0000)]
PR36992: do not store beyond the dsize of a class object unless we know
the tail padding is not reused.

We track on the AggValueSlot (and through a couple of other
initialization actions) whether we're dealing with an object that might
share its tail padding with some other object, so that we can avoid
emitting stores into the tail padding if that's the case. We still
widen stores into tail padding when we can do so.

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

llvm-svn: 329342

6 years agoAMDGPU/Metadata: Always report a fixed number of hidden arguments
Konstantin Zhuravlyov [Thu, 5 Apr 2018 20:46:04 +0000 (20:46 +0000)]
AMDGPU/Metadata: Always report a fixed number of hidden arguments

Currently it is 6. If the "feature" was not used, report dummy
hidden argument. Otherwise it does not match the kernarg size
reported in the kernel header.

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

llvm-svn: 329341

6 years ago[cmake] Remove duplicate command line options from build
Aaron Smith [Thu, 5 Apr 2018 20:27:50 +0000 (20:27 +0000)]
[cmake] Remove duplicate command line options from build

CMAKE_CXX_FLAGS and CMAKE_C_FLAGS are added twice to the command line.
This causes the command line options to be doubled which works until
it doesn't as not all options can be specified twice.

For example,

clang-cl foo.c /GS- /GS- -mllvm -small-loop-cost=1 -mllvm -small-loop-cost=1
clang (LLVM option parsing): for the -small-loop-cost option: may only occur zero or one times!

llvm-svn: 329340

6 years ago[X86] Remove some InstRWs for plain store instructions on Sandy Bridge.
Craig Topper [Thu, 5 Apr 2018 20:04:06 +0000 (20:04 +0000)]
[X86] Remove some InstRWs for plain store instructions on Sandy Bridge.

We were forcing the latency of these instructions to 5 cycles, but every other scheduler model had them as 1 cycle. I'm sure I didn't get everything, but this gets a big portion.

llvm-svn: 329339

6 years ago[llvm-cov] Prevent llvm-cov from hanging when a symblink doesn't exist.
Max Moroz [Thu, 5 Apr 2018 19:43:24 +0000 (19:43 +0000)]
[llvm-cov] Prevent llvm-cov from hanging when a symblink doesn't exist.

Summary:
Previous code hangs indefinitely when trying to iterate through a
symbol link file that points to an non-exist directory. This change
fixes the bug to make the addCollectedPath function exit ealier and
print out correct warning messages.

Patch by Yuke Liao (@liaoyuke).

Reviewers: Dor1s, vsk

Reviewed By: vsk

Subscribers: bruno, mgrang, llvm-commits

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

llvm-svn: 329338

6 years ago[WebAssembly] Remove StackPointerGlobal member variable from the driver.
Rui Ueyama [Thu, 5 Apr 2018 19:37:48 +0000 (19:37 +0000)]
[WebAssembly] Remove StackPointerGlobal member variable from the driver.

Since InputGlobal makes a copy of a given object, we can use a temporary
object allocated on the stack here.

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

llvm-svn: 329337

6 years ago[WebAssembly] Remove another trivial accessor.
Rui Ueyama [Thu, 5 Apr 2018 19:37:31 +0000 (19:37 +0000)]
[WebAssembly] Remove another trivial accessor.

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

llvm-svn: 329336

6 years ago[RuntimeDyld][PowerPC] Use global entry points for calls between sections.
Lang Hames [Thu, 5 Apr 2018 19:37:05 +0000 (19:37 +0000)]
[RuntimeDyld][PowerPC] Use global entry points for calls between sections.

Functions in different objects may use different TOCs, so calls between such
functions should use the global entry point of the callee which updates the
TOC pointer.

This should fix a bug that the Numba developers encountered (see
https://github.com/numba/numba/issues/2451).

Patch by Olexa Bilaniuk. Thanks Olexa!

No RuntimeDyld checker test case yet as I am not familiar enough with how
RuntimeDyldELF fixes up call-sites, but I do not want to hold up landing
this. I will continue to work on it and see if I can rope some powerpc
experts in.

llvm-svn: 329335

6 years ago[Bitcode] Change std::sort to llvm::sort in response to r327219
Mandeep Singh Grang [Thu, 5 Apr 2018 19:27:04 +0000 (19:27 +0000)]
[Bitcode] Change std::sort to llvm::sort in response to r327219

Summary:
r327219 added wrappers to std::sort which randomly shuffle the container before sorting.
This will help in uncovering non-determinism caused due to undefined sorting
order of objects having the same key.

To make use of that infrastructure we need to invoke llvm::sort instead of std::sort.

Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort.
Refer the comments section in D44363 for a list of all the required patches.

Reviewers: pcc, mehdi_amini, dexonsmith

Reviewed By: dexonsmith

Subscribers: llvm-commits

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

llvm-svn: 329334

6 years ago[ELF] Add CHECK to test/ELF/undef-start.s
Fangrui Song [Thu, 5 Apr 2018 19:20:33 +0000 (19:20 +0000)]
[ELF] Add CHECK to test/ELF/undef-start.s

llvm-svn: 329333

6 years agoDR1672, DR1813, DR1881, DR2120: Implement recent fixes to "standard
Richard Smith [Thu, 5 Apr 2018 18:55:37 +0000 (18:55 +0000)]
DR1672, DR1813, DR1881, DR2120: Implement recent fixes to "standard
layout" rules.

The new rules say that a standard-layout struct has its first non-static
data member and all base classes at offset 0, and consider a class to
not be standard-layout if that would result in multiple subobjects of a
single type having the same address.

We track "is C++11 standard-layout class" separately from "is
standard-layout class" so that the ABIs that need this information can
still use it.

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

llvm-svn: 329332

6 years ago[InstCombine] Properly change GEP type when reassociating loop invariant GEP chains
Daniel Neilson [Thu, 5 Apr 2018 18:51:45 +0000 (18:51 +0000)]
[InstCombine] Properly change GEP type when reassociating loop invariant GEP chains

Summary:
This is a fix to PR37005.

Essentially, rL328539 ([InstCombine] reassociate loop invariant GEP chains to enable LICM) contains a bug
whereby it will convert:
%src = getelementptr inbounds i8, i8* %base, <2 x i64> %val
%res = getelementptr inbounds i8, <2 x i8*> %src, i64 %val2
into:
%src = getelementptr inbounds i8, i8* %base, i64 %val2
%res = getelementptr inbounds i8, <2 x i8*> %src, <2 x i64> %val

By swapping the index operands if the GEPs are in a loop, and %val is loop variant while %val2
is loop invariant.

This fix recreates new GEP instructions if the index operand swap would result in the type
of %src changing from vector to scalar, or vice versa.

Reviewers: sebpop, spatel

Reviewed By: sebpop

Subscribers: llvm-commits

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

llvm-svn: 329331

6 years ago[X86] Synchronize the SchedRW on some EVEX instructions with their VEX equivalents.
Craig Topper [Thu, 5 Apr 2018 18:38:45 +0000 (18:38 +0000)]
[X86] Synchronize the SchedRW on some EVEX instructions with their VEX equivalents.

Mostly vector load, store, and move instructions.

llvm-svn: 329330

6 years ago[ARM] Change std::sort to llvm::sort in response to r327219
Mandeep Singh Grang [Thu, 5 Apr 2018 18:31:50 +0000 (18:31 +0000)]
[ARM] Change std::sort to llvm::sort in response to r327219

Summary:
r327219 added wrappers to std::sort which randomly shuffle the container before sorting.
This will help in uncovering non-determinism caused due to undefined sorting
order of objects having the same key.

To make use of that infrastructure we need to invoke llvm::sort instead of std::sort.

Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort.
Refer the comments section in D44363 for a list of all the required patches.

Reviewers: t.p.northover, RKSimon, MatzeB, bkramer

Reviewed By: bkramer

Subscribers: javed.absar, llvm-commits, kristof.beyls

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

llvm-svn: 329329

6 years agoSilence msvc warning on isl. NFC.
Michael Kruse [Thu, 5 Apr 2018 18:30:44 +0000 (18:30 +0000)]
Silence msvc warning on isl. NFC.

The warning is:

    isl_union_map.c(2041): warning C4221: nonstandard extension used: 'filter_user': cannot be initialized using address of automatic variable 'data'

for the following code (and others)

struct isl_un_op_drop_user_data data = { &isl_set_is_wrapping };
struct isl_un_op_control control = {
.filter = &un_op_filter_drop_user,
.filter_user = &data,
.fn_map = &isl_set_wrapped_domain_map,
};

llvm-svn: 329328

6 years ago[X86] Disassembler support for having an ADSIZE prefix affect instructions with 0xf2...
Craig Topper [Thu, 5 Apr 2018 18:20:14 +0000 (18:20 +0000)]
[X86] Disassembler support for having an ADSIZE prefix affect instructions with 0xf2 and 0xf3 prefixes.

Needed to support umonitor from D45253.

llvm-svn: 329327