platform/upstream/llvm.git
5 years ago[InstSimplify] use any-zero matcher for fcmp folds
Sanjay Patel [Wed, 20 Feb 2019 00:09:50 +0000 (00:09 +0000)]
[InstSimplify] use any-zero matcher for fcmp folds

The m_APFloat matcher does not work with anything but strict
splat vector constants, so we could miss these folds and then
trigger an assertion in instcombine:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13201

llvm-svn: 354406

5 years agoSort enum members so that arch-dependent members are at the right place. NFC.
Rui Ueyama [Wed, 20 Feb 2019 00:01:21 +0000 (00:01 +0000)]
Sort enum members so that arch-dependent members are at the right place. NFC.

llvm-svn: 354405

5 years ago[InstSimplify] add vector tests for fcmp+fabs; NFC
Sanjay Patel [Tue, 19 Feb 2019 23:58:02 +0000 (23:58 +0000)]
[InstSimplify] add vector tests for fcmp+fabs; NFC

llvm-svn: 354404

5 years ago[GVN] Fix a crash bug w/non-integral pointers and memtransfers
Philip Reames [Tue, 19 Feb 2019 23:49:38 +0000 (23:49 +0000)]
[GVN] Fix a crash bug w/non-integral pointers and memtransfers

Problem is very similiar to the one fixed for memsets in r354399, we try to coerce a value to non-integral type, and then crash while try to do so.  Since we shouldn't be doing such coercions to start with, easy fix.  From inspection, I see two other cases which look to be similiar and will follow up with most test cases and fixes if confirmed.

llvm-svn: 354403

5 years ago[msan] Fix name_to_handle_at test on overlayfs.
Evgeniy Stepanov [Tue, 19 Feb 2019 23:41:42 +0000 (23:41 +0000)]
[msan] Fix name_to_handle_at test on overlayfs.

Udev supports name_to_handle_at. Use /dev/null instead of /bin/cat.

llvm-svn: 354402

5 years ago[GVN] Fix a non-integral pointer bug w/vector types
Philip Reames [Tue, 19 Feb 2019 23:19:51 +0000 (23:19 +0000)]
[GVN] Fix a non-integral pointer bug w/vector types

GVN generally doesn't forward structs or array types, but it *will* forward vector types to non-vectors and vice versa.  As demonstrated in tests, we need to inhibit the same set of transforms for vector of non-integral pointers as for non-integral pointers themselves.

llvm-svn: 354401

5 years ago[lldb-instr] Don't print REGISTER macro when RECORD is already present
Jonas Devlieghere [Tue, 19 Feb 2019 23:13:29 +0000 (23:13 +0000)]
[lldb-instr] Don't print REGISTER macro when RECORD is already present

Currently we'd always print the LLDB_REGISTER macro, even if the
LLDB_RECORD macro was already present. This patches changes that to make
it easier to incrementally update the macros.

Note that it's still possible for the RECORD and REGISTER macros to get
out of sync.

llvm-svn: 354400

5 years ago[GVN] Fix a crash bug around non-integral pointers
Philip Reames [Tue, 19 Feb 2019 23:07:15 +0000 (23:07 +0000)]
[GVN] Fix a crash bug around non-integral pointers

If we encountered a location where we tried to forward the value of a memset to a load of a non-integral pointer, we crashed.  Such a forward is not legal in general, but we can forward null pointers.  Test for both cases are included.

llvm-svn: 354399

5 years ago[Test] Autogenerate existing tests before adding more
Philip Reames [Tue, 19 Feb 2019 22:57:30 +0000 (22:57 +0000)]
[Test] Autogenerate existing tests before adding more

llvm-svn: 354398

5 years ago[WebAssembly] Update MC for bulk memory
Thomas Lively [Tue, 19 Feb 2019 22:56:19 +0000 (22:56 +0000)]
[WebAssembly] Update MC for bulk memory

Summary:
Rename MemoryIndex to InitFlags and implement logic for determining
data segment layout in ObjectYAML and MC. Also adds a "passive" flag
for the .section assembler directive although this cannot be assembled
yet because the assembler does not support data sections.

Reviewers: sbc100, aardappel, aheejin, dschuff

Subscribers: jgravelle-google, hiraditya, sunfish, rupprecht, llvm-commits

Tags: #llvm

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

llvm-svn: 354397

5 years ago[X86] Mark FP32_TO_INT16_IN_MEM/FP32_TO_INT32_IN_MEM/FP32_TO_INT64_IN_MEM as clobberi...
Craig Topper [Tue, 19 Feb 2019 22:37:00 +0000 (22:37 +0000)]
[X86] Mark FP32_TO_INT16_IN_MEM/FP32_TO_INT32_IN_MEM/FP32_TO_INT64_IN_MEM as clobbering EFLAGS to prevent mis-scheduling during conversion from SelectionDAG to MIR.

After r354178, these instruction expand to a sequence that uses an OR instruction. That OR clobbers EFLAGS so we need to state that to avoid accidentally using the clobbered flags.

Our tests show the bug, but I didn't notice because the SETcc instructions didn't move after r354178 since it used to be safe to do the fp->int conversion first.

We should probably convert this whole sequence to SelectionDAG instead of a custom inserter to avoid mistakes like this.

Fixes PR40779

llvm-svn: 354395

5 years ago[LangRef] add to description of alloca instruction
Sanjay Patel [Tue, 19 Feb 2019 22:35:12 +0000 (22:35 +0000)]
[LangRef] add to description of alloca instruction

As mentioned in D58359, we can explicitly state that the
memory allocated is uninitialized and reading that memory
produces undef.

llvm-svn: 354394

5 years ago[InstCombine] reduce even more unsigned saturated add with 'not' op
Sanjay Patel [Tue, 19 Feb 2019 22:14:21 +0000 (22:14 +0000)]
[InstCombine] reduce even more unsigned saturated add with 'not' op

We want to use the sum in the icmp to allow matching with
m_UAddWithOverflow and eliminate the 'not'. This is discussed
in D51929 and is another step towards solving PR14613:
https://bugs.llvm.org/show_bug.cgi?id=14613

  Name: uaddsat, -1 fval
  %notx = xor i32 %x, -1
  %a = add i32 %x, %y
  %c = icmp ugt i32 %notx, %y
  %r = select i1 %c, i32 %a, i32 -1
  =>
  %a = add i32 %x, %y
  %c2 = icmp ugt i32 %y, %a
  %r = select i1 %c2, i32 -1, i32 %a

  Name: uaddsat, -1 fval + ult
  %notx = xor i32 %x, -1
  %a = add i32 %x, %y
  %c = icmp ult i32 %y, %notx
  %r = select i1 %c, i32 %a, i32 -1
  =>
  %a = add i32 %x, %y
  %c2 = icmp ugt i32 %y, %a
  %r = select i1 %c2, i32 -1, i32 %a

https://rise4fun.com/Alive/nTp

llvm-svn: 354393

5 years ago[libFuzzer] docs: add a FAQ entry about dlclose
Kostya Serebryany [Tue, 19 Feb 2019 22:11:50 +0000 (22:11 +0000)]
[libFuzzer] docs: add a FAQ entry about dlclose

llvm-svn: 354392

5 years agoMove MinGW-specific code out of LinkerDriver::link. NFC.
Rui Ueyama [Tue, 19 Feb 2019 22:06:44 +0000 (22:06 +0000)]
Move MinGW-specific code out of LinkerDriver::link. NFC.

LinkerDriver::link is getting too long, it's time to simplify it.

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

llvm-svn: 354391

5 years agosecond test on git-llvm-push
Renato Golin [Tue, 19 Feb 2019 22:06:27 +0000 (22:06 +0000)]
second test on git-llvm-push

llvm-svn: 354390

5 years agoFix builds with llvm/runtimes/compiler-rt after r354365
Daniel Sanders [Tue, 19 Feb 2019 22:02:38 +0000 (22:02 +0000)]
Fix builds with llvm/runtimes/compiler-rt after r354365

Compiler-rt doesn't include config-ix which was providing CheckSymbolExists to
the LLVM build. Add it to HandleLLVMOptions to fix this

llvm-svn: 354389

5 years ago[ArgumentPromotion] Add a lit.local.cfg to disable X86 specific tests if the X86...
Craig Topper [Tue, 19 Feb 2019 21:58:23 +0000 (21:58 +0000)]
[ArgumentPromotion] Add a lit.local.cfg to disable X86 specific tests if the X86 target doesn't exist.

Hopefully this fixes some buildbot failure after r354376

llvm-svn: 354388

5 years ago[MinGW] Hook up the --exclude-all-symbols option
Martin Storsjo [Tue, 19 Feb 2019 21:57:49 +0000 (21:57 +0000)]
[MinGW] Hook up the --exclude-all-symbols option

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

llvm-svn: 354387

5 years ago[COFF] Add -exclude-all-symbols for MinGW
Martin Storsjo [Tue, 19 Feb 2019 21:57:44 +0000 (21:57 +0000)]
[COFF] Add -exclude-all-symbols for MinGW

This is a private undocumented option, intended to be used by
the MinGW driver frontend.

Also restructure the condition to put if (Config->MinGW) first.
This changes the behaviour for the tautological combination of
-export-all-symbols without -lldmingw.

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

llvm-svn: 354386

5 years agoAdd Facebook Minidump directory streams and options to dump them.
Greg Clayton [Tue, 19 Feb 2019 21:48:34 +0000 (21:48 +0000)]
Add Facebook Minidump directory streams and options to dump them.

Facebook creates minidump files that contain specific information about why things crash. Adding ways to dump these allows tools to be made that can auto download symbols based on the information that is contained in the minidump files.

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

llvm-svn: 354385

5 years ago[InstCombine] rearrange saturated add folds; NFC
Sanjay Patel [Tue, 19 Feb 2019 21:46:13 +0000 (21:46 +0000)]
[InstCombine] rearrange saturated add folds; NFC

This is no-functional-change-intended, but that was also
true when it was part of rL354276, and I managed to lose
2 predicates for the fold with constant...causing much bot
distress. So this time I'm adding a couple of negative tests
to avoid that.

llvm-svn: 354384

5 years agoTesting git-llvm-push script
Renato Golin [Tue, 19 Feb 2019 21:32:05 +0000 (21:32 +0000)]
Testing git-llvm-push script

llvm-svn: 354383

5 years agoPowerPC: Fix typos in comments
Jinsong Ji [Tue, 19 Feb 2019 21:25:13 +0000 (21:25 +0000)]
PowerPC: Fix typos in comments

llvm-svn: 354382

5 years ago[ConstantFold] Fix misfolding fcmp of a ConstantExpr NaN with itself.
Andrew Scheidecker [Tue, 19 Feb 2019 21:21:54 +0000 (21:21 +0000)]
[ConstantFold] Fix misfolding fcmp of a ConstantExpr NaN with itself.

The code incorrectly inferred that the relationship of a constant expression
to itself is FCMP_OEQ (ordered and equal), when it's actually FCMP_UEQ
(unordered *or* equal). This change corrects that, and adds some more limited
folds that can be done in this case.

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

llvm-svn: 354381

5 years ago[ConstantFold] Fix misfolding of icmp with a bitcast FP second operand.
Andrew Scheidecker [Tue, 19 Feb 2019 21:03:20 +0000 (21:03 +0000)]
[ConstantFold] Fix misfolding of icmp with a bitcast FP second operand.

In the process of trying to eliminate the bitcast, this was producing a
malformed icmp with FP operands.

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

llvm-svn: 354380

5 years ago[llvm-cov] Add support for gcov --hash-filenames option
Vedant Kumar [Tue, 19 Feb 2019 20:45:00 +0000 (20:45 +0000)]
[llvm-cov] Add support for gcov --hash-filenames option

The patch adds support for --hash-filenames to llvm-cov. This option adds md5
hash of the source path to the name of the generated .gcov file. The option is
crucial for cases where you have multiple files with the same name but can't
use --preserve-paths as resulting filenames exceed the limit.

from gcov(1):

```
-x
--hash-filenames
    By default, gcov uses the full pathname of the source files to to
    create an output filename.  This can lead to long filenames that
    can overflow filesystem limits.  This option creates names of the
    form source-file##md5.gcov, where the source-file component is
    the final filename part and the md5 component is calculated from
    the full mangled name that would have been used otherwise.
```

Patch by Igor Ignatev!

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

llvm-svn: 354379

5 years agoTesting commit access
Andrew Scheidecker [Tue, 19 Feb 2019 20:38:51 +0000 (20:38 +0000)]
Testing commit access

llvm-svn: 354378

5 years ago[msan] Remove cxa_atexit_race.cc
Vitaly Buka [Tue, 19 Feb 2019 20:36:52 +0000 (20:36 +0000)]
[msan] Remove cxa_atexit_race.cc

Summary:
The goal of the test to check that msan does not crash when code is racy on __cxa_atexit. Original crash was caused by race condition in the glibc. With
the msan patch the msan does not crashes however the race is still there and the test triggers it.

Because the test relies on triggering of undefined behavior results are not
very predictable and it may occasionally crashes or hangs.

I don't see how to reasonably improve the test, so I remove it.

Reviewers: eugenis, peter.smith

Subscribers: jfb, jdoerfert, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 354377

5 years ago[X86] Don't consider functions ABI compatible for ArgumentPromotion pass if they...
Craig Topper [Tue, 19 Feb 2019 20:12:20 +0000 (20:12 +0000)]
[X86] Don't consider functions ABI compatible for ArgumentPromotion pass if they view 512-bit vectors differently.

The use of the -mprefer-vector-width=256 command line option mixed with functions
using vector intrinsics can create situations where one function thinks 512 vectors
are legal, but another fucntion does not.

If a 512 bit vector is passed between them via a pointer, its possible ArgumentPromotion
might try to pass by value instead. This will result in type legalization for the two
functions handling the 512 bit vector differently leading to runtime failures.

Had the 512 bit vector been passed by value from clang codegen, both functions would
have been tagged with a min-legal-vector-width=512 function attribute. That would
make them be legalized the same way.

I observed this issue in 32-bit mode where a union containing a 512 bit vector was
being passed by a function that used intrinsics to one that did not. The caller
ended up passing in zmm0 and the callee tried to read it from ymm0 and ymm1.

The fix implemented here is just to consider it a mismatch if two functions
would handle 512 bit differently without looking at the types that are being
considered. This is the easist and safest fix, but it can be improved in the future.

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

llvm-svn: 354376

5 years agoRevert "Revert "[llvm-objdump] Allow short options without arguments to be grouped""
Matthew Voss [Tue, 19 Feb 2019 19:46:08 +0000 (19:46 +0000)]
Revert "Revert "[llvm-objdump] Allow short options without arguments to be grouped""

  - Tests that use multiple short switches now test them grouped and ungrouped.

  - Ensure the output of ungrouped and grouped variants is identical

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

llvm-svn: 354375

5 years agoFix builds for older macOS deployment targets after r354365
Daniel Sanders [Tue, 19 Feb 2019 19:45:03 +0000 (19:45 +0000)]
Fix builds for older macOS deployment targets after r354365

Surprisingly, check_symbol_exists is not sufficient. The macOS linker checks the
called functions against a compatibility list for the given deployment target
and check_symbol_exists doesn't trigger this check as it never calls the
function.

This fixes the GreenDragon bots where the deployment target is 10.9

llvm-svn: 354374

5 years ago[sanitizers] add a regression test for the bug fixed in r354366
Kostya Serebryany [Tue, 19 Feb 2019 19:28:08 +0000 (19:28 +0000)]
[sanitizers] add a regression test for the bug fixed in r354366

llvm-svn: 354373

5 years ago[OpenMP] Remove XFAIL for cancellation tests using gcc
Jonathan Peyton [Tue, 19 Feb 2019 19:00:29 +0000 (19:00 +0000)]
[OpenMP] Remove XFAIL for cancellation tests using gcc

llvm-svn: 354370

5 years ago[OpenMP 5.0] Add omp_get_supported_active_levels()
Jonathan Peyton [Tue, 19 Feb 2019 18:51:11 +0000 (18:51 +0000)]
[OpenMP 5.0] Add omp_get_supported_active_levels()

This patch adds the new 5.0 API function omp_get_supported_active_levels().

Patch by Terry Wilmarth

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

llvm-svn: 354368

5 years ago[OpenMP] Adding GOMP compatible cancellation
Jonathan Peyton [Tue, 19 Feb 2019 18:47:57 +0000 (18:47 +0000)]
[OpenMP] Adding GOMP compatible cancellation

Remove fatal error messages from the cancellation API for GOMP
Add __kmp_barrier_gomp_cancel() to implement cancellation of parallel regions.
This new function uses the linear barrier algorithm with a cancellable
nonsleepable wait loop.

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

llvm-svn: 354367

5 years ago[sanitizer] fix a memory safety bug (!!!) in sanitizer suppressions code, discovered...
Kostya Serebryany [Tue, 19 Feb 2019 18:43:24 +0000 (18:43 +0000)]
[sanitizer] fix a memory safety bug (!!!) in sanitizer suppressions code, discovered by Aaron Jacobs

llvm-svn: 354366

5 years agoAnnotate timeline in Instruments with passes and other timed regions.
Daniel Sanders [Tue, 19 Feb 2019 18:18:31 +0000 (18:18 +0000)]
Annotate timeline in Instruments with passes and other timed regions.

Summary:
Instruments is a useful tool for finding performance issues in LLVM but it can
be difficult to identify regions of interest on the timeline that we can use
to filter the profiler or allocations instrument. Xcode 10 and the latest
macOS/iOS/etc. added support for the os_signpost() API which allows us to
annotate the timeline with information that's meaningful to LLVM.

This patch causes timer start and end events to emit signposts. When used with
-time-passes, this causes the passes to be annotated on the Instruments timeline.
In addition to visually showing the duration of passes on the timeline, it also
allows us to filter the profile and allocations instrument down to an individual
pass allowing us to find the issues within that pass without being drowned out
by the noise from other parts of the compiler.

Using this in conjunction with the Time Profiler (in high frequency mode) and
the Allocations instrument is how I found the SparseBitVector that should have
been a BitVector and the DenseMap that could be replaced by a sorted vector a
couple months ago. I added NamedRegionTimers to TableGen and used the resulting
annotations to identify the slow portions of the Register Info Emitter. Some of
these were placed according to educated guesses while others were placed
according to hot functions from a previous profile. From there I filtered the
profile to a slow portion and the aforementioned issues stood out in the
profile.

To use this feature enable LLVM_SUPPORT_XCODE_SIGNPOSTS in CMake and run the
compiler under Instruments with -time-passes like so:
  instruments -t 'Time Profiler' bin/llc -time-passes -o - input.ll'
Then open the resulting trace in Instruments.

There was a talk at WWDC 2018 that explained the feature which can be found at
https://developer.apple.com/videos/play/wwdc2018/405/ if you'd like to know
more about it.

Reviewers: bogner

Reviewed By: bogner

Subscribers: jdoerfert, mgorny, kristina, llvm-commits

Tags: #llvm

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

llvm-svn: 354365

5 years ago[libObject][NFC] Use sys::path::convert_to_slash.
Jordan Rupprecht [Tue, 19 Feb 2019 18:14:44 +0000 (18:14 +0000)]
[libObject][NFC] Use sys::path::convert_to_slash.

Summary: As suggested in rL353995

Reviewers: compnerd

Reviewed By: compnerd

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 354364

5 years ago[X86][SSE] Generalize X86ISD::BLENDI support to more value types
Simon Pilgrim [Tue, 19 Feb 2019 18:05:42 +0000 (18:05 +0000)]
[X86][SSE] Generalize X86ISD::BLENDI support to more value types

D42042 introduced the ability for the ExecutionDomainFixPass to more easily change between BLENDPD/BLENDPS/PBLENDW as the domains required.

With this ability, we can avoid most bitcasts/scaling in the DAG that was occurring with X86ISD::BLENDI lowering/combining, blend with the vXi32/vXi64 vectors directly and use isel patterns to lower to the float vector equivalent vectors.

This helps the shuffle combining and SimplifyDemandedVectorElts be more aggressive as we lose track of fewer UNDEF elements than when we go up/down through bitcasts.

I've introduced a basic blend(bitcast(x),bitcast(y)) -> bitcast(blend(x,y)) fold, there are more generalizations I can do there (e.g. widening/scaling and handling the tricky v16i16 repeated mask case).

The vector-reduce-smin/smax regressions will be fixed in a future improvement to SimplifyDemandedBits to peek through bitcasts and support X86ISD::BLENDV.

Reapplied after reversion at rL353699 - AVX2 isel fix was applied at rL354358, additional test at rL354360/rL354361

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

llvm-svn: 354363

5 years ago[NFC] Remove unused headers in Optional.h
Serge Guelton [Tue, 19 Feb 2019 18:03:47 +0000 (18:03 +0000)]
[NFC] Remove unused headers in Optional.h

llvm-svn: 354362

5 years agoFix stupid assembly comment typo
Simon Pilgrim [Tue, 19 Feb 2019 17:57:36 +0000 (17:57 +0000)]
Fix stupid assembly comment typo

llvm-svn: 354361

5 years ago[X86][SSE] Add pblendw commuted load test case
Simon Pilgrim [Tue, 19 Feb 2019 17:56:14 +0000 (17:56 +0000)]
[X86][SSE] Add pblendw commuted load test case

Reduced test case for the regression caused in D57888/rL353610

llvm-svn: 354360

5 years ago[SDAG] Use shift amount type in MULO promotion; NFC
Nikita Popov [Tue, 19 Feb 2019 17:37:55 +0000 (17:37 +0000)]
[SDAG] Use shift amount type in MULO promotion; NFC

Directly use the correct shift amount type if it is possible, and
future-proof the code against vectors. The added test makes sure that
bitwidths that do not fit into the shift amount type do not assert.

Split out from D57997.

llvm-svn: 354359

5 years ago[X86][AVX2] Hide VPBLENDD instructions behind AVX2 predicate
Simon Pilgrim [Tue, 19 Feb 2019 17:23:55 +0000 (17:23 +0000)]
[X86][AVX2] Hide VPBLENDD instructions behind AVX2 predicate

This was the cause of the regression in D57888 - the commuted load pattern wasn't hidden by the predicate so once we enabled v4i32 blends on SSE41+ targets then isel was incorrectly matched against AVX2+ instructions.

llvm-svn: 354358

5 years ago[X86] Bugfix for nullptr check by klocwork
Craig Topper [Tue, 19 Feb 2019 17:16:23 +0000 (17:16 +0000)]
[X86] Bugfix for nullptr check by klocwork

klocwork critical issues in CG files:

Patch by Xiang Zhang (xiangzhangllvm)

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

llvm-svn: 354357

5 years agoX86AsmParser AVX-512: Return error instead of hitting assert
Craig Topper [Tue, 19 Feb 2019 17:13:40 +0000 (17:13 +0000)]
X86AsmParser AVX-512: Return error instead of hitting assert

When parsing a sequence of tokens beginning with {, it will hit an assert and crash if the token afterwards is not an identifier. Instead of this, return a more verbose error as seen elsewhere in the function.

Patch by Brandon Jones (BrandonTJones)

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

llvm-svn: 354356

5 years ago[X86] Filter out tuning feature flags and a few ISA feature flags when checking for...
Craig Topper [Tue, 19 Feb 2019 17:05:11 +0000 (17:05 +0000)]
[X86] Filter out tuning feature flags and a few ISA feature flags when checking for function inline compatibility.

Tuning flags don't have any effect on the available instructions so aren't a good reason to prevent inlining.

There are also some ISA flags that don't have any intrinsics our ABI requirements that we can exclude. I've put only the most basic ones like cmpxchg16b and lahfsahf. These are interesting because they aren't present in all 64-bit CPUs, but we have codegen workarounds when they aren't present.

Loosening these checks can help with scenarios where a caller has a more specific CPU than a callee. The default tuning flags on our generic 'x86-64' CPU can currently make it inline compatible with other CPUs. I've also added an example test for 'nocona' and 'prescott' where 'nocona' is just a 64-bit capable version of 'prescott' but in 32-bit mode they should be completely compatible.

I've based the implementation here of the similar code in AMDGPU.

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

llvm-svn: 354355

5 years agoGlobalISel: Implement moreElementsVector for select
Matt Arsenault [Tue, 19 Feb 2019 17:03:09 +0000 (17:03 +0000)]
GlobalISel: Implement moreElementsVector for select

llvm-svn: 354354

5 years agoindex.rst: Remove bb-chapuni from list of IRC bots
Hans Wennborg [Tue, 19 Feb 2019 17:00:34 +0000 (17:00 +0000)]
index.rst: Remove bb-chapuni from list of IRC bots

llvm-svn: 354353

5 years agoindex.rst: Remove Dragonegg link
Hans Wennborg [Tue, 19 Feb 2019 17:00:29 +0000 (17:00 +0000)]
index.rst: Remove Dragonegg link

llvm-svn: 354352

5 years agoRemove extraneous space in MSVC-style diagnostic output
Hans Wennborg [Tue, 19 Feb 2019 16:58:25 +0000 (16:58 +0000)]
Remove extraneous space in MSVC-style diagnostic output

There was an extra space between the file location and the diagnostic
message:

  /tmp/a.c(1,12):  warning: unused parameter 'unused'

the tests didn't catch this due to FileCheck not running in --strict-whitespace mode.

Reported by Marco: http://lists.llvm.org/pipermail/cfe-dev/2019-February/061326.html

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

llvm-svn: 354351

5 years ago[compiler-rt][CMake] Set project for the custom libc++
Petr Hosek [Tue, 19 Feb 2019 16:53:33 +0000 (16:53 +0000)]
[compiler-rt][CMake] Set project for the custom libc++

This is another follow up to r354212 which is broken on Darwin when
cross-compiling runtimes to Linux when it ignores the -fuse-ld=lld
linker flag and attempts to use the host linker when performing the
compiler identification. Upon investigation, I noticed that setting
the project with appropriate list of languages makes the error go
away and it shouldn't hurt either.

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

llvm-svn: 354350

5 years ago[clangd] Add an option in the code to not display number of fixes
Ilya Biryukov [Tue, 19 Feb 2019 16:50:37 +0000 (16:50 +0000)]
[clangd] Add an option in the code to not display number of fixes

Summary:
Only to the APIs, which are used by our embedders.
We do not plan to add a user-facing option for this.

Reviewers: sammccall, ioeric

Reviewed By: sammccall

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 354349

5 years agoGlobalISel: Implement moreElementsVector for G_EXTRACT source
Matt Arsenault [Tue, 19 Feb 2019 16:44:22 +0000 (16:44 +0000)]
GlobalISel: Implement moreElementsVector for G_EXTRACT source

llvm-svn: 354348

5 years ago[OpenMP 5.0] Parsing/sema support for map clause with mapper modifier.
Michael Kruse [Tue, 19 Feb 2019 16:38:20 +0000 (16:38 +0000)]
[OpenMP 5.0] Parsing/sema support for map clause with mapper modifier.

This patch implements the parsing and sema support for OpenMP map
clauses with potential user-defined mapper attached. User defined mapper
is a new feature in OpenMP 5.0. A map clause can have an explicit or
implicit associated mapper, which instructs the compiler to generate
extra data mapping. An example is shown below:

    struct S { int len; int *d; };
    #pragma omp declare mapper(id: struct S s) map(s, s.d[0:s.len])
    struct S ss;
    #pragma omp target map(mapper(id) tofrom: ss) // use the mapper with name 'id' to map ss

Contributed-by: Lingda Li <lildmh@gmail.com>
Differential Revision: https://reviews.llvm.org/D58074

llvm-svn: 354347

5 years ago[X86][AVX] Update VBROADCAST folds to always use v2i64 X86vzload
Simon Pilgrim [Tue, 19 Feb 2019 16:33:17 +0000 (16:33 +0000)]
[X86][AVX] Update VBROADCAST folds to always use v2i64 X86vzload

The VBROADCAST combines and SimplifyDemandedVectorElts improvements mean that we now more consistently use shorter (128-bit) X86vzload input operands.

Follow up to D58053

llvm-svn: 354346

5 years agoGlobalISel: Implement moreElementsVector for bit ops
Matt Arsenault [Tue, 19 Feb 2019 16:30:19 +0000 (16:30 +0000)]
GlobalISel: Implement moreElementsVector for bit ops

llvm-svn: 354345

5 years ago[yaml2obj][obj2yaml] Remove section type range markers from allowed mappings and...
James Henderson [Tue, 19 Feb 2019 16:22:21 +0000 (16:22 +0000)]
[yaml2obj][obj2yaml] Remove section type range markers from allowed mappings and support hex values

yaml2obj/obj2yaml previously supported SHT_LOOS, SHT_HIOS, and
SHT_LOPROC for section types. These are simply values that delineate a
range and don't really make sense as valid values. For example if a
section has type value 0x70000000, obj2yaml shouldn't print this value
as SHT_LOPROC. Additionally, this was missing the three other range
markers (SHT_HIPROC, SHT_LOUSER and SHT_HIUSER).

This change removes these three range markers. It also adds support for
specifying the type as an integer, to allow section types that LLVM
doesn't know about.

Reviewed by: grimar

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

llvm-svn: 354344

5 years agoCast from SDValue directly instead of superfluous getNode(). NFCI.
Simon Pilgrim [Tue, 19 Feb 2019 16:20:09 +0000 (16:20 +0000)]
Cast from SDValue directly instead of superfluous getNode(). NFCI.

llvm-svn: 354343

5 years agoGlobalISel: Verify g_insert
Matt Arsenault [Tue, 19 Feb 2019 16:10:16 +0000 (16:10 +0000)]
GlobalISel: Verify g_insert

llvm-svn: 354342

5 years ago[mips] Fix indentations in the test. NFC
Simon Atanasyan [Tue, 19 Feb 2019 16:00:07 +0000 (16:00 +0000)]
[mips] Fix indentations in the test. NFC

llvm-svn: 354341

5 years ago[X86][AVX] EltsFromConsecutiveLoads - Add BROADCAST lowering support
Simon Pilgrim [Tue, 19 Feb 2019 15:57:09 +0000 (15:57 +0000)]
[X86][AVX] EltsFromConsecutiveLoads - Add BROADCAST lowering support

This patch adds scalar/subvector BROADCAST handling to EltsFromConsecutiveLoads.

It mainly shows codegen changes to 32-bit code which failed to handle i64 loads, although 64-bit code is also using this new path to more efficiently combine to a broadcast load.

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

llvm-svn: 354340

5 years ago[ELF] - Update test case after yaml2obj format change.
George Rimar [Tue, 19 Feb 2019 15:29:25 +0000 (15:29 +0000)]
[ELF] - Update test case after yaml2obj format change.

yaml2obj was changed in r354338("[yaml2obj][obj2yaml] - Support SHT_GNU_versym (.gnu.version) section.")

llvm-svn: 354339

5 years ago[yaml2obj][obj2yaml] - Support SHT_GNU_versym (.gnu.version) section.
George Rimar [Tue, 19 Feb 2019 15:29:07 +0000 (15:29 +0000)]
[yaml2obj][obj2yaml] - Support SHT_GNU_versym (.gnu.version) section.

This patch adds support for parsing dumping the .gnu.version section.
Description of the section is: https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/symversion.html#SYMVERTBL

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

llvm-svn: 354338

5 years ago[OpenCL] Change type of block pointer for OpenCL
Alexey Bader [Tue, 19 Feb 2019 15:19:06 +0000 (15:19 +0000)]
[OpenCL] Change type of block pointer for OpenCL

Summary:

For some reason OpenCL blocks in LLVM IR are represented as function pointers.
These pointers do not point to any real function and never get called. Actually
they point to some structure, which in turn contains pointer to the real block
invoke function.
This patch changes represntation of OpenCL blocks in LLVM IR from function
pointers to pointers to `%struct.__block_literal_generic`.
Such representation allows to avoid unnecessary bitcasts and simplifies
further processing (e.g. translation to SPIR-V ) of the module for targets
which do not support function pointers.

Patch by: Alexey Sotkin.

Reviewers: Anastasia, yaxunl, svenvh

Reviewed By: Anastasia

Subscribers: alexbatashev, cfe-commits

Tags: #clang

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

llvm-svn: 354337

5 years agoConvert the eh-frame-hdr-abs-fde.s test to use x86 as a target architecture
Simon Atanasyan [Tue, 19 Feb 2019 15:17:43 +0000 (15:17 +0000)]
Convert the eh-frame-hdr-abs-fde.s test to use x86 as a target architecture

The test checks common functionality. Let's use `x86` (generic LLD target)
as a target architecture.

llvm-svn: 354336

5 years agoRecommit r354328, r354329 "[obj2yaml][yaml2obj] - Add support of parsing/dumping...
George Rimar [Tue, 19 Feb 2019 14:53:48 +0000 (14:53 +0000)]
Recommit r354328, r354329 "[obj2yaml][yaml2obj] - Add support of parsing/dumping of the .gnu.version_r section."

Fix:
Replace
assert(!IO.getContext() && "The IO context is initialized already");
with
assert(IO.getContext() && "The IO context is not initialized");
(this was introduced in r354329, where I tried to quickfix the darwin BB
and seems copypasted the assert from the wrong place).

Original commit message:

The section is described here:
https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/symverrqmts.html

Patch just teaches obj2yaml/yaml2obj to dump and parse such sections.

We did the finalization of string tables very late,
and I had to move the logic to make it a bit earlier.
That was needed in this patch since .gnu.version_r adds strings to .dynstr.
This might also be useful for implementing other special sections.

Everything else changed in this patch seems to be straightforward.

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

llvm-svn: 354335

5 years ago[RISCV][NFC] Move some std::string to StringRef
Alex Bradbury [Tue, 19 Feb 2019 14:42:00 +0000 (14:42 +0000)]
[RISCV][NFC] Move some std::string to StringRef

llvm-svn: 354333

5 years agoRevert r354328, r354329 "[obj2yaml][yaml2obj] - Add support of parsing/dumping of...
George Rimar [Tue, 19 Feb 2019 14:38:25 +0000 (14:38 +0000)]
Revert r354328, r354329 "[obj2yaml][yaml2obj] - Add support of parsing/dumping of the .gnu.version_r section."

Something went wrong. Bots are unhappy:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/44113/steps/test/logs/stdio

llvm-svn: 354332

5 years ago[clangd] Handle unresolved scope specifier when fixing includes.
Eric Liu [Tue, 19 Feb 2019 14:32:22 +0000 (14:32 +0000)]
[clangd] Handle unresolved scope specifier when fixing includes.

Summary:
In the following examples, "clangd" is unresolved, and the fixer will try to fix
include for `clang::clangd`; however, clang::clangd::X is usually intended. So
when handling a qualifier that is unresolved, we change the unresolved name and
scopes so that the fixer will fix "clang::clangd::X" in the following example.
```
  namespace clang {
   clangd::X
~~~~~~
  }
  // or
  clang::clangd::X
         ~~~~~~
```

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354330

5 years agoFix BB after r354328.
George Rimar [Tue, 19 Feb 2019 14:22:10 +0000 (14:22 +0000)]
Fix BB after r354328.

Bot:
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/30188/steps/build_Lld/logs/stdio

Error:
/Users/buildslave/as-bldslv9_new/lld-x86_64-darwin13/llvm.src/lib/ObjectYAML/ELFYAML.cpp:1013:15: error: unused variable 'Object' [-Werror,-Wunused-variable]
  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
              ^
/Users/buildslave/as-bldslv9_new/lld-x86_64-darwin13/llvm.src/lib/ObjectYAML/ELFYAML.cpp:1023:15: error: unused variable 'Object' [-Werror,-Wunused-variable]
  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());

Fix:
change
  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
  assert(Object && "The IO context is not initialized");
to
  assert(!IO.getContext() && "The IO context is initialized already");

llvm-svn: 354329

5 years ago[obj2yaml][yaml2obj] - Add support of parsing/dumping of the .gnu.version_r section.
George Rimar [Tue, 19 Feb 2019 14:03:14 +0000 (14:03 +0000)]
[obj2yaml][yaml2obj] - Add support of parsing/dumping of the .gnu.version_r section.

The section is described here:
https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/symverrqmts.html

Patch just teaches obj2yaml/yaml2obj to dump and parse such sections.

We did the finalization of string tables very late,
and I had to move the logic to make it a bit earlier.
That was needed in this patch since .gnu.version_r adds strings to .dynstr.
This might also be useful for implementing other special sections.

Everything else changed in this patch seems to be straightforward.

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

llvm-svn: 354328

5 years agoRevert "minidump: Add ability to attach (breakpad) symbol files to placeholder modules"
Pavel Labath [Tue, 19 Feb 2019 13:52:31 +0000 (13:52 +0000)]
Revert "minidump: Add ability to attach (breakpad) symbol files to placeholder modules"

This reverts r354263, because it uncovered a problem in handling of the
minidumps with conflicting UUIDs. If a minidump contains two files with
the same UUID, we will not create to placeholder modules for them, but
instead reuse the first one for the second instance. This creates a
problem because these modules have their load address hardcoded in them
(and I've added an assert to verify that).

Technically this is not a problem with this patch, as the same issue
existed in the previous implementation, but it did not have the assert
which would diagnose that. Nonetheless, I am reverting this until I
figure out what's the best course of action in this situation.

llvm-svn: 354324

5 years ago[RISCV] Re-organise calling convention tests
Alex Bradbury [Tue, 19 Feb 2019 13:47:19 +0000 (13:47 +0000)]
[RISCV] Re-organise calling convention tests

Re-organise calling convention tests to prepare for ilp32f and ilp32d hard
float ABI tests. It's also clear that we need to introduce similar tests for
lp64.

llvm-svn: 354323

5 years agoFix BB after r354319 "[yaml2obj] - Do not skip zeroes blocks if there are relocations...
George Rimar [Tue, 19 Feb 2019 13:27:06 +0000 (13:27 +0000)]
Fix BB after r354319 "[yaml2obj] - Do not skip zeroes blocks if there are relocations against them."

Fix: move the test to x86 folder.
Seems it is needed, because llvm-objdump invocation used in test has -D (disasm) flag.

BB: http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/23016

/local/buildbot/slaves/hexagon-build-02/clang-hexagon-elf/stage1/bin/llvm-objdump:
error: '/local/buildbot/slaves/hexagon-build-02/clang-hexagon-elf/stage1/test/tools/llvm-objdump/Output/disasm-zeroes-relocations.test.tmp':
can't find target: : error: unable to get target for 'x86_64--', see --version and --triple.
.

llvm-svn: 354322

5 years ago[yaml2obj] - Do not skip zeroes blocks if there are relocations against them.
George Rimar [Tue, 19 Feb 2019 12:38:36 +0000 (12:38 +0000)]
[yaml2obj] - Do not skip zeroes blocks if there are relocations against them.

This is for -D -reloc combination.

With this patch, we do not skip the zero bytes that have a relocation against
them when -reloc is used. If -reloc is not used, then the behavior will be the same.

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

llvm-svn: 354319

5 years ago[yaml2obj] - Do not ignore explicit addresses for .dynsym and .dynstr
George Rimar [Tue, 19 Feb 2019 12:15:04 +0000 (12:15 +0000)]
[yaml2obj] - Do not ignore explicit addresses for .dynsym and .dynstr

This fixes https://bugs.llvm.org/show_bug.cgi?id=40339

Previously if the addresses were set in YAML they were ignored for
.dynsym and .dynstr sections. The patch fixes that.

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

llvm-svn: 354318

5 years agoFix obsolete comment. NFC
Diana Picus [Tue, 19 Feb 2019 11:34:36 +0000 (11:34 +0000)]
Fix obsolete comment. NFC

Both files mentioned in the comment now include TargetOpcodes.def. Just
mention that directly.

llvm-svn: 354316

5 years ago[mips] Remove trailing whitespaces from the test case. NFC
Simon Atanasyan [Tue, 19 Feb 2019 11:15:28 +0000 (11:15 +0000)]
[mips] Remove trailing whitespaces from the test case. NFC

llvm-svn: 354315

5 years ago[NFC] API for signaling that the current loop is being deleted
Max Kazantsev [Tue, 19 Feb 2019 11:14:05 +0000 (11:14 +0000)]
[NFC] API for signaling that the current loop is being deleted

We are planning to be able to delete the current loop in LoopSimplifyCFG
in the future. Add API to notify the loop pass manager that it happened.

llvm-svn: 354314

5 years ago[NFC] Store loop header in a local to keep it available after the loop is deleted
Max Kazantsev [Tue, 19 Feb 2019 11:13:58 +0000 (11:13 +0000)]
[NFC] Store loop header in a local to keep it available after the loop is deleted

llvm-svn: 354313

5 years ago[mips] Create LA25 thunks for MIPS R6 code
Simon Atanasyan [Tue, 19 Feb 2019 11:11:12 +0000 (11:11 +0000)]
[mips] Create LA25 thunks for MIPS R6 code

MIPS R6 code uses the `R_MIPS_PC26_S2` relocation for calls which might
cross boundaries of non-PIC-to-PIC code. We need to create a LA25 thunks
for that case.

llvm-svn: 354312

5 years ago[MIPS] Handle cross-mode (regular <-> microMIPS) jumps
Simon Atanasyan [Tue, 19 Feb 2019 10:36:58 +0000 (10:36 +0000)]
[MIPS] Handle cross-mode (regular <-> microMIPS) jumps

The patch solves two tasks:

1. MIPS ABI allows to mix regular and microMIPS code and perform
cross-mode jumps. Linker needs to detect such cases and replace
jump/branch instructions by their cross-mode equivalents.

2. Other tools like dunamic linkers need to recognize cases when dynamic
table entries, e_entry field of an ELF header etc point to microMIPS
symbol. Linker should provide such information.

The first task is implemented in the `MIPS<ELFT>::relocateOne()` method.
New routine `fixupCrossModeJump` detects ISA mode change, checks and
replaces an instruction.

The main problem is how to recognize that relocation target is microMIPS
symbol. For absolute and section symbols compiler or assembler set the
less-significant bit of the symbol's value or sum of the symbol's value
and addend. And this bit signals to linker about microMIPS code. For
global symbols compiler cannot do the same trick because other tools like,
for example, disassembler wants to know an actual position of the symbol.
So compiler sets STO_MIPS_MICROMIPS flag in the `st_other` field.

In `MIPS<ELFT>::relocateOne()` method we have a symbol's value only and
cannot access any symbol's attributes. To pass type of the symbol
(regular/microMIPS) to that routine as well as other places where we
write a symbol value as-is (.dynamic section, `Elf_Ehdr::e_entry` field
etc) we set when necessary a less-significant bit in the `getSymVA`
function.

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

llvm-svn: 354311

5 years ago[ARM GlobalISel] Support G_PHI for Thumb2
Diana Picus [Tue, 19 Feb 2019 10:26:47 +0000 (10:26 +0000)]
[ARM GlobalISel] Support G_PHI for Thumb2

Same as arm mode.

llvm-svn: 354310

5 years agoFix vscode tests for python3
Pavel Labath [Tue, 19 Feb 2019 08:25:25 +0000 (08:25 +0000)]
Fix vscode tests for python3

encode/decode the data before sending it over the socket. Since (AFAICT)
the vscode protocol (unlike the gdb-remote one) is fully textual, using
the utf8 codec here is appropriate.

llvm-svn: 354308

5 years ago[gui] Simplify SourceFileWindowDelegate::WindowDelegateDraw
Pavel Labath [Tue, 19 Feb 2019 08:12:41 +0000 (08:12 +0000)]
[gui] Simplify SourceFileWindowDelegate::WindowDelegateDraw

instead of printf-ing into a buffer, and them using that buffer as a
format string, simply use the appropriate indirect format string.

This also fixes a -Wformat-truncation warning with gcc.

llvm-svn: 354307

5 years ago[Dominators] Fix and optimize edge insertion of depth-based search
Fangrui Song [Tue, 19 Feb 2019 05:16:52 +0000 (05:16 +0000)]
[Dominators] Fix and optimize edge insertion of depth-based search

Summary:
After (x,y) is inserted, depth-based search finds all affected v that satisfies:

depth(nca(x,y))+1 < depth(v) && there exists a path P from y to v where every w on P satisfies depth(v) <= depth(w)

This reduces to a widest path problem (maximizing the depth of the
minimum vertex in the path) which can be solved by a modified version of
Dijkstra with a bucket queue (named depth-based search in the paper).

The algorithm visits vertices in decreasing order of bucket number.
However, the current code misused priority_queue to extract them in
increasing order. I cannot think of a failing scenario but it surely may
process vertices more than once due to the local usage of Processed.

This patch fixes this bug and simplifies/optimizes the code a bit. Also
add more comments.

Reviewers: kuhar

Reviewed By: kuhar

Subscribers: kristina, jdoerfert, llvm-commits, NutshellySima, brzycki

Tags: #llvm

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

llvm-svn: 354306

5 years ago[X86] Remove command line strings from the ProcIntel* features.
Craig Topper [Tue, 19 Feb 2019 03:04:14 +0000 (03:04 +0000)]
[X86] Remove command line strings from the ProcIntel* features.

These should always follow the CPU string. There's no reason to control them independently.

llvm-svn: 354304

5 years ago[lldb-instr] Test that we ignore existing macros.
Jonas Devlieghere [Tue, 19 Feb 2019 01:20:49 +0000 (01:20 +0000)]
[lldb-instr] Test that we ignore existing macros.

Although the functionality was already present, it wasn't tested.

llvm-svn: 354303

5 years ago[lldb-instr] Wrap returns of struct/classes in LLDB_RECORD_RESULT
Jonas Devlieghere [Tue, 19 Feb 2019 01:04:31 +0000 (01:04 +0000)]
[lldb-instr] Wrap returns of struct/classes in LLDB_RECORD_RESULT

The instrumentation framework requires return values of custom classes
and structs to be wrapped in the LLDB_RECORD_RESULT macro.

llvm-svn: 354301

5 years agoDisable TestModuleCXX.test on Windows
Jonas Devlieghere [Tue, 19 Feb 2019 00:08:10 +0000 (00:08 +0000)]
Disable TestModuleCXX.test on Windows

Importing cxx modules doesn't seem to work on Windows:

error: a.out :: Class 'tagARRAYDESC' has a member 'tdescElem' of type
  'tagTYPEDESC' which does not have a complete definition.
error: a.out :: Class 'tagPARAMDESCEX' has a member 'varDefaultValue' of type
  'tagVARIANT' which does not have a complete definition.
llvm-svn: 354300

5 years ago[GlobalISel][AArch64] Legalize + select some llvm.ctlz.* intrinsics
Jessica Paquette [Mon, 18 Feb 2019 23:33:24 +0000 (23:33 +0000)]
[GlobalISel][AArch64] Legalize + select some llvm.ctlz.* intrinsics

Legalize/select llvm.ctlz.*

Add select-ctlz to show that we actually select them. Update arm64-clrsb.ll and
arm64-vclz.ll to show that we perform valid transformations in optimized builds,
and document where GISel can improve.

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

llvm-svn: 354299

5 years ago[CGP] form usub with overflow from sub+icmp
Sanjay Patel [Mon, 18 Feb 2019 23:33:05 +0000 (23:33 +0000)]
[CGP] form usub with overflow from sub+icmp

The motivating x86 cases for forming the intrinsic are shown in PR31754 and PR40487:
https://bugs.llvm.org/show_bug.cgi?id=31754
https://bugs.llvm.org/show_bug.cgi?id=40487
..and those are shown in the IR test file and x86 codegen file.

Matching the usubo pattern is harder than uaddo because we have 2 independent values rather than a def-use.

This adds a TLI hook that should preserve the existing behavior for uaddo formation, but disables usubo
formation by default. Only x86 overrides that setting for now although other targets will likely benefit
by forming usbuo too.

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

llvm-svn: 354298

5 years ago[lldbtest] Fix some code to be compatible between py2 and py3.
Davide Italiano [Mon, 18 Feb 2019 23:18:14 +0000 (23:18 +0000)]
[lldbtest] Fix some code to be compatible between py2 and py3.

llvm-svn: 354297

5 years ago[clang][test] Fix FileManagerTest.getFileDontOpenRealPath for Windows
Jan Korous [Mon, 18 Feb 2019 23:12:29 +0000 (23:12 +0000)]
[clang][test] Fix FileManagerTest.getFileDontOpenRealPath for Windows

llvm-svn: 354296

5 years agoAMDGPU: Use MachineInstr::mayAlias to replace areMemAccessesTriviallyDisjoint in...
Changpeng Fang [Mon, 18 Feb 2019 23:00:26 +0000 (23:00 +0000)]
AMDGPU: Use MachineInstr::mayAlias to replace areMemAccessesTriviallyDisjoint in LoadStoreOptimizer pass.

Summary:
  This is to fix a memory dependence bug in LoadStoreOptimizer.

Reviewers:
  arsenm, rampitec

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

llvm-svn: 354295

5 years ago[lldb-instr] Add constructor and move test into lit/tools
Jonas Devlieghere [Mon, 18 Feb 2019 22:59:52 +0000 (22:59 +0000)]
[lldb-instr] Add constructor and move test into lit/tools

The test had an implicit constructor for the Foo struct. Also, as the
instrumentation doesn't have to be reproducer specific, I moved the
tests into the lit/tools directory.

llvm-svn: 354294

5 years agoGlobalISel: Implement widenScalar for g_extract scalar results
Matt Arsenault [Mon, 18 Feb 2019 22:39:27 +0000 (22:39 +0000)]
GlobalISel: Implement widenScalar for g_extract scalar results

llvm-svn: 354293

5 years agoGlobalISel: Make buildExtract use DstOp/SrcOp
Matt Arsenault [Mon, 18 Feb 2019 22:39:22 +0000 (22:39 +0000)]
GlobalISel: Make buildExtract use DstOp/SrcOp

llvm-svn: 354292