platform/upstream/llvm.git
4 years agoGlobalISel: Fix lower bswap for vectors
Matt Arsenault [Fri, 14 Feb 2020 16:51:57 +0000 (11:51 -0500)]
GlobalISel: Fix lower bswap for vectors

This would hit an assertion from trying to use the wrong bitwidth for
the constants.

4 years ago[PowerPC] Disable sanitizer test due to failures when using LLD
Nemanja Ivanovic [Mon, 16 Mar 2020 17:26:51 +0000 (12:26 -0500)]
[PowerPC] Disable sanitizer test due to failures when using LLD

This test case fails due to different handling of weak items between
LLD and LD on PPC. The issue only occurs when the default linker is LLD
and the test case is run on a system where ASLR is enabled.

4 years agoAMDGPU/GlobalISel: Fix handling of G_ANYEXT with s1 source
Matt Arsenault [Thu, 20 Feb 2020 22:01:45 +0000 (17:01 -0500)]
AMDGPU/GlobalISel: Fix handling of G_ANYEXT with s1 source

We were letting G_ANYEXT with a vcc register bank through, which was
incorrect and would select to an invalid copy. Fix this up like G_ZEXT
and G_SEXT. Also drop old code to fixup the non-boolean case in
RegBankSelect. We now have to perform that expansion during selection,
so there's no benefit to doing it during RegBankSelect.

4 years agoAMDGPU/GlobalISel: Fix some illegal scalar argument types
Matt Arsenault [Mon, 24 Feb 2020 21:38:59 +0000 (16:38 -0500)]
AMDGPU/GlobalISel: Fix some illegal scalar argument types

Fixes integers that don't evenly divide to i32 pieces. We should
probably extract some of the code in the legalizer to start handling
argument breakdowns. I'm dissatisfied with the argument lowering's
handling of vectors for example, and we should not be producing the
weird G_EXTRACTs we do now.

4 years agoImplement _LIBCPP_SUPPRESS_DEPRECATED_XXX when testing MSVC's STL
Casey Carter [Mon, 16 Mar 2020 16:50:23 +0000 (09:50 -0700)]
Implement _LIBCPP_SUPPRESS_DEPRECATED_XXX when testing MSVC's STL

...to properly silence clang deprecation warnings in `test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp`.

4 years ago[DexTer] Add step.UNKNOWN check for NoneType line numbers.
Tom Weaver [Mon, 16 Mar 2020 16:38:41 +0000 (16:38 +0000)]
[DexTer] Add step.UNKNOWN check for NoneType line numbers.

Summary: It's possible for an instance of the visual studio debugger
to return a NoneType line number location when stepping during a
debugging session.

This patches teaches DexTer how to handle this particular case without
crashing out.

Reviewers: Orlando

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

4 years agoMinor fix to a comment in CodeGenPrepare.cpp
Juneyoung Lee [Mon, 16 Mar 2020 16:10:02 +0000 (01:10 +0900)]
Minor fix to a comment in CodeGenPrepare.cpp

4 years agoAMDGPU: Drop special case f64 fround lowering
Matt Arsenault [Tue, 24 Dec 2019 16:22:18 +0000 (11:22 -0500)]
AMDGPU: Drop special case f64 fround lowering

The result is better if ftrunc is emitted and separately legalized
when unavailable.

4 years ago[AST] Correct the CXXOperatorCallExpr source range.
Haojian Wu [Mon, 16 Mar 2020 15:37:19 +0000 (16:37 +0100)]
[AST] Correct the CXXOperatorCallExpr source range.

Summary:
Previously, the range for "->" CXXOperatorCallExpr is the range of the
class object (not including the operator!), e.g. "[[vector_ptr]]->size()".

This patch includes the range of the operator, which fixes the issue
where clangd doesn't go to the overloaded operator "->" definition.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years agoRevert "[AST] Move dependence computations into a separate file"
Haojian Wu [Mon, 16 Mar 2020 15:49:38 +0000 (16:49 +0100)]
Revert "[AST] Move dependence computations into a separate file"

This reverts commit ddd20ed1586c55947e84620d674a60c118ec6905.
The patch was landed by accident.

4 years ago[AST] Move dependence computations into a separate file
Ilya Biryukov [Mon, 27 Jan 2020 13:54:11 +0000 (14:54 +0100)]
[AST] Move dependence computations into a separate file

To group the code in one place, simplify it and make it easier to add
the containsErrors bit and find existing bugs.

4 years ago[lldb/Reproducers] Decode run-length encoding in GDB replay server.
Jonas Devlieghere [Mon, 16 Mar 2020 15:34:51 +0000 (08:34 -0700)]
[lldb/Reproducers] Decode run-length encoding in GDB replay server.

The GDB replay server sanity-checks that every packet it receives
matches what it expects from the serialized packet log. This mechanism
tripped for TestReproducerAttach.py on Linux, because one of the packets
(jModulesInfo) uses run-length encoding. The replay server was comparing
the expanded incoming packet with the unexpanded packet in the log. As a
result, it claimed to have received an unexpected packet, which caused
the test to fail.

This patch addresses that issue by expanding the run-length encoding
before comparing the packets.

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

4 years agoGlobalISel: Fix round lowering
Matt Arsenault [Sat, 14 Mar 2020 18:52:48 +0000 (14:52 -0400)]
GlobalISel: Fix round lowering

I used the implementation for floor instead of round. It also turns
out the OpenCL builtin library wasn't using the round builtin, but
implemented the expanded form.

4 years agoRevert "[gn build] (manually) port 8b409eaba"
Nico Weber [Mon, 16 Mar 2020 15:33:03 +0000 (11:33 -0400)]
Revert "[gn build] (manually) port 8b409eaba"

This reverts commit 85462aefb527eaa4a6a7563f9341ceab283cdf1f
and follow-up 8d6582aa6bbd952744abd1f3cb74065f96535169.

8b409eaba was reverted.

4 years ago[lldb] Re-add nullptr check to IRForTarget::RewriteObjCConstString log statement
Raphael Isemann [Mon, 16 Mar 2020 15:21:32 +0000 (16:21 +0100)]
[lldb] Re-add nullptr check to IRForTarget::RewriteObjCConstString log statement

The nullptr check here was removed in 4ef50a33b12825593a82ca8ea97158b7b71b348e
when I replaced (nearly) all log->Print to LLDB_LOG calls (which automatically
check for this stuff). But it seems this one call escaped my sed call.

Currently working on a test that can cover this code path but we can revert
this until I have found one.

4 years ago[GlobalISel] add additional lowering support for G_INSERT
Dominik Montada [Wed, 11 Mar 2020 11:18:59 +0000 (12:18 +0100)]
[GlobalISel] add additional lowering support for G_INSERT

Summary: Add lowering support for inserting pointers or scalars into scalars, vectors or pointers

Reviewers: arsenm, dsanders

Reviewed By: arsenm

Subscribers: jvesely, wdng, nhaehnle, rovka, hiraditya, volkan, kerbowa, llvm-commits

Tags: #llvm

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

4 years agoRevert "[SVE] Auto-generate builtins and header for svld1."
Sander de Smalen [Mon, 16 Mar 2020 15:22:15 +0000 (15:22 +0000)]
Revert "[SVE] Auto-generate builtins and header for svld1."

This reverts commit 8b409eabaf755c88a7d652fe99d3ad858a4fe82a.

Reverting this patch for now because it breaks some buildbots.

4 years agoFix typo in parameter name.
Adrian Prantl [Mon, 16 Mar 2020 15:05:46 +0000 (08:05 -0700)]
Fix typo in parameter name.

4 years agoRevert "Disable memcpy-inline-fails.ll for windows"
Guillaume Chatelet [Mon, 16 Mar 2020 15:03:39 +0000 (16:03 +0100)]
Revert "Disable memcpy-inline-fails.ll for windows"

This reverts commit adc2e250a1ca2089f870a7239231f4c8cec16546.

4 years agoAMDGPU/GlobalISel: Make some large merges legal
Matt Arsenault [Mon, 16 Mar 2020 14:42:15 +0000 (10:42 -0400)]
AMDGPU/GlobalISel: Make some large merges legal

We allow up to 1024-bit registers, so we should support merges all the
way to the maximum.

4 years ago[Object] Change ELFObjectFile<ELFT>::getFileFormatName() to use BFD names
Fangrui Song [Thu, 12 Mar 2020 05:00:19 +0000 (22:00 -0700)]
[Object] Change ELFObjectFile<ELFT>::getFileFormatName() to use BFD names

Follow-up for D74433

What the function returns are almost standard BFD names, except that "ELF" is
in uppercase instead of lowercase.

This patch changes "ELF" to "elf" and changes ARM/AArch64 to use their BFD names.
MIPS and PPC64 have endianness differences as well, but this patch does not intend to address them.

Advantages:

* llvm-objdump: the "file format " line matches GNU objdump on ARM/AArch64 objects
* "file format " line can be extracted and fed into llvm-objcopy -O literally.
  (https://github.com/ClangBuiltLinux/linux/issues/779 has such a use case)

Affected tools: llvm-readobj, llvm-objdump, llvm-dwarfdump, MCJIT (internal implementation detail, not exposed)

Reviewed By: jhenderson

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

4 years ago[gn build] Port f62b898c1f5
LLVM GN Syncbot [Mon, 16 Mar 2020 13:54:40 +0000 (13:54 +0000)]
[gn build] Port f62b898c1f5

4 years ago[gn build] (manually) port 8b409eaba more
Nico Weber [Mon, 16 Mar 2020 13:52:47 +0000 (09:52 -0400)]
[gn build] (manually) port 8b409eaba more

4 years ago[TargetLowering] Only demand a funnelshift's modulo amount bits
Simon Pilgrim [Mon, 16 Mar 2020 13:46:28 +0000 (13:46 +0000)]
[TargetLowering] Only demand a funnelshift's modulo amount bits

ISD::FSHL/FSHR shift amount values are guaranteed to act as a modulo amount, so for power-of-2 bitwidths we only need the lowest bits.

4 years ago[gn build] (manually) port 8b409eaba
Nico Weber [Mon, 16 Mar 2020 13:46:01 +0000 (09:46 -0400)]
[gn build] (manually) port 8b409eaba

4 years ago[GlobalISel] combine G_TRUNC with G_MERGE_VALUES
Dominik Montada [Mon, 9 Mar 2020 16:00:38 +0000 (17:00 +0100)]
[GlobalISel] combine G_TRUNC with G_MERGE_VALUES

Summary:
Truncating the result of a merge means that most likely we could have done without merge in the first place and just used the input merge inputs directly. This can be done in three cases:

1. If the truncation result is smaller than the merge source, we can use the source in the trunc directly
2. If the sizes are the same, we can replace the register or use a copy
3. If the truncation size is a multiple of the merge source size, we can build a smaller merge

This gets rid of most of the larger, hard-to-legalize merges.

Reviewers: qcolombet, aditya_nandakumar, aemerson, paquette, arsenm, Petar.Avramovic

Reviewed By: arsenm

Subscribers: sdardis, jvesely, wdng, nhaehnle, rovka, jrtc27, atanasyan, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[ExpandMemCmp] Correctly set alignment of generated loads
Juneyoung Lee [Mon, 16 Mar 2020 13:38:29 +0000 (22:38 +0900)]
[ExpandMemCmp] Correctly set alignment of generated loads

Summary:
This is a part of the series of efforts for correcting alignment of memory operations.
(Another related bugs: https://bugs.llvm.org/show_bug.cgi?id=44388 , https://bugs.llvm.org/show_bug.cgi?id=44543 )

This fixes https://bugs.llvm.org/show_bug.cgi?id=43880 by giving default alignment of loads to 1.

The test CodeGen/AArch64/bcmp-inline-small.ll should have been changed; it was introduced by https://reviews.llvm.org/D64805 . I talked with @evandro, and confirmed that the test is okay to be changed.
Other two tests from PowerPC needed changes as well, but fixes were straightforward.

Reviewers: courbet

Reviewed By: courbet

Subscribers: nlopes, gchatelet, wuzish, nemanjai, kristof.beyls, hiraditya, steven.zhang, danielkiss, llvm-commits, evandro

Tags: #llvm

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

4 years ago[lldb] Remove unimplemented StackFrame::BehavesLikeZerothFrame
Tatyana Krasnukha [Mon, 16 Mar 2020 13:19:22 +0000 (16:19 +0300)]
[lldb] Remove unimplemented StackFrame::BehavesLikeZerothFrame

Commit [1] added a declaration of function-member
StackFrame::BehavesLikeZerothFrame but hasn't added an implementation
for the function. This commit removes this declation, because the
function is not used anywhere.

[1] 31e6dbe1c6a6 Fix PC adjustment in StackFrame::GetSymbolContext

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

Patch by Anton Kolesov <Anton.Kolesov@synopsys.com>

4 years ago[lldb] Copy m_behaves_like_zeroth_frame on stack frame update
Tatyana Krasnukha [Mon, 16 Mar 2020 13:13:26 +0000 (16:13 +0300)]
[lldb] Copy m_behaves_like_zeroth_frame on stack frame update

Fix to code from https://reviews.llvm.org/D64993.

Field StackFrame::m_behaves_like_zeroth_frame was introduced in commit
[1], however that commit hasn't added a copying of the field to
UpdatePreviousFrameFromCurrentFrame, therefore the value wouldn't change
when updating frames to reflect the current situation.

The particular scenario, where this matters is following. Assume we have
function main that invokes function func1. We set breakpoint at
func1 entry and in main after the func1 call, and do not stop at
the main entry. Therefore, when debugger stops for the first time,
func1 is frame#0, while main is frame#1, thus
m_behaves_like_zeroth_frame is set to 0 for main frame. Execution is
resumed, and stops now in main, where it is now frame#0. However while
updating the frame object, m_behaves_like_zeroth_frame remains false.
This field plays an important role when calculating line information for
backtrace: for frame#0, PC is the current line, therefore line
information is retrieved for PC, however for all other frames this is
not the case - calculated PC is a return-PC, i.e. instruction after the
function call line, therefore for those frames LLDB needs to step back
by one instruction. Initial implementation did this strictly for frames
that have index != 0 (and index is updated properly in
UpdatePreviousFrameFromCurrentFrame), but m_behaves_like_zeroth_frame
added a capability for middle-of-stack frames to behave in a similar
manner. But because current code now doesn't check frame idx,
m_behaves_like_zeroth_frame must be set to true for frames with 0 index,
not only for frame that behave like one. In the described test case,
after stopping in main, LLDB would still consider frame#0 as
non-zeroth, and would subtract instruction from the PC, and would report
previous like as current line.

The error doesn't manifest itself in LLDB interpreter though - it can be
reproduced through LLDB-MI and when using SB API, but not when we
interpreter command "continue" is executed. Honestly, I didn't fully
understand why it works in interpreter, I did found that bug "fixes"
itself if I enable DEBUG_STACK_FRAMES in StackFrameList.cpp, because
that calls StackFrame::Dump and that calls
GetSymbolContext(eSymbolContextEverything), which fills the context of
frame on the first breakpoint, therefore it doesn't have to be
recalculated (improperly) on a second frame. However, on first
breakpoint symbol context is calculated for the "call" line, not the
next one, therefore it should be recalculated anyway on a second
breakpoint, and it is done correctly, even though
m_behaves_like_zeroth_frame is still incorrect, as long as
GetSymbolContext(eSymbolContextEverything) has been called.

[1] 31e6dbe1c6a6 Fix PC adjustment in StackFrame::GetSymbolContext

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

Patch by Anton Kolesov <Anton.Kolesov@synopsys.com>

4 years agoAdd tests to ExpandMemCmp/X86/memcmp.ll before submitting D76113
Juneyoung Lee [Mon, 16 Mar 2020 13:19:37 +0000 (22:19 +0900)]
Add tests to ExpandMemCmp/X86/memcmp.ll before submitting D76113

4 years agoDisable memcpy-inline-fails.ll for windows
Guillaume Chatelet [Mon, 16 Mar 2020 13:10:08 +0000 (14:10 +0100)]
Disable memcpy-inline-fails.ll for windows

4 years ago[yaml2obj][test] - Fix comments in ELF/program-header-address.yaml test. NFC.
Georgii Rymar [Mon, 16 Mar 2020 13:05:10 +0000 (16:05 +0300)]
[yaml2obj][test] - Fix comments in ELF/program-header-address.yaml test. NFC.

This addresses post-commit comments suggested by James Henderson for D76131.

4 years ago[NFC][TTI] Remove static_casts
Sam Parker [Mon, 16 Mar 2020 12:55:41 +0000 (12:55 +0000)]
[NFC][TTI] Remove static_casts

Introduce a variable for 'this' instead of calling static_cast
multiple times in TargetTransformInfoImpl.h

4 years ago[X86] X86::isConstantSplat - enable partial undef bit handling by default.
Simon Pilgrim [Mon, 16 Mar 2020 12:55:57 +0000 (12:55 +0000)]
[X86] X86::isConstantSplat - enable partial undef bit handling by default.

We currently only ever use this for lowering constant uniform values (shift/rotate by immediate) so we can safely enable it by default (it treats the undef bits as zero when extracting constants).

This is necessary for an upcoming patch that will use SimplifyDemandedBits more aggressively on funnel shift amounts and causes regressions in vXi64 constant without it.

4 years ago[X86] LowerRotate - use X86::isConstantSplat to detect constant splat rotation amounts.
Simon Pilgrim [Mon, 16 Mar 2020 11:44:03 +0000 (11:44 +0000)]
[X86] LowerRotate - use X86::isConstantSplat to detect constant splat rotation amounts.

Avoid code duplication and matches what we do for the similar LowerFunnelShift and LowerScalarImmediateShift methods.

4 years ago[AST] rename DependencyFlags.h => DependenceFlags.h, NFC
Haojian Wu [Mon, 16 Mar 2020 12:43:40 +0000 (13:43 +0100)]
[AST] rename DependencyFlags.h => DependenceFlags.h, NFC

We forgot to fix in the previous patch.

4 years ago[NFC][TTI] Use switch in getCastInstrCost
Sam Parker [Mon, 16 Mar 2020 12:48:12 +0000 (12:48 +0000)]
[NFC][TTI] Use switch in getCastInstrCost

Introduce a switch statement for trunc, bitcast, addrspacecast and
zext in BasicTTIImpl.

4 years agoDisable llvm-objdump --debug-vars tests on Windows
Oliver Stannard [Mon, 16 Mar 2020 12:48:13 +0000 (12:48 +0000)]
Disable llvm-objdump --debug-vars tests on Windows

These tests passed in my Windows 10 VM, but are failing on Windows bots
with errors which look related to unicode encodings. Disable the tests
on Windows for now.

4 years ago[lldb] Hardcode target in dwo-type-in-main-file.s test
Pavel Labath [Mon, 16 Mar 2020 12:21:21 +0000 (13:21 +0100)]
[lldb] Hardcode target in dwo-type-in-main-file.s test

4 years agoAdd AllowMissingMoveFunctionsWhenCopyIsDeleted flag to cppcoreguidelines-special...
Paweł Barań [Mon, 16 Mar 2020 12:13:40 +0000 (08:13 -0400)]
Add AllowMissingMoveFunctionsWhenCopyIsDeleted flag to cppcoreguidelines-special-member-functions

The flag allows classes to don't define move operations when copy operations
are explicitly deleted. This flag is related to Google C++ Style Guide
https://google.github.io/styleguide/cppguide.html#Copyable_Movable_Types

4 years ago[SystemZ] Avoid scalarization of [SU]INT_TO_FP ISD-nodes.
Jonas Paulsson [Sat, 14 Mar 2020 09:26:53 +0000 (10:26 +0100)]
[SystemZ]  Avoid scalarization of [SU]INT_TO_FP ISD-nodes.

The type legalizer will scalarize vector conversions from integer to floating
point if the source element size is less than that of the result.

This is avoided now by inserting a zero/sign-extension of the source vector
before type legalization.

Review: Ulrich Weigand

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

4 years agoDon't run PowerPC objdump tests when PowerPC backend not built
Oliver Stannard [Mon, 16 Mar 2020 12:00:12 +0000 (12:00 +0000)]
Don't run PowerPC objdump tests when PowerPC backend not built

4 years ago[llvm-objdump] Add llvm_unreachable to silence GCC warning. NFC.
Martin Storsjö [Mon, 16 Mar 2020 11:32:37 +0000 (13:32 +0200)]
[llvm-objdump] Add llvm_unreachable to silence GCC warning. NFC.

GCC 7 warned about control reaching the end of the non-void function,
despite all 7 LineChar values being handled in the switch.

4 years agoDon't run ARM objdump tests when ARM backend not built
Oliver Stannard [Mon, 16 Mar 2020 11:24:19 +0000 (11:24 +0000)]
Don't run ARM objdump tests when ARM backend not built

4 years ago[DebugInfo] Handle generic type DW_OP_convert ops in dsymutil
David Stenberg [Mon, 16 Mar 2020 10:47:53 +0000 (11:47 +0100)]
[DebugInfo] Handle generic type DW_OP_convert ops in dsymutil

Summary:
This is a preparatory change for allowing LLVM to emit DW_OP_convert
operations converting to the generic type.

If DW_OP_convert's operand is 0, it converts the top of the stack to the
generic type, as specified by DWARFv5 section 2.5.1.6:

"[...] takes one operand, which is an unsigned LEB128 integer that
 represents the offset of a debugging information entry in the current
 compilation unit, or value 0 which represents the generic type."

This adds support for such operations to dsymutil.

Reviewers: aprantl, markus, friss, JDevlieghere

Reviewed By: aprantl, JDevlieghere

Subscribers: hiraditya, llvm-commits

Tags: #debug-info, #llvm

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

4 years ago[lldb/DWARF] Fix crash when a dwo compile unit refers to a non-dwo type
Pavel Labath [Mon, 16 Mar 2020 11:11:09 +0000 (12:11 +0100)]
[lldb/DWARF] Fix crash when a dwo compile unit refers to a non-dwo type

In this case dwo_num can be None => stop assuming it can't.

4 years ago[llvm-objdump] Add entry_value and stack_value opcodes
Oliver Stannard [Wed, 19 Feb 2020 12:34:12 +0000 (12:34 +0000)]
[llvm-objdump] Add entry_value and stack_value opcodes

Add the DW_OP_entry_value and DW_OP_stack_value opcodes to the DWARF
expression printer.

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

4 years ago[llvm-objdump] Add simple memory expressions to variable display
Oliver Stannard [Wed, 19 Feb 2020 12:24:19 +0000 (12:24 +0000)]
[llvm-objdump] Add simple memory expressions to variable display

Add the DW_OP_breg0..DW_OP_breg31 and DW_OP_bregx opcodes to the DWARF
expression printer.

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

4 years ago[DebugInfo] Add unit test for compact expression printer
Oliver Stannard [Thu, 27 Feb 2020 10:39:14 +0000 (10:39 +0000)]
[DebugInfo] Add unit test for compact expression printer

Add a unit test for the compact DWARF expression printer which will be
used by the llvm-objdump --debug-vars option.

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

4 years ago[llvm-objdump] Display locations of variables alongside disassembly
Oliver Stannard [Mon, 9 Dec 2019 15:16:47 +0000 (15:16 +0000)]
[llvm-objdump] Display locations of variables alongside disassembly

This adds the --debug-vars option to llvm-objdump, which prints
locations (registers/memory) of source-level variables alongside the
disassembly based on DWARF info. A vertical line is printed for each
live-range, with a label at the top giving the variable name and
location, and the position and length of the line indicating the program
counter range in which it is valid.

Currently, this only works for object files, not executables or shared
libraries.

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

4 years ago[SVE] Auto-generate builtins and header for svld1.
Sander de Smalen [Mon, 16 Mar 2020 10:14:05 +0000 (10:14 +0000)]
[SVE] Auto-generate builtins and header for svld1.

This is a first patch in a series for the SveEmitter to generate the arm_sve.h
header file and builtins.

I've tried my best to strip down this patch as best as I could, but there
are still a few changes that are not necessarily exercised by the load intrinsics
in this patch, mostly around the SVEType class which has some common logic to
represent types from a type and prototype string. I thought it didn't make
much sense to remove that from this patch and split it up.

Reviewers: efriedma, rovka, SjoerdMeijer, rsandifo-arm, rengolin

Reviewed By: SjoerdMeijer

Tags: #clang

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

4 years ago[DebugInfo] Handle generic type DW_OP_convert ops in llvm-dwarfdump
David Stenberg [Mon, 16 Mar 2020 09:53:17 +0000 (10:53 +0100)]
[DebugInfo] Handle generic type DW_OP_convert ops in llvm-dwarfdump

Summary:
This is a preparatory change for allowing LLVM to emit DW_OP_convert
operations converting to the generic type.

If DW_OP_convert's operand is 0, it converts the top of stack to the
generic type, as specified by DWARFv5 section 2.5.1.6:

"[...] takes one operand, which is an unsigned LEB128 integer that
 represents the offset of a debugging information entry in the current
 compilation unit, or value 0 which represents the generic type."

This adds support for such operations to llvm-dwarfdump.

Reviewers: aprantl, markus, jdoerfert, jhenderson

Reviewed By: aprantl

Subscribers: hiraditya, llvm-commits

Tags: #debug-info, #llvm

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

4 years ago[NFC][MC] Rename alignBranches* to emitInstruction*
Shengchen Kan [Mon, 16 Mar 2020 08:52:31 +0000 (16:52 +0800)]
[NFC][MC] Rename alignBranches* to emitInstruction*

alignBranches is X86 specific, change the name in a
more general one since other target can do some state
chang before and after emitting the instruction.

4 years agoImplement CET Shadow Stack (Intel Controlflow Enforcement Technology) support on...
Rui Ueyama [Fri, 13 Mar 2020 10:41:18 +0000 (19:41 +0900)]
Implement CET Shadow Stack (Intel Controlflow Enforcement Technology) support on Windows

Patch by Petr Penzin.

Windows support for CET is limited to shadow stack, which is enabled
by setting a PE bit in the linker.

Docs:

MSVC linker flag:
https://docs.microsoft.com/en-us/cpp/build/reference/cetcompat?view=vs-2019

IMAGE_DLLCHARACTERISTICS_EX_CET_COMPAT PE bit:
https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#extended-dll-characteristics

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

4 years ago[obj2yaml][test] - Simplify call-graph-profile-section.yaml. NFCI.
Georgii Rymar [Mon, 16 Mar 2020 08:41:35 +0000 (11:41 +0300)]
[obj2yaml][test] - Simplify call-graph-profile-section.yaml. NFCI.

Use yaml2obj -D to simplify.
We started to use it for other tests recently.

4 years ago[NFC][X86] Simplify test cases for branch align
Shengchen Kan [Sat, 14 Mar 2020 22:09:04 +0000 (06:09 +0800)]
[NFC][X86] Simplify test cases for branch align

4 years ago[AVR] Add a release note about the AVR backend becoming an official backend
Dylan McKay [Mon, 16 Mar 2020 07:07:59 +0000 (20:07 +1300)]
[AVR] Add a release note about the AVR backend becoming an official backend

AVR has been enabled by default since
c480c584a0b7de675dddb2616122fc218cd72c0e, the tests have been stable for
a couple days now, revert extremely unlikely.

4 years ago[MIPS] Implement PUL.PS and PUU.PS instructions
Simon Atanasyan [Fri, 13 Mar 2020 16:15:55 +0000 (19:15 +0300)]
[MIPS] Implement PUL.PS and PUU.PS instructions

Patch by Michael Roe.

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

4 years ago[Verifier] Remove invalid verifier check
Serguei Katkov [Fri, 13 Mar 2020 04:06:13 +0000 (11:06 +0700)]
[Verifier] Remove invalid verifier check

According to LangRef for unordered atomic memory transfer intrinsics
"The first three arguments are the same as they are in the @llvm.memcpy intrinsic, with the added constraint that
 len is required to be a positive integer multiple of the element_size. If len is not a positive integer multiple
 of element_size, then the behaviour of the intrinsic is undefined."

So the len is not multiple of element size is just an undefined behavior and verifier should not complain about that
as undefined behavior is allowed in LLVM IR.

This change removes the verifier check for this condition

Reviewers: reames
Reviewed By: reames
Subscribers: dantrushin, hiraditya, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D76116

4 years ago[Coroutines] Do not evaluate InitListExpr of a co_return
Jun Ma [Fri, 13 Mar 2020 06:08:34 +0000 (14:08 +0800)]
[Coroutines] Do not evaluate InitListExpr of a co_return

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

4 years ago[analyzer] Fix modeling some library functions when UCHAR_MAX > INT_MAX.
Artem Dergachev [Mon, 16 Mar 2020 04:03:23 +0000 (07:03 +0300)]
[analyzer] Fix modeling some library functions when UCHAR_MAX > INT_MAX.

This makes life easier for downstream users who maintain exotic
target platforms.

Patch by Vince Bridgers!

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

4 years ago[debuginfo-tests] Update test for double-dash long-option.
Jonas Devlieghere [Mon, 16 Mar 2020 03:56:33 +0000 (20:56 -0700)]
[debuginfo-tests] Update test for double-dash long-option.

4 years ago[CodeGenPrepare] Freeze condition when transforming select to br
Juneyoung Lee [Sat, 14 Mar 2020 16:34:33 +0000 (01:34 +0900)]
[CodeGenPrepare] Freeze condition when transforming select to br

Summary:
This is a simple fix for CodeGenPrepare that freezes branch condition when transforming select to branch.
If it is not frozen, instsimplify or the later pipeline can potentially exploit undefined behavior.

The diff shows optimized form becase D75859 and D76048 already made a few changes to CodeGenPrepare for optimizing freeze(cmp).

Reviewers: jdoerfert, spatel, lebedev.ri, efriedma

Reviewed By: lebedev.ri

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoRevert "[CodeGenPrepare] Freeze condition when transforming select to br"
Juneyoung Lee [Mon, 16 Mar 2020 03:45:54 +0000 (12:45 +0900)]
Revert "[CodeGenPrepare] Freeze condition when transforming select to br"

This reverts commit 10aa7ea951e22dbd7f2ebdeb6410cfbc8a251eb1.

4 years ago[lldb/Process] Include Unwind.h in FreeBSDThread
Jonas Devlieghere [Mon, 16 Mar 2020 03:38:40 +0000 (20:38 -0700)]
[lldb/Process] Include Unwind.h in FreeBSDThread

Fixes member access into incomplete type 'lldb_private::Unwind'. Thank
you to Paulf for pointing this out.

4 years ago[lldb/Host] s/FindProcesses/FindProcessesImpl/ in freebsd/Host.cpp
Jonas Devlieghere [Mon, 16 Mar 2020 03:36:40 +0000 (20:36 -0700)]
[lldb/Host] s/FindProcesses/FindProcessesImpl/ in freebsd/Host.cpp

Fix the FreeBSD build. Thank you to Paulf for pointing this out.

4 years ago[lldb/Utils] Use PYTHON_EXECUTABLE to configure lldb-dotest's shebang
Jonas Devlieghere [Fri, 13 Mar 2020 23:40:02 +0000 (16:40 -0700)]
[lldb/Utils] Use PYTHON_EXECUTABLE to configure lldb-dotest's shebang

Ideally we'd want all shebangs to be configurable, but that's not a
viable solution. Given that lldb-dotest is already configured, we might
as well make sure it uses the correct interpreter.

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

4 years ago[MLIR] fix parse bound error message
Uday Bondhugula [Mon, 16 Mar 2020 02:56:30 +0000 (02:56 +0000)]
[MLIR] fix parse bound error message

- fix parse error message for affine for op's bounds

Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D76198

4 years agoSupport prefix padding for alignment purposes (Relaxable instructions only)
Philip Reames [Mon, 16 Mar 2020 01:10:50 +0000 (18:10 -0700)]
Support prefix padding for alignment purposes (Relaxable instructions only)

Now that D75203 has landed and baked for a few days, extend the basic approach to prefix padding as well. The patch itself is fairly straight forward.

For the moment, this patch adds the functional support and some basic testing there of, but defaults to not enabling prefix padding. I want to be able to phrase a separate patch which adds the target specific reasoning and test it cleanly. I haven't decided whether I want to common it with the nop logic or not.

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

4 years ago[NFC][Test] Add three tests to verify the behavior of a*b-c*d if there is multi-uses
QingShan Zhang [Mon, 16 Mar 2020 01:58:49 +0000 (01:58 +0000)]
[NFC][Test] Add three tests to verify the behavior of a*b-c*d if there is multi-uses

4 years ago[llvm-objdump] Require long options to use double-dash --long-option
Fangrui Song [Sun, 15 Mar 2020 23:47:49 +0000 (16:47 -0700)]
[llvm-objdump] Require long options to use double-dash --long-option

As announced here: http://lists.llvm.org/pipermail/llvm-dev/2019-April/131786.html

4 years ago[test] lld/test/: change llvm-objdump single-dash long options to double-dash options
Fangrui Song [Mon, 16 Mar 2020 00:47:44 +0000 (17:47 -0700)]
[test] lld/test/: change llvm-objdump single-dash long options to double-dash options

4 years ago[test] llvm/test/: change llvm-objdump single-dash long options to double-dash options
Fangrui Song [Sun, 15 Mar 2020 23:17:52 +0000 (16:17 -0700)]
[test] llvm/test/: change llvm-objdump single-dash long options to double-dash options

As announced here: http://lists.llvm.org/pipermail/llvm-dev/2019-April/131786.html

Grouped option syntax (POSIX Utility Conventions) does not play well with -long-option
A subsequent change will reject -long-option.

4 years ago[X86] Add a non-zero cost for truncating v32i16->v32i8 on avx512bw.
Craig Topper [Mon, 16 Mar 2020 00:18:46 +0000 (17:18 -0700)]
[X86] Add a non-zero cost for truncating v32i16->v32i8 on avx512bw.

4 years ago[compiler-rt] [netbsd] Add support for the MKIPFILTER=no distribution
Kamil Rytarowski [Sun, 15 Mar 2020 23:39:02 +0000 (00:39 +0100)]
[compiler-rt] [netbsd] Add support for the MKIPFILTER=no distribution

Add fallback definition for the IPFilter ioctl commands.

4 years ago[llvm-objdump][test] Change llvm-objdump tests to use double dash options
Fangrui Song [Sun, 15 Mar 2020 22:30:18 +0000 (15:30 -0700)]
[llvm-objdump][test] Change llvm-objdump tests to use double dash options

4 years agoRevert "[ORC] Enable JITEventListeners in the RTDyldObjectLinkingLayer."
Lang Hames [Sun, 15 Mar 2020 22:34:37 +0000 (15:34 -0700)]
Revert "[ORC] Enable JITEventListeners in the RTDyldObjectLinkingLayer."

This reverts commit 98f2bb4461072347dcca7d2b1b9571b3a6525801.

Reverting while I investigate bot failures.

4 years ago[gn build] don't repeat arm header targets twice. no behavior change.
Nico Weber [Sun, 15 Mar 2020 22:20:17 +0000 (18:20 -0400)]
[gn build] don't repeat arm header targets twice. no behavior change.

4 years ago[llvm-objdump][test] Move {AArch64,ARM}/* to ELF/ARM/ or MachO/ARM/ and {AMDGPU,Hexag...
Fangrui Song [Sun, 15 Mar 2020 22:07:25 +0000 (15:07 -0700)]
[llvm-objdump][test] Move {AArch64,ARM}/* to ELF/ARM/ or MachO/ARM/ and {AMDGPU,Hexagon,Mips,powerPC}/ to ELF/

4 years ago[ORC] Enable JITEventListeners in the RTDyldObjectLinkingLayer.
Lang Hames [Mon, 9 Mar 2020 06:00:48 +0000 (23:00 -0700)]
[ORC] Enable JITEventListeners in the RTDyldObjectLinkingLayer.

Enable use of ExecutionEngine JITEventListeners in RTDyldObjectLinkingLayer.
This allows existing MCJIT clients to more easily migrate to LLJIT / ORCv2.

Example usage in llvm/examples/OrcV2Examples/LLJITWithGDBRegistrationListener.

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

4 years ago[llvm-objdump][test] Move {AArch64,X86}/macho-* to MachO/
Fangrui Song [Sun, 15 Mar 2020 21:51:33 +0000 (14:51 -0700)]
[llvm-objdump][test] Move {AArch64,X86}/macho-* to MachO/

4 years agoAMDGPU/GlobalISel: Remove -global-isel-abort=0 from some tests
Matt Arsenault [Sun, 15 Mar 2020 20:58:26 +0000 (16:58 -0400)]
AMDGPU/GlobalISel: Remove -global-isel-abort=0 from some tests

4 years agoAMDGPU/GlobalISel: Add more tests for G_SADDE/G_SSUBE
Matt Arsenault [Thu, 27 Feb 2020 00:19:16 +0000 (19:19 -0500)]
AMDGPU/GlobalISel: Add more tests for G_SADDE/G_SSUBE

These don't work, but add baseline tests.

4 years ago[gn build] Port 5087ace6519
LLVM GN Syncbot [Sun, 15 Mar 2020 20:28:52 +0000 (20:28 +0000)]
[gn build] Port 5087ace6519

4 years ago[gn build] (manually) port 5087ace6519 more
Nico Weber [Sun, 15 Mar 2020 20:28:19 +0000 (16:28 -0400)]
[gn build] (manually) port 5087ace6519 more

4 years ago[Driver][test] Add a specific test file for -fmerge-all-constants
Fangrui Song [Sun, 15 Mar 2020 20:06:47 +0000 (13:06 -0700)]
[Driver][test] Add a specific test file for -fmerge-all-constants

Also, delete the option from the `// Test that we don't error on these.` block in test/Driver/clang_f_opts.c

4 years ago[gn build] (manually) port 5087ace6519
Nico Weber [Sun, 15 Mar 2020 20:06:37 +0000 (16:06 -0400)]
[gn build] (manually) port 5087ace6519

4 years agoAMDGPU/GlobalISel: Add baseline test for mul
Matt Arsenault [Sun, 15 Mar 2020 18:53:24 +0000 (14:53 -0400)]
AMDGPU/GlobalISel: Add baseline test for mul

4 years agoAMDGPU/GlobalISel: Add baseline test for mul
Matt Arsenault [Thu, 27 Feb 2020 14:32:25 +0000 (09:32 -0500)]
AMDGPU/GlobalISel: Add baseline test for mul

4 years ago[PowerPC] Regenerate rotate tests
Simon Pilgrim [Sun, 15 Mar 2020 18:29:00 +0000 (18:29 +0000)]
[PowerPC] Regenerate rotate tests

4 years ago[Thumb2] Regenerate rotate tests
Simon Pilgrim [Sun, 15 Mar 2020 18:28:54 +0000 (18:28 +0000)]
[Thumb2] Regenerate rotate tests

4 years ago[SystemZ] Regenerate rotate/shift tests
Simon Pilgrim [Sun, 15 Mar 2020 16:42:27 +0000 (16:42 +0000)]
[SystemZ] Regenerate rotate/shift tests

4 years ago[tblgen] Remove unused private field. NFC.
Benjamin Kramer [Sun, 15 Mar 2020 15:51:22 +0000 (16:51 +0100)]
[tblgen] Remove unused private field. NFC.

4 years ago[AVR] Make helper functions static. NFC.
Benjamin Kramer [Sun, 15 Mar 2020 15:50:15 +0000 (16:50 +0100)]
[AVR] Make helper functions static. NFC.

4 years ago[Clang][SVE] Parse builtin type string for scalable vectors
Sander de Smalen [Sun, 15 Mar 2020 14:29:45 +0000 (14:29 +0000)]
[Clang][SVE] Parse builtin type string for scalable vectors

This patch adds 'q' to mean 'scalable vector' in the builtin
type string, and for SVE will return the matching builtin
type as defined in the C/C++ language extensions for SVE.

This patch also adds some scaffolding to generate the arm_sve.h
header file, and some builtin definitions (+CodeGen) to be able
to implement some simple masked load intrinsics that use the
ACLE types, such as:

 svint8_t test_svld1_s8(svbool_t pg, const int8_t *base) {
   return svld1_s8(pg, base);
 }

Reviewers: efriedma, rjmccall, rovka, rsandifo-arm, rengolin

Reviewed By: efriedma

Tags: #clang

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

4 years ago[TypeSize] Allow returning scalable size in implicit conversion to uint64_t
Sander de Smalen [Fri, 13 Mar 2020 09:13:34 +0000 (09:13 +0000)]
[TypeSize] Allow returning scalable size in implicit conversion to uint64_t

This patch removes compiler runtime assertions that ensure the implicit
conversion are only guaranteed to work for fixed-width vectors.

With the assert it would be impossible to get _anything_ to build until
the
entire codebase has been upgraded, even when the indiscriminate uses of
the size as uint64_t would work fine for both scalable and fixed-width
types.

This issue will need to be addressed differently, with build-time errors
rather than assertion failures, but that effort falls beyond the scope
of this patch.

Returning the scalable size and avoiding the assert in getFixedSize()
is a temporary stop-gap in order to use LLVM for compiling and using
the SVE ACLE intrinsics.

Reviewers: efriedma, huntergr, rovka, ctetreau, rengolin

Reviewed By: efriedma

Tags: #llvm

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

4 years ago[DAG] MatchRotate - Add funnel shift by variable support
Simon Pilgrim [Sun, 15 Mar 2020 11:49:30 +0000 (11:49 +0000)]
[DAG] MatchRotate - Add funnel shift by variable support

Followup to D75114, this patch reuses the existing MatchRotate ROTL/ROTR rotation pattern code to also recognize the more general FSHL/FSHR funnel shift patterns when we have variable shift amounts, matched with MatchFunnelPosNeg which acts in an (almost) equivalent manner to MatchRotatePosNeg.

4 years ago[ValueLattice] Add singlecrfromundef lattice value.
Florian Hahn [Sun, 15 Mar 2020 10:35:39 +0000 (10:35 +0000)]
[ValueLattice] Add singlecrfromundef lattice value.

This patch adds a new singlecrfromundef lattice value, indicating a
single element constant range which was merge with undef at some point.
Merging it with another constant range results in overdefined, as we
won't be able to replace all users with a single value.

This patch uses a ConstantRange instead of a Constant*, because regular
integer constants are represented as single element constant ranges as
well and this allows the existing code working without additional
changes.

Reviewers: efriedma, nikic, reames, davide

Reviewed By: efriedma

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

4 years ago[mlir] Add support for generating dialect declarations via tablegen.
River Riddle [Sun, 15 Mar 2020 03:33:53 +0000 (20:33 -0700)]
[mlir] Add support for generating dialect declarations via tablegen.

Summary: This generates the class declarations for dialects using the existing 'Dialect' tablegen classes.

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

4 years agoBe more strict when checking existence of foo
Juneyoung Lee [Sun, 15 Mar 2020 03:02:19 +0000 (12:02 +0900)]
Be more strict when checking existence of foo