platform/upstream/llvm.git
5 years ago[hwasan] simplify the realloc implementation: always allocate/deallocate on realloc...
Kostya Serebryany [Wed, 29 Aug 2018 21:28:14 +0000 (21:28 +0000)]
[hwasan] simplify the realloc implementation: always allocate/deallocate on realloc. This may slowdown some realloc-heavy code, but at least at this point a want simpler code. Also added a test

llvm-svn: 340973

5 years ago[analyzer] Fix tests on 32-bit platforms by specifying the tuple explicitly
George Karpenkov [Wed, 29 Aug 2018 21:18:47 +0000 (21:18 +0000)]
[analyzer] Fix tests on 32-bit platforms by specifying the tuple explicitly

llvm-svn: 340972

5 years agoAdd a thread-local ring buffer of heap allocations
Kostya Serebryany [Wed, 29 Aug 2018 21:07:07 +0000 (21:07 +0000)]
Add a thread-local ring buffer of heap allocations

Summary:
We need this in order to properly report heap-use-after-free,
since we don't have a quarantine.

This is a first part of the code, more like a proof of concept.
But I'd like to commit at as is and proceed with refactoring,
adding a ThreadRegistry, and extending the functionality.

Reviewers: eugenis

Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits

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

llvm-svn: 340971

5 years ago[WebAssembly] clang-format (NFC)
Heejin Ahn [Wed, 29 Aug 2018 21:03:16 +0000 (21:03 +0000)]
[WebAssembly] clang-format (NFC)

Summary: This patch runs clang-format on all wasm-only files.

Reviewers: sbc100

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

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

llvm-svn: 340970

5 years ago[sanitizer] reapply r340884 'Add a RingBuffer class to sanitizer_common', with fixes...
Kostya Serebryany [Wed, 29 Aug 2018 21:00:01 +0000 (21:00 +0000)]
[sanitizer] reapply r340884 'Add a RingBuffer class to sanitizer_common', with fixes for Windows

llvm-svn: 340969

5 years ago[OPENMP] Do not create offloading entry for declare target variables
Alexey Bataev [Wed, 29 Aug 2018 20:41:37 +0000 (20:41 +0000)]
[OPENMP] Do not create offloading entry for declare target variables
declarations.

We should not create offloading entries for declare target var
declarations as it causes compiler crash.

llvm-svn: 340968

5 years agoAdd predefined macro __gnu_linux__ for proper aux-triple
Yaxun Liu [Wed, 29 Aug 2018 20:39:22 +0000 (20:39 +0000)]
Add predefined macro __gnu_linux__ for proper aux-triple

Clang predefine macro __linx__ for aux-triple with Linux OS
but does not predefine macro __gnu_linux__. This causes
some compilation error for certain applications, e.g. Eigen.

This patch fixes that.

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

llvm-svn: 340967

5 years agoDon't include the Age in the UUID for CvRecordPdb70 UUID records in minidump files...
Greg Clayton [Wed, 29 Aug 2018 20:34:08 +0000 (20:34 +0000)]
Don't include the Age in the UUID for CvRecordPdb70 UUID records in minidump files for Apple vendors.

The CvRecordPdb70 structure looks like:

struct CvRecordPdb70 {
  uint8_t Uuid[16];
  llvm::support::ulittle32_t Age;
  // char PDBFileName[];
};
We were including the "Age" in the UUID for Apple vedors which caused us to not be able to match the UUID to built binaries. The "Age" field is set to zero in breakpad minidump files for Apple targets.

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

llvm-svn: 340966

5 years ago[analyzer] Resolve the crash in ReturnUndefChecker
George Karpenkov [Wed, 29 Aug 2018 20:29:59 +0000 (20:29 +0000)]
[analyzer] Resolve the crash in ReturnUndefChecker

By making sure the returned value from getKnownSVal is consistent with
the value used inside expression engine.

PR38427

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

llvm-svn: 340965

5 years ago[analyzer] [NFC] Move class definition out of the function
George Karpenkov [Wed, 29 Aug 2018 20:29:39 +0000 (20:29 +0000)]
[analyzer] [NFC] Move class definition out of the function

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

llvm-svn: 340964

5 years ago[analyzer] Move analyzer-eagerly-assume to AnalyzerOptions, enable by default
George Karpenkov [Wed, 29 Aug 2018 20:29:17 +0000 (20:29 +0000)]
[analyzer] Move analyzer-eagerly-assume to AnalyzerOptions, enable by default

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

llvm-svn: 340963

5 years ago[analyzer] [NFC] Remove unused "state" argument from makeSymExprValNN
George Karpenkov [Wed, 29 Aug 2018 20:28:54 +0000 (20:28 +0000)]
[analyzer] [NFC] Remove unused "state" argument from makeSymExprValNN

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

llvm-svn: 340962

5 years ago[analyzer] Better retain count rules for OSObjects
George Karpenkov [Wed, 29 Aug 2018 20:28:33 +0000 (20:28 +0000)]
[analyzer] Better retain count rules for OSObjects

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

llvm-svn: 340961

5 years ago[analyzer] [NFC] Follow the convention when naming classes
George Karpenkov [Wed, 29 Aug 2018 20:28:13 +0000 (20:28 +0000)]
[analyzer] [NFC] Follow the convention when naming classes

Renames InvalidateRegionsWorker and RemoveDeadBindingsWorker

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

llvm-svn: 340960

5 years agoAMDGPU: Handle 32-bit address wraparounds for SMRD opcodes
Marek Olsak [Wed, 29 Aug 2018 20:03:00 +0000 (20:03 +0000)]
AMDGPU: Handle 32-bit address wraparounds for SMRD opcodes

Summary: This fixes GPU hangs with OpenGL bindless handle arithmetic.

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

llvm-svn: 340959

5 years agoRemoved commented out includes [NFC]
Raphael Isemann [Wed, 29 Aug 2018 19:55:33 +0000 (19:55 +0000)]
Removed commented out includes [NFC]

llvm-svn: 340958

5 years ago[sanitizer] Revert D50940
Kostya Kortchinsky [Wed, 29 Aug 2018 19:41:28 +0000 (19:41 +0000)]
[sanitizer] Revert D50940

Summary:
The previous version of the patch makes some code unable to distinguish
failure to map address 0 and error.
Revert to turn the bots back to green while figuring out a new approach.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits

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

llvm-svn: 340957

5 years ago[OPENMP][NVPTX] Replace assert() by ASSERT0() macro, NFC.
Alexey Bataev [Wed, 29 Aug 2018 19:22:06 +0000 (19:22 +0000)]
[OPENMP][NVPTX] Replace assert() by ASSERT0() macro, NFC.

Required to fix the buildbots.

llvm-svn: 340956

5 years ago[SimpleLoopUnswitch] After unswitch delete dead blocks in parent loops
Fedor Sergeev [Wed, 29 Aug 2018 19:10:44 +0000 (19:10 +0000)]
[SimpleLoopUnswitch] After unswitch delete dead blocks in parent loops

Summary:
Assert from PR38737 happens on the dead block inside the parent loop
after unswitching nontrivial switch in the inner loop.

deleteDeadBlocksFromLoop now takes extra care to detect/remove dead
blocks in all the parent loops in addition to the blocks from original
loop being unswitched.

Reviewers: asbirlea, chandlerc

Reviewed By: asbirlea

Subscribers: llvm-commits

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

llvm-svn: 340955

5 years agoRevert "[libFuzzer] Port to Windows"
Matt Morehouse [Wed, 29 Aug 2018 18:40:41 +0000 (18:40 +0000)]
Revert "[libFuzzer] Port to Windows"

This reverts r340949 due to bot breakage again.

llvm-svn: 340954

5 years ago[OPENMP][NVPTX] Add support for lightweight runtime.
Alexey Bataev [Wed, 29 Aug 2018 18:32:21 +0000 (18:32 +0000)]
[OPENMP][NVPTX] Add support for lightweight runtime.

If the target construct can be executed in SPMD mode + it is a loop
based directive with static scheduling, we can use lightweight runtime
support.

llvm-svn: 340953

5 years ago[InstCombine] canonicalize fneg with llvm.sin
Sanjay Patel [Wed, 29 Aug 2018 18:27:49 +0000 (18:27 +0000)]
[InstCombine] canonicalize fneg with llvm.sin

This is a follow-up to rL339604 which did the same transform
for a sin libcall. The handling of intrinsics vs. libcalls
is unfortunately scattered, so I'm just adding this next to
the existing transform for llvm.cos for now.

This should resolve PR38458:
https://bugs.llvm.org/show_bug.cgi?id=38458
If the call was already negated, the negates will cancel
each other out.

llvm-svn: 340952

5 years ago[MemorySSA] Add expesive check for validating clobber accesses.
Alina Sbirlea [Wed, 29 Aug 2018 18:26:04 +0000 (18:26 +0000)]
[MemorySSA] Add expesive check for validating clobber accesses.

Summary: Add validation of clobber accesses as expensive check.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, llvm-commits

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

llvm-svn: 340951

5 years ago[InstCombine] add tests for llvm.sin(-x); NFC
Sanjay Patel [Wed, 29 Aug 2018 18:11:42 +0000 (18:11 +0000)]
[InstCombine] add tests for llvm.sin(-x); NFC

Also add a corresponding test for llvm.cos with FMF to
make sure that was handled correctly.

llvm-svn: 340950

5 years ago[libFuzzer] Port to Windows
Matt Morehouse [Wed, 29 Aug 2018 18:08:34 +0000 (18:08 +0000)]
[libFuzzer] Port to Windows

Summary:
Port libFuzzer to windows-msvc.
This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well.
It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch.
It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them.

Reviewers: morehouse, rnk

Reviewed By: morehouse, rnk

Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman

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

llvm-svn: 340949

5 years ago[InstCombine] Expand the simplification of pow() with nested exp{,2}()
Evandro Menezes [Wed, 29 Aug 2018 17:59:48 +0000 (17:59 +0000)]
[InstCombine] Expand the simplification of pow() with nested exp{,2}()

Expand the simplification of `pow(exp{,2}(x), y)` to all FP types.

This improvement helps some benchmarks in SPEC CPU2000 and CPU2006, such as
252.eon, 447.dealII, 453.povray.  Otherwise, no significant regressions on
x86-64 or A64.

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

llvm-svn: 340948

5 years ago[InstCombine] Expand the simplification of pow() into exp2()
Evandro Menezes [Wed, 29 Aug 2018 17:59:34 +0000 (17:59 +0000)]
[InstCombine] Expand the simplification of pow() into exp2()

Generalize the simplification of `pow(2.0, y)` to `pow(2.0 ** n, y)` for all
scalar and vector types.

This improvement helps some benchmarks in SPEC CPU2000 and CPU2006, such as
252.eon, 447.dealII, 453.povray.  Otherwise, no significant regressions on
x86-64 or A64.

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

llvm-svn: 340947

5 years ago[llvm-mca] Add fields "Total uOps" and "uOps Per Cycle" to the report generated by...
Andrea Di Biagio [Wed, 29 Aug 2018 17:56:39 +0000 (17:56 +0000)]
[llvm-mca] Add fields "Total uOps" and "uOps Per Cycle" to the report generated by the SummaryView.

This patch adds two new fields to the perf report generated by the SummaryView.
Fields are now logically organized into two small groups; only the second group
contains throughput indicators.

Example:
```
Iterations:        100
Instructions:      300
Total Cycles:      414
Total uOps:        700

Dispatch Width:    4
uOps Per Cycle:    1.69
IPC:               0.72
Block RThroughput: 4.0
```

This patch also updates the docs for llvm-mca.
Due to the nature of this change, several tests in the tools/llvm-mca directory
were affected, and had to be updated using script `update_mca_test_checks.py`.

llvm-svn: 340946

5 years ago[llvm-mca] Don't disable the SummaryView if flag `-all-stats` is false.
Andrea Di Biagio [Wed, 29 Aug 2018 17:40:04 +0000 (17:40 +0000)]
[llvm-mca] Don't disable the SummaryView if flag `-all-stats` is false.

llvm-svn: 340945

5 years ago[OPENMP][NVPTX] Lightweight runtime support for SPMD mode.
Alexey Bataev [Wed, 29 Aug 2018 17:35:09 +0000 (17:35 +0000)]
[OPENMP][NVPTX] Lightweight runtime support for SPMD mode.

Summary:
Implemented simple and lightweight runtime support for SPMD mode-based
constructs. It adds support for L2 sequential parallelism wihtout full
runtime support. Also, patch fixes some use cases for
uninitialized|lightweight runtime.

Reviewers: grokos, kkwli0, Hahnfeld, gtbercea

Subscribers: guansong, openmp-commits

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

llvm-svn: 340944

5 years ago[CMake] Add an lld-test-depends target
Martin Storsjo [Wed, 29 Aug 2018 17:30:45 +0000 (17:30 +0000)]
[CMake] Add an lld-test-depends target

This builds all dependencies of lld-test/check-lld, without running
the tests. This matches llvm-test-depends and clang-test-depends.

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

llvm-svn: 340943

5 years ago[MinGW] [X86] Add stubs for references to data variables that might end up imported...
Martin Storsjo [Wed, 29 Aug 2018 17:28:34 +0000 (17:28 +0000)]
[MinGW] [X86] Add stubs for references to data variables that might end up imported from a dll

Variables declared with the dllimport attribute are accessed via a
stub variable named __imp_<var>. In MinGW configurations, variables that
aren't declared with a dllimport attribute might still end up imported
from another DLL with runtime pseudo relocs.

For x86_64, this avoids the risk that the target is out of range
for a 32 bit PC relative reference, in case the target DLL is loaded
further than 4 GB from the reference. It also avoids having to make the
text section writable at runtime when doing the runtime fixups, which
makes it worthwhile to do for i386 as well.

Add stub variables for all dso local data references where a definition
of the variable isn't visible within the module, since the DLL data
autoimporting might make them imported even though they are marked as
dso local within LLVM.

Don't do this for variables that actually are defined within the same
module, since we then know for sure that it actually is dso local.

Don't do this for references to functions, since there's no need for
runtime pseudo relocations for autoimporting them; if a function from
a different DLL is called without the appropriate dllimport attribute,
the call just gets routed via a thunk instead.

GCC does something similar since 4.9 (when compiling with -mcmodel=medium
or large; from that version, medium is the default code model for x86_64
mingw), but only for x86_64.

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

llvm-svn: 340942

5 years ago[MinGW] Don't mark external variables as DSO local
Martin Storsjo [Wed, 29 Aug 2018 17:26:58 +0000 (17:26 +0000)]
[MinGW] Don't mark external variables as DSO local

Since MinGW supports automatically importing external variables from
DLLs even without the DLLImport attribute, we shouldn't mark them
as DSO local unless we actually know them to be local for sure.

Keep marking thread local variables as DSO local.

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

llvm-svn: 340941

5 years ago[COFF] Merge the .ctors, .dtors and .CRT sections into .rdata for MinGW
Martin Storsjo [Wed, 29 Aug 2018 17:24:10 +0000 (17:24 +0000)]
[COFF] Merge the .ctors, .dtors and .CRT sections into .rdata for MinGW

There's no point in keeping them as separate sections.

This differs from GNU ld, which places .ctors and .dtors content in
.text (implemented by a built-in linker script). But since the content
only is pointers, there's no need to have it executable.

GNU ld also leaves .CRT separate as its own standalone section.

MSVC merges .CRT into .rdata similarly, with a directive embedded in
an object file in msvcrt.lib or libcmt.lib.

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

llvm-svn: 340940

5 years ago[InstCombine] Replace two calls to getNumUses() with !hasNUsesOrMore
Craig Topper [Wed, 29 Aug 2018 17:09:21 +0000 (17:09 +0000)]
[InstCombine] Replace two calls to getNumUses() with !hasNUsesOrMore

We were calling getNumUses to check for 1 or 2 uses. But getNumUses is linear in the number of uses. We can instead use !hasNUsesOrMore(3) which will stop the linear scan as soon as it determines there are at least 3 uses even if there are more.

llvm-svn: 340939

5 years agoUpdate Visual Studio Integration version number.
Zachary Turner [Wed, 29 Aug 2018 16:57:37 +0000 (16:57 +0000)]
Update Visual Studio Integration version number.

This updates the version number in the manifest file to match
the SVN revision at which it was committed.

llvm-svn: 340938

5 years ago[Tooling] Do not restore working dir in ClangTool
Ilya Biryukov [Wed, 29 Aug 2018 16:35:31 +0000 (16:35 +0000)]
[Tooling] Do not restore working dir in ClangTool

Summary:
Resolve all relative paths before running the tool instead.

This fixes the usage of ClangTool in AllTUsExecutor. The executor will
try running multiple ClangTool instances in parallel with compile
commands that usually have the same working directory.

Changing working directory is a global operation, so we end up
changing working directory in the middle of running other actions,
which leads to spurious compile errors.

Reviewers: ioeric, sammccall

Reviewed By: ioeric

Subscribers: cfe-commits

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

llvm-svn: 340937

5 years ago[AMDGPU] Match udot4 pattern.
Farhana Aleen [Wed, 29 Aug 2018 16:31:18 +0000 (16:31 +0000)]
[AMDGPU] Match udot4 pattern.

Summary: D.u32 = S0.u8[0] * S1.u8[0] +
                 S0.u8[1] * S1.u8[1] +
                 S0.u8[2] * S1.u8[2] +
                 S0.u8[3] * S1.u8[3] + S2.u32

Author: FarhanaAleen

Reviewed By: arsenm

Subscribers: llvm-commits, AMDGPU

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

llvm-svn: 340936

5 years ago[DebugCounters] Fix DebugCounterTest when running all SupportTests
Alexandre Ganea [Wed, 29 Aug 2018 16:11:48 +0000 (16:11 +0000)]
[DebugCounters] Fix DebugCounterTest when running all SupportTests

Previously, the DebugCounterTest was failing because CommandLineTest.GetCommandLineArguments was clearing all the global singletons.

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

llvm-svn: 340935

5 years ago[OPENMP] Create non-const ident_t objects.
Mike Rice [Wed, 29 Aug 2018 15:45:11 +0000 (15:45 +0000)]
[OPENMP] Create non-const ident_t objects.

Currently ident_t objects are created const when debug info is not
enabled, but the libittnotify libray in the OpenMP runtime writes to
the reserved_2 field (See __kmp_itt_region_forking in
openmp/runtime/src/kmp_itt.inl).  Now create ident_t objects non-const.

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

llvm-svn: 340934

5 years ago[InstCombine] add test for vector demanded elements + shrinking; NFC
Sanjay Patel [Wed, 29 Aug 2018 15:34:19 +0000 (15:34 +0000)]
[InstCombine] add test for vector demanded elements + shrinking; NFC

llvm-svn: 340933

5 years ago[mips] Fix microMIPS unconditional branch offset handling
Simon Atanasyan [Wed, 29 Aug 2018 14:54:01 +0000 (14:54 +0000)]
[mips] Fix microMIPS unconditional branch offset handling

MipsSEInstrInfo class defines for internal purpose unconditional
branches as Mips::B nad Mips:J even in case of microMIPS code
generation. Under some conditions that leads to the bug - for rather long
branch which fits to Mips jump instruction offset size, but does not fit
to microMIPS jump offset size, we generate 'short' branch and later show
an error 'out of range PC16 fixup' after check in the isBranchOffsetInRange
routine.

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

llvm-svn: 340932

5 years ago[mips] Involves microMIPS's jump in the analyzable branch set
Simon Atanasyan [Wed, 29 Aug 2018 14:53:55 +0000 (14:53 +0000)]
[mips] Involves microMIPS's jump in the analyzable branch set

Involves microMIPS's jump in the analyzable branch set to reduce some
code patterns.

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

llvm-svn: 340931

5 years ago[InstCombine] move declarations closer to uses; NFC
Sanjay Patel [Wed, 29 Aug 2018 14:42:12 +0000 (14:42 +0000)]
[InstCombine] move declarations closer to uses; NFC

llvm-svn: 340930

5 years ago[Preamble] Fix incorrect usage of std::error_category
Alexandre Ganea [Wed, 29 Aug 2018 14:28:04 +0000 (14:28 +0000)]
[Preamble] Fix incorrect usage of std::error_category

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

llvm-svn: 340929

5 years ago[clang-tidy] Add abseil-no-internal-dependencies check
Jonas Toth [Wed, 29 Aug 2018 14:23:15 +0000 (14:23 +0000)]
[clang-tidy] Add abseil-no-internal-dependencies check

Finds instances where the user depends on internal details and warns them against doing so.
Should not be run on internal Abseil files or Abseil source code.

Patch by hugoeg!

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

llvm-svn: 340928

5 years ago[mips] Prevent shrink-wrap for BuildPairF64, ExtractElementF64 when they use $sp
Vladimir Stefanovic [Wed, 29 Aug 2018 14:07:14 +0000 (14:07 +0000)]
[mips] Prevent shrink-wrap for BuildPairF64, ExtractElementF64 when they use $sp

For a certain combination of options, BuildPairF64_{64}, ExtractElementF64{_64}
may be expanded into instructions using stack.
Add implicit operand $sp for such cases so that ShrinkWrapping doesn't move
prologue setup below them.

Fixes MultiSource/Benchmarks/MallocBench/cfrac for
'--target=mips-img-linux-gnu -mcpu=mips32r6 -mfpxx -mnan=2008'
and
'--target=mips-img-linux-gnu -mcpu=mips32r6 -mfp64 -mnan=2008 -mno-odd-spreg'.

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

llvm-svn: 340927

5 years ago[InstCombine] remove unnecessary shuffle undef folding
Sanjay Patel [Wed, 29 Aug 2018 13:24:34 +0000 (13:24 +0000)]
[InstCombine] remove unnecessary shuffle undef folding

Add a test for constant folding to show that
(shuffle undef, undef, mask)
should already be handled via instsimplify.

llvm-svn: 340926

5 years agoRevert r340922 "[GVNHoist] Re-enable GVNHoist by default"
Alexandros Lamprineas [Wed, 29 Aug 2018 13:00:55 +0000 (13:00 +0000)]
Revert r340922 "[GVNHoist] Re-enable GVNHoist by default"

Another sanitizer buildbot failed this time at bootstrap when
compiling SemaTemplateInstantiate.cpp with this assertion:
`dominates(MD, U) && "Memory Def does not dominate it's uses"'.

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/15047

llvm-svn: 340925

5 years agoRevert r340884 "Add a RingBuffer class to sanitizer_common"
Hans Wennborg [Wed, 29 Aug 2018 12:40:29 +0000 (12:40 +0000)]
Revert r340884 "Add a RingBuffer class to sanitizer_common"

The test doesn't pass on Windows, where sizeof(long) == 4 also
on 64-bit, and so it isn't a multiple of sizeof(void*).

This also reverts the follow-up r340886.

> Summary: a constrained RingBuffer optimized for fast push
>
> Reviewers: eugenis
>
> Reviewed By: eugenis
>
> Subscribers: kubamracek, mgorny, delcypher, #sanitizers, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D51196

llvm-svn: 340924

5 years agoRevert r340921 "[NFC] Unify guards detection"
Hans Wennborg [Wed, 29 Aug 2018 12:21:32 +0000 (12:21 +0000)]
Revert r340921 "[NFC] Unify guards detection"

This broke the build, see e.g.

http://lab.llvm.org:8011/builders/clang-cmake-armv8-lnt/builds/4626/
http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/18647/
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-avx2-linux/builds/5856/
http://lab.llvm.org:8011/builders/lld-x86_64-freebsd/builds/22800/

> We have multiple places in code where we try to identify whether or not
> some instruction is a guard. This patch factors out this logic into a separate
> utility function which works uniformly in all places.
>
> Differential Revision: https://reviews.llvm.org/D51152
> Reviewed By: fedor.sergeev

llvm-svn: 340923

5 years ago[GVNHoist] Re-enable GVNHoist by default
Alexandros Lamprineas [Wed, 29 Aug 2018 11:58:34 +0000 (11:58 +0000)]
[GVNHoist] Re-enable GVNHoist by default

Rebase rL338240 since the excessive memory usage observed when using
GVNHoist with UBSan has been fixed by rL340818.

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

llvm-svn: 340922

5 years ago[NFC] Unify guards detection
Max Kazantsev [Wed, 29 Aug 2018 11:37:34 +0000 (11:37 +0000)]
[NFC] Unify guards detection

We have multiple places in code where we try to identify whether or not
some instruction is a guard. This patch factors out this logic into a separate
utility function which works uniformly in all places.

Differential Revision: https://reviews.llvm.org/D51152
Reviewed By: fedor.sergeev

llvm-svn: 340921

5 years ago[mips] Add missing instructions
Aleksandar Beserminji [Wed, 29 Aug 2018 11:35:03 +0000 (11:35 +0000)]
[mips] Add missing instructions

Add pll.ps, plu.ps, cvt.s.pu, cvt.s.pl, cvt.ps instructions for FP64.

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

llvm-svn: 340920

5 years ago[DAGCombiner] Add X / X -> 1 & X % X -> 0 folds
Simon Pilgrim [Wed, 29 Aug 2018 11:30:16 +0000 (11:30 +0000)]
[DAGCombiner] Add X / X -> 1 & X % X -> 0 folds

Adds more divrem folds to try and get in sync with InstructionSimplify

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

llvm-svn: 340919

5 years agoIntroduce the abseil-redundant-strcat-calls check.
Aaron Ballman [Wed, 29 Aug 2018 11:29:07 +0000 (11:29 +0000)]
Introduce the abseil-redundant-strcat-calls check.

This flags redundant calls to absl::StrCat where the result is being passed to another call to absl::StrCat or absl::StrAppend. Patch by Hugo Gonzalez and Samuel Benzaquen.

llvm-svn: 340918

5 years ago[DAGCombiner] Add X / X -> 1 & X % X -> 0 folds (test tweaks)
Simon Pilgrim [Wed, 29 Aug 2018 11:23:59 +0000 (11:23 +0000)]
[DAGCombiner] Add X / X -> 1 & X % X -> 0 folds (test tweaks)

Adjust missed test to avoid the X / X -> 1 & X % X -> 0 folds while keeping their original purposes.

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

llvm-svn: 340917

5 years ago[DAGCombiner] Add X / X -> 1 & X % X -> 0 folds (test tweaks)
Simon Pilgrim [Wed, 29 Aug 2018 11:18:14 +0000 (11:18 +0000)]
[DAGCombiner] Add X / X -> 1 & X % X -> 0 folds (test tweaks)

Adjust tests to avoid the X / X -> 1 & X % X -> 0 folds while keeping their original purposes.

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

llvm-svn: 340916

5 years agoIntroduce the abseil-str-cat-append check.
Aaron Ballman [Wed, 29 Aug 2018 11:17:31 +0000 (11:17 +0000)]
Introduce the abseil-str-cat-append check.

This flags uses of absl::StrCat when absl::StrAppend should be used instead. Patch by Hugo Gonzalez and Benjamin Kramer.

llvm-svn: 340915

5 years ago[NFC] Factor out guard utility methods into a separate file
Max Kazantsev [Wed, 29 Aug 2018 10:51:59 +0000 (10:51 +0000)]
[NFC] Factor out guard utility methods into a separate file

This patch creates file GuardUtils which will contain logic for work with guards
that can be shared across different passes.

Differential Revision: https://reviews.llvm.org/D51151
Reviewed By: fedor.sergeev

llvm-svn: 340914

5 years ago[X86][AVX] Prefer VPBLENDW+VPBLENDD to VPBLENDVB for v16i16 blend shuffles
Simon Pilgrim [Wed, 29 Aug 2018 10:51:08 +0000 (10:51 +0000)]
[X86][AVX] Prefer VPBLENDW+VPBLENDD to VPBLENDVB for v16i16 blend shuffles

Noticed while looking at D49562 codegen - we can avoid a large constant mask load and a slow VPBLENDVB select op by using VPBLENDW+VPBLENDD instead.

TODO: As discussed on the patch, we should investigate adding VPBLENDVB handling to target shuffle combining as well, that will allow us to extend this to VPBLENDW+VPBLENDW+VPBLENDD.

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

llvm-svn: 340913

5 years ago[MC] fix a clang-tidy warning, NFC
Krasimir Georgiev [Wed, 29 Aug 2018 10:40:51 +0000 (10:40 +0000)]
[MC] fix a clang-tidy warning, NFC

Summary:
Per clang-tidy:
function 'llvm::MCStreamer::checkCVLocSection' has a definition with different parameter names

.../llvm/lib/MC/MCStreamer.cpp:275:18: the definition seen here

.../llvm/include/llvm/MC/MCStreamer.h:235:8: differing parameters are named here: ('FuncId'), in definition: ('FunctionId')

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: llvm-commits

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

llvm-svn: 340912

5 years ago[ARM] Set __ARM_FEATURE_SIMD32 for +dsp cores
Sam Parker [Wed, 29 Aug 2018 10:39:03 +0000 (10:39 +0000)]
[ARM] Set __ARM_FEATURE_SIMD32 for +dsp cores

ARM_FEATURE_DSP is already set for targets with the +dsp feature. In
the backend, this target feature is also used to represent the
availability of the of the instructions that the ACLE guard through
the __ARM_FEATURE_SIMD32 macro. We don't have any cores that
implement one and not the other, so set this macro for cores later
than V6 or for Cortex-M cores that the target parser, or user, reports
that the 'dsp' instructions are supported.

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

llvm-svn: 340911

5 years agoRemove debug code accidently committed in rL340837. NFCI.
Simon Pilgrim [Wed, 29 Aug 2018 10:10:58 +0000 (10:10 +0000)]
Remove debug code accidently committed in rL340837. NFCI.

llvm-svn: 340908

5 years agoIntroduce new type for inteceptors UINTMAX_T
Kamil Rytarowski [Wed, 29 Aug 2018 09:11:17 +0000 (09:11 +0000)]
Introduce new type for inteceptors UINTMAX_T

Summary:
The UINTMAX_T type will be used in new interceptors.

While there, correct the type of strtoumax(3) from INTMAX_T to UINTMAX_T.

Original patch from Yang Zheng.

Reviewers: vitalybuka, kcc, joerg

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, tomsun.0.7, #sanitizers

Tags: #sanitizers

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

llvm-svn: 340907

5 years agoRevert r340904 "[llvm-mc] - Allow to set custom flags for debug sections."
George Rimar [Wed, 29 Aug 2018 09:04:52 +0000 (09:04 +0000)]
Revert r340904 "[llvm-mc] - Allow to set custom flags for debug sections."

It broke PPC64 BB:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/23252

llvm-svn: 340906

5 years ago[benchmark] NFC: Turn benchmark ON on all non-Windows buildbots
Kirill Bobyrev [Wed, 29 Aug 2018 08:59:36 +0000 (08:59 +0000)]
[benchmark] NFC: Turn benchmark ON on all non-Windows buildbots

The problems with benchmark build should be fixed now, but Windows
buildbots still run into errors seemingly because of the bug in
clang-cl. Because of that, benchmark shouldn't be built on Windows at
this point.

llvm-svn: 340905

5 years ago[llvm-mc] - Allow to set custom flags for debug sections.
George Rimar [Wed, 29 Aug 2018 08:42:02 +0000 (08:42 +0000)]
[llvm-mc] - Allow to set custom flags for debug sections.

I am experimenting with a single split dwarf (.dwo sections in .o files).
I want to make linker to ignore .dwo sections in .o, for that I am trying to add
SHF_EXCLUDE flag ("E") for them in my asm sample.

I found that currently, it is impossible to add any flag for debug sections using llvm-mc.

That happens because we have a set of predefined unique sections created early with default flags:
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCObjectFileInfo.cpp#L391

This patch allows a user to add any flags he wants.

I had to edit TargetLoweringObjectFileImpl.cpp to set MetaData type for debug sections.
Their kind was Data by default (so they were allocatable) and so after changes introduced by
this patch the SHF_ALLOC flag was applied for them, what does not make sense for debug sections.
One of OrcJITTests tests failed because of that.

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

llvm-svn: 340904

5 years agoAMDGPU: Fix getInstSizeInBytes
Nicolai Haehnle [Wed, 29 Aug 2018 07:46:09 +0000 (07:46 +0000)]
AMDGPU: Fix getInstSizeInBytes

Summary:
Add some optional code to validate getInstSizeInBytes for emitted
instructions. This flushed out some issues which are fixed by this
patch:

- Streamline getInstSizeInBytes
- Properly define the VI readlane/writelane instruction as VOP3
- Fix the inline constant determination. Specifically, this change
  fixes an issue where a 32-bit value of 0xffffffff was recorded
  as unsigned. This is equal to -1 when restricting to a 32-bit
  comparison, and an inline constant can be used.

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

Change-Id: Id87c3b7975839da0de8156a124b0ce98c5fb47f2
llvm-svn: 340903

5 years agoAlways add a .note.GNU-stack section if -r.
Rui Ueyama [Wed, 29 Aug 2018 07:27:09 +0000 (07:27 +0000)]
Always add a .note.GNU-stack section if -r.

With this patch, lld creates a .note.GNU_stack and adds that to an
output file if it is creating a re-linkable object file (i.e. if -r
is given). If we don't do this, and if you use GNU linkers as a final
linker, they create an executable whose stack area is executable,
which is considered pretty bad these days.

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

llvm-svn: 340902

5 years ago[PDB] Resolve a symbol context block info correctly
Aleksandr Urakov [Wed, 29 Aug 2018 07:26:11 +0000 (07:26 +0000)]
[PDB] Resolve a symbol context block info correctly

Summary:
This patch allows to resolve a symbol context block info even if a function
info was not requested. Also it adds the correct resolving of nested blocks
(the previous implementation used function blocks instead of them).

Reviewers: zturner, asmith, labath

Reviewed By: asmith

Subscribers: lldb-commits, stella.stamenova

Tags: #lldb

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

llvm-svn: 340901

5 years agoLoopSink: Don't sink into blocks without an insertion point (PR38462)
Hans Wennborg [Wed, 29 Aug 2018 06:55:27 +0000 (06:55 +0000)]
LoopSink: Don't sink into blocks without an insertion point (PR38462)

In the PR, LoopSink was trying to sink into a catchswitch block, which
doesn't have a valid insertion point.

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

llvm-svn: 340900

5 years ago[SelectionDAG] Remove masked_gather/scatter from TargetSelectionDAG.td.
Craig Topper [Wed, 29 Aug 2018 04:45:33 +0000 (04:45 +0000)]
[SelectionDAG] Remove masked_gather/scatter from TargetSelectionDAG.td.

These aren't used in tree and the number of operands in the type profile is wrong. X86 uses its own ISD opcode and type profile after op legalization.

llvm-svn: 340899

5 years ago[SelectionDAG] Add some comments to ISDOpcodes.h about the operands of MLOAD, MSTORE...
Craig Topper [Wed, 29 Aug 2018 04:45:32 +0000 (04:45 +0000)]
[SelectionDAG] Add some comments to ISDOpcodes.h about the operands of MLOAD, MSTORE, MGATHER, MSCATTER. NFC

llvm-svn: 340898

5 years agoAdd support for various C++14 demanglings.
Zachary Turner [Wed, 29 Aug 2018 04:12:44 +0000 (04:12 +0000)]
Add support for various C++14 demanglings.

Mostly this includes <auto> and <decltype-auto> return values.
Additionally, this fixes a fairly obscure back-referencing bug
that was encountered in one of the C++14 tests, which is that
if you have something like Foo<&bar, &bar> then the `bar`
forms a backreference.

llvm-svn: 340896

5 years ago[MS Demangler] Add output flags to all function calls.
Zachary Turner [Wed, 29 Aug 2018 03:59:17 +0000 (03:59 +0000)]
[MS Demangler] Add output flags to all function calls.

Previously we had a FunctionSigFlags, but it's more flexible
to just have one set of output flags that apply to the entire
process and just pipe the entire set of flags through the
output process.

This will be useful when we start allowing the user to customize
the outputting behavior.

llvm-svn: 340894

5 years agoNFC. fixing time-passes test failure on Windows.
Fedor Sergeev [Wed, 29 Aug 2018 03:53:30 +0000 (03:53 +0000)]
NFC. fixing time-passes test failure on Windows.

llvm-svn: 340893

5 years ago[GISel]: Add legalization support for Widening UADDO/USUBO
Aditya Nandakumar [Wed, 29 Aug 2018 03:17:08 +0000 (03:17 +0000)]
[GISel]: Add legalization support for Widening UADDO/USUBO

https://reviews.llvm.org/D51384

Added code in LegalizerHelper to widen UADDO/USUBO along with unit
tests.

Reviewed by volkan.

llvm-svn: 340892

5 years ago[X86] Support v2i32 gather/scatter indices with -x86-experimental-vector-widening...
Craig Topper [Wed, 29 Aug 2018 02:12:49 +0000 (02:12 +0000)]
[X86] Support v2i32 gather/scatter indices with -x86-experimental-vector-widening-legalization

Summary: This is split out from D41062 to cover the code in LegalVectorTypes.cpp

Reviewers: RKSimon, spatel, efriedma

Reviewed By: efriedma

Subscribers: sdardis, jvesely, nhaehnle, jrtc27, atanasyan, llvm-commits

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

llvm-svn: 340891

5 years ago[ELF] Change llvm-objdump -D to -d for check lines that only inspect text sections
Fangrui Song [Wed, 29 Aug 2018 02:07:58 +0000 (02:07 +0000)]
[ELF] Change llvm-objdump -D to -d for check lines that only inspect text sections

Reviewers: ruiu, sfertile, syzaara, espindola

Subscribers: emaste, nemanjai, arichardson, kbarton, llvm-commits

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

llvm-svn: 340890

5 years agoStart reserving x18 by default on Android targets.
Peter Collingbourne [Wed, 29 Aug 2018 01:38:47 +0000 (01:38 +0000)]
Start reserving x18 by default on Android targets.

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

llvm-svn: 340889

5 years ago[llvm-mca] Remove unused formal. NFC.
Matt Davis [Wed, 29 Aug 2018 00:41:04 +0000 (00:41 +0000)]
[llvm-mca] Remove unused formal. NFC.

llvm-svn: 340888

5 years ago[llvm-mca] Move the initialization of Pipeline. NFC.
Matt Davis [Wed, 29 Aug 2018 00:34:32 +0000 (00:34 +0000)]
[llvm-mca] Move the initialization of Pipeline. NFC.

Code cleanup to make the pipeline creation routine easier to read.

llvm-svn: 340887

5 years ago[sanitizer] fix a test
Kostya Serebryany [Tue, 28 Aug 2018 23:50:59 +0000 (23:50 +0000)]
[sanitizer] fix a test

llvm-svn: 340886

5 years ago[LLDB] Fix script to work with GNU sed
Shoaib Meenai [Tue, 28 Aug 2018 23:47:22 +0000 (23:47 +0000)]
[LLDB] Fix script to work with GNU sed

GNU sed and BSD sed have a different command-line syntax for in-place
editing, and the current form of the script would only work with BSD
sed. The easiest way to get cross-platform behavior is to specify a
backup suffix and then just delete the backup file at the end. (BSD sed
is the default on macOS, but it's possible to acquire GNU coreutils and
have your `sed` be GNU sed even on macOS; I'm aware it's not officially
supported in any capacity, but it's easy enough to support here.)

An alternative would be using `perl -p -i -e` instead of `sed -i`, but I
figured it was best to make the minimal working change.

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

llvm-svn: 340885

5 years agoAdd a RingBuffer class to sanitizer_common
Kostya Serebryany [Tue, 28 Aug 2018 23:32:56 +0000 (23:32 +0000)]
Add a RingBuffer class to sanitizer_common

Summary: a constrained RingBuffer optimized for fast push

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: kubamracek, mgorny, delcypher, #sanitizers, llvm-commits

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

llvm-svn: 340884

5 years ago[codeview] Clean up machinery for deferring .cv_loc emission
Reid Kleckner [Tue, 28 Aug 2018 23:25:59 +0000 (23:25 +0000)]
[codeview] Clean up machinery for deferring .cv_loc emission

Now that we create the label at the point of the directive, we don't
need to set the "current CV location", and then later when we emit the
next instruction, create a label for it and emit it.

DWARF still defers the labels used in .debug_loc until the next
instruction or value, for reasons unknown.

llvm-svn: 340883

5 years ago[QTOOL-37352] Consider isLegalAddressingImm in Constant Hoisting
Zhaoshi Zheng [Tue, 28 Aug 2018 23:00:59 +0000 (23:00 +0000)]
[QTOOL-37352] Consider isLegalAddressingImm in Constant Hoisting

In Thumb1, legal imm range is [0, 255] for ADD/SUB instructions. However, the
legal imm range for LD/ST in (R+Imm) addressing mode is [0, 127]. Imms in
[128, 255] are materialized by mov R, #imm, and LD/STs use them in (R+R)
addressing mode.

This patch checks if a constant is used as offset in (R+Imm), if so, it checks
isLegalAddressingMode passing the constant value as BaseOffset.

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

llvm-svn: 340882

5 years ago[ORC] Add a testcase for r338975.
Lang Hames [Tue, 28 Aug 2018 22:50:59 +0000 (22:50 +0000)]
[ORC] Add a testcase for r338975.

Tests that bad object files generate a predictable error from the JIT APIs.

llvm-svn: 340881

5 years agoAllow IRInterpreter to deal with non-power-of-2 sized types to support some bitfield...
Frederic Riss [Tue, 28 Aug 2018 22:50:01 +0000 (22:50 +0000)]
Allow IRInterpreter to deal with non-power-of-2 sized types to support some bitfield accesses.

Summary:
For some bitfield patterns (like the one added by this commit), Clang will
generate non-regular data types like i24 or i48. This patch follows a
pretty naive approach of just bumping the type size to the next power of 2.
DataExtractor know how to deal with weird sizes. The operations on Scalar
do not know how to deal with those types though, so we have to legalize the
size when creating a Scalar.

Reviewers: jingham, clayborg

Subscribers: lldb-commits

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

llvm-svn: 340880

5 years ago[X86] Add kadd intrinsics to match gcc and icc.
Craig Topper [Tue, 28 Aug 2018 22:32:14 +0000 (22:32 +0000)]
[X86] Add kadd intrinsics to match gcc and icc.

This adds the following intrinsics:
_kadd_mask64
_kadd_mask32
_kadd_mask16
_kadd_mask8

These are missing from the Intel Intrinsics Guide, but are implemented by both gcc and icc.

llvm-svn: 340879

5 years ago[codeview] Emit labels for .cv_loc immediately
Reid Kleckner [Tue, 28 Aug 2018 22:29:12 +0000 (22:29 +0000)]
[codeview] Emit labels for .cv_loc immediately

Previously we followed the DWARF implementation, which waits until the
next instruction or data to emit the label to use in the .debug_loc
section. We might want to consider re-evaluating that design choice as
well, since it means the .loc skips alignment padding, for better or
worse.

This was the most minimal fix I could come up with, but we should be
able to do a lot of cleanups now that we don't need to save a pending CV
location on the CodeViewContext. I plan to do those next, but this
immediately fixes an assertion for some of our users.

llvm-svn: 340878

5 years agoRemove unnecessary entitlement in debugserver for iOS.
Jason Molenda [Tue, 28 Aug 2018 22:28:34 +0000 (22:28 +0000)]
Remove unnecessary entitlement in debugserver for iOS.
<rdar://problem/43631901>

llvm-svn: 340877

5 years ago[lldb] Fix lldb build on musl
Raphael Isemann [Tue, 28 Aug 2018 22:17:28 +0000 (22:17 +0000)]
[lldb] Fix lldb build on musl

Summary: limits.h is needed for getting PATH_MAX definition, this comes to fore
with musl libc where limits.h is not included indirectly via other system headers.

Patch by Khem Raj, thanks!

Reviewers: compnerd

Reviewed By: compnerd

Subscribers: llvm-commits

Tags: #lldb

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

llvm-svn: 340876

5 years ago[X86] Remove GCCBuiltin from kadd intrinsics.
Craig Topper [Tue, 28 Aug 2018 22:05:55 +0000 (22:05 +0000)]
[X86] Remove GCCBuiltin from kadd intrinsics.

We need to custom handle it in clang so we can bit cast to the mask type.

llvm-svn: 340875

5 years ago[ORC] Replace lookupFlags in JITSymbolResolver with getResponsibilitySet.
Lang Hames [Tue, 28 Aug 2018 21:18:05 +0000 (21:18 +0000)]
[ORC] Replace lookupFlags in JITSymbolResolver with getResponsibilitySet.

The new method name/behavior more closely models the way it was being used.
It also fixes an assertion that can occur when using the new ORC Core APIs,
where flags alone don't necessarily provide enough context to decide whether
the caller is responsible for materializing a given symbol (which was always
the reason this API existed).

The default implementation of getResponsibilitySet uses lookupFlags to determine
responsibility as before, so existing JITSymbolResolvers should continue to
work.

llvm-svn: 340874

5 years ago[HIP] Fix output file extension
Yaxun Liu [Tue, 28 Aug 2018 21:09:09 +0000 (21:09 +0000)]
[HIP] Fix output file extension

OffloadBundlingJobAction constructor accepts a list of JobAction as inputs.
The host JobAction is the last one. The file type of OffloadBundlingJobAction
should be determined by the host JobAction (the last one) instead of the first
one.

Since HIP emits LLVM bitcode for device compilation, device JobAction has
different file type as host Job Action. This bug causes incorrect output file
extension for HIP.

This patch fixes it by using the last input JobAction (host JobAction) to determine
file type of OffloadBundlingJobAction.

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

llvm-svn: 340873

5 years ago[NFC][PassTiming] factor out generic PassTimingInfo
Fedor Sergeev [Tue, 28 Aug 2018 21:06:51 +0000 (21:06 +0000)]
[NFC][PassTiming] factor out generic PassTimingInfo

Moving PassTimingInfo from legacy pass manager code into a separate header.
Making it suitable for both legacy and new pass manager.
Adding a test on -time-passes main functionality.

llvm-svn: 340872

5 years ago[SimpleLoopUnswitch] Form dedicated exits after trivial unswitches.
Alina Sbirlea [Tue, 28 Aug 2018 20:41:05 +0000 (20:41 +0000)]
[SimpleLoopUnswitch] Form dedicated exits after trivial unswitches.

Summary:
Form dedicated exits after trivial unswitches.
Fixes PR38737, PR38283.

Reviewers: chandlerc, fedor.sergeev

Subscribers: sanjoy, jlebar, uabelho, llvm-commits

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

llvm-svn: 340871

5 years ago[ORC] Add an addObjectFile method to LLJIT.
Lang Hames [Tue, 28 Aug 2018 20:20:31 +0000 (20:20 +0000)]
[ORC] Add an addObjectFile method to LLJIT.

The addObjectFile method adds the given object file to the JIT session, making
its code available for execution.

Support for the -extra-object flag is added to lli when operating in
-jit-kind=orc-lazy mode to support testing of this feature.

llvm-svn: 340870