Matt Arsenault [Sat, 25 Jan 2020 02:51:37 +0000 (21:51 -0500)]
AMDGPU: Fix not using f16 fsin/fcos
I noticed this because this accidentally started working for
GlobalISel.
Jay Foad [Tue, 26 Nov 2019 09:46:19 +0000 (09:46 +0000)]
[AMDGPU] Simplify test and extend to gfx9 and gfx10
Summary:
This is in preparation for adding more test cases for D69661 and other
bug fixes in the same area.
Reviewers: tpr, dstuttard, critson, nhaehnle, arsenm
Subscribers: kzhuravl, jvesely, wdng, yaxunl, t-tye, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70708
Simon Pilgrim [Mon, 27 Jan 2020 16:43:59 +0000 (16:43 +0000)]
[X86][AVX] Add a more aggressive SimplifyMultipleUseDemandedBits to simplify masked store masks.
Fixes a poor codegen issue noticed in PR11210.
Matt Arsenault [Wed, 1 Jan 2020 20:51:46 +0000 (15:51 -0500)]
AMDGPU/GlobalISel: Custom legalize v2s16 G_SHUFFLE_VECTOR
Try to keep simple v2s16 cases as-is. This will more naturally map to
how the VOP3P op_sel modifiers work compared to the expansion
involving bitcasts and bitshifts.
This could maybe try harder with wider source vector types, although
that could be handled with a pre-legalize combine.
Christian Sigg [Mon, 27 Jan 2020 16:23:39 +0000 (17:23 +0100)]
Add pretty printers for llvm::PointerIntPair and llvm::PointerUnion.
Reviewers: aprantl, dblaikie, jdoerfert, nicolasvasilache
Reviewed By: dblaikie
Subscribers: jpienaar, dexonsmith, merge_guards_bot, llvm-commits
Tags: #llvm, #clang, #lldb, #openmp
Differential Revision: https://reviews.llvm.org/D72557
Nico Weber [Mon, 27 Jan 2020 15:39:49 +0000 (10:39 -0500)]
Revert "[StackColoring] Remap PseudoSourceValue frame indices via MachineFunction::getPSVManager()"
This reverts commit
7a8b0b1595e7dc878b48cf9bbaa652087a6895db.
It seems to break exception handling on 32-bit Windows, see
https://crbug.com/1045650
Matt Arsenault [Fri, 24 Jan 2020 18:41:50 +0000 (13:41 -0500)]
Revert "AMDGPU: Temporary drop s_mul_hi_i/u32 patterns"
This reverts commit
fe23ed2c681413e7baf517c79aee9be130579873.
It was never really clear this was responsible for the performance
regressions that caused this to be reverted. It's been a long time,
and we need to have scalar patterns for this to get GlobalISel
working.
David Goldman [Mon, 13 Jan 2020 22:01:10 +0000 (17:01 -0500)]
[clangd] Only re-open files if their flags changed
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72647
Teresa Johnson [Fri, 24 Jan 2020 20:24:18 +0000 (12:24 -0800)]
Restore "[LTO/WPD] Enable aggressive WPD under LTO option"
This restores
59733525d37cf9ad88b5021b33ecdbaf2e18911c (D71913), along
with bot fix
19c76989bb505c3117730c47df85fd3800ea2767.
The bot failure should be fixed by D73418, committed as
af954e441a5170a75687699d91d85e0692929d43.
I also added a fix for non-x86 bot failures by requiring x86 in new test
lld/test/ELF/lto/devirt_vcall_vis_public.ll.
Matt Arsenault [Fri, 24 Jan 2020 16:26:34 +0000 (11:26 -0500)]
AMDGPU/GlobalISel: Fix not using global atomics on gfx9+
For some reason the flat/global atomics end up in the generated
matcher table in a different order from SelectionDAG. Use
AddedComplexity to prefer checking for global atomics first.
Whitney Tsang [Thu, 23 Jan 2020 20:11:28 +0000 (20:11 +0000)]
[LoopUnroll] Remove remapInstruction().
Summary:
LoopUnroll can reuse the RemapInstruction() in ValueMapper, or
remapInstructionsInBlocks() in CloneFunction, depending on the needs.
There is no need to have its own version in LoopUnroll.
By calling RemapInstruction() without TypeMapper or Materializer and
with Flags (RF_NoModuleLevelChanges | RF_IgnoreMissingLocals), it does
the same as remapInstruction(). remapInstructionsInBlocks() calls
RemapInstruction() exactly as described.
Looking at the history, I cannot find any obvious reason to have its own
version.
Reviewer: dmgreen, jdoerfert, Meinersbur, kbarton, bmahjour, etiotto,
foad, aprantl
Reviewed By: jdoerfert
Subscribers: hiraditya, zzheng, llvm-commits, prithayan, anhtuyen
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D73277
James Henderson [Fri, 3 Jan 2020 14:35:54 +0000 (14:35 +0000)]
[test][llvm-dwarfdump] Add extra test case for invalid MD5 form
A subsequent patch will change how an invalid file name table is handled
to allow parsing to continue. This patch adds a test case that will
demonstrate a difference in behaviour with that change between invalid
file tables where the error is before the end of the stated prologue
length and where the error occurs after the stated length.
Reviewed by: dblaikie
Differential Revision: https://reviews.llvm.org/D72157
James Henderson [Fri, 3 Jan 2020 13:59:46 +0000 (13:59 +0000)]
[DebugInfo] Make incorrect debug line extended opcode length non-fatal
It is possible to try to keep parsing a debug line program even when the
length of an extended opcode does not match what is expected for that
opcode. This patch changes what was previously a fatal error to be
non-fatal. The parser now continues by assuming the the claimed length
is correct, even if it means moving the offset backwards.
Reviewed by: dblaikie
Differential Revision: https://reviews.llvm.org/D72155
Matt Arsenault [Sat, 18 Jan 2020 02:28:58 +0000 (21:28 -0500)]
AMDPGPU/GlobalISel: Select more MUBUF global addressing modes
The handling of the high bits of the resource descriptor seem weird to
me, where the 3rd dword changes based on the instruction.
Martin Probst [Fri, 24 Jan 2020 10:30:31 +0000 (11:30 +0100)]
clang-format: [JS] options for arrow functions.
Summary:
clang-format currently always wraps the body of non-empty arrow
functions:
const x = () => {
z();
};
This change implements support for the `AllowShortLambdasOnASingleLine`
style options, controlling the indent style for arrow function bodies
that have one or fewer statements. SLS_All puts all on a single line,
SLS_Inline only arrow functions used in an inline position.
const x = () => { z(); };
Multi-statement arrow functions continue to be wrapped. Function
expressions (`a = function() {}`) and function/method declarations are
unaffected as well.
Reviewers: krasimir
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73335
Alex Zinenko [Thu, 16 Jan 2020 13:32:33 +0000 (14:32 +0100)]
[mlir] Harden error propagation in LLVM import
Summary:
LLVM importer to MLIR was implemented mostly as a prototype. As such, it did
not deal handle errors in a consistent way, reporting them out stderr in some
cases and continuing the execution in the error state until eventually
crashing. This is not desirable for a user-facing tool. Make sure errors are
returned from functions, consistently checked at call sites and propagated
further. Functions returning nullable IR values return nullptr to denote the
error state. Other functions return LogicalResult. LLVM importer in
mlir-translate should no longer crash on unsupported inputs.
The errors are reported without association with the source file (and therefore
cannot be checked using -verify-diagnostics). Attaching them to the actual
input file is left for future work.
Differential Revision: https://reviews.llvm.org/D72839
Alex Zinenko [Thu, 16 Jan 2020 12:24:42 +0000 (13:24 +0100)]
[mlir] LLVM import: handle constant data and array/vector aggregates
Summary:
Implement the handling of llvm::ConstantDataSequential and
llvm::ConstantAggregate for (nested) array and vector types when imporitng LLVM
IR to MLIR. In all cases, the result is a DenseElementsAttr that can be used in
either a `llvm.mlir.global` or a `llvm.mlir.constant`. Nested aggregates are
unpacked recursively until an element or a constant data is found. Nested
arrays with innermost scalar type are represented as DenseElementsAttr of
tensor type. Nested arrays with innermost vector type are represented as
DenseElementsAttr with (multidimensional) vector type.
Constant aggregates of struct type are not yet supported as the LLVM dialect
does not have a well-defined way of modeling struct-type constants.
Differential Revision: https://reviews.llvm.org/D72834
Matt Arsenault [Wed, 22 Jan 2020 21:56:48 +0000 (16:56 -0500)]
AMDGPU/GlobalISel: Initial selection of MUBUF addr64 load/store
Fixes the main reason for compile failures on SI, but doesn't really
try to use the addressing modes yet.
Simon Pilgrim [Mon, 27 Jan 2020 15:05:08 +0000 (15:05 +0000)]
[X86][AVX] Add test case from PR11210
Shows failure to remove sign bit comparison when the result has multiple uses
Hans Wennborg [Wed, 9 Oct 2019 13:22:38 +0000 (15:22 +0200)]
Add a warning, flags and pragmas to limit the number of pre-processor tokens in a translation unit
See
https://docs.google.com/document/d/1xMkTZMKx9llnMPgso0jrx3ankI4cv60xeZ0y4ksf4wc/preview
for background discussion.
This adds a warning, flags and pragmas to limit the number of
pre-processor tokens either at a certain point in a translation unit, or
overall.
The idea is that this would allow projects to limit the size of certain
widely included headers, or for translation units overall, as a way to
insert backstops for header bloat and prevent compile-time regressions.
Differential revision: https://reviews.llvm.org/D72703
Dominik Montada [Mon, 27 Jan 2020 14:35:59 +0000 (09:35 -0500)]
Use pointer type size for offset constant when lowering load/stores
Matt Arsenault [Sun, 26 Jan 2020 23:24:24 +0000 (18:24 -0500)]
AMDGPU: Allow i16 shader arguments
Not allowing this just creates unnecessary complications when writing
simple tests.
Jay Foad [Thu, 19 Dec 2019 10:54:34 +0000 (10:54 +0000)]
[AMDGPU] Handle multiple base operands in areMemAccessesTriviallyDisjoint
Summary:
This is in preparation for getMemOperandsWithOffset returning more base
operands.
Depends on D73455.
Reviewers: arsenm, rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73456
Jay Foad [Wed, 18 Dec 2019 16:59:25 +0000 (16:59 +0000)]
[AMDGPU] Handle multiple base operands in shouldClusterMemOps
Summary:
This is in preparation for getMemOperandsWithOffset returning more base
operands.
Depends on D73454.
Reviewers: arsenm, rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73455
Jay Foad [Mon, 6 Jan 2020 13:37:29 +0000 (13:37 +0000)]
[AMDGPU] Handle frame index base operands in memOpsHaveSameBasePtr
Summary:
This is in preparation for getMemOperandsWithOffset returning more base
operands.
Reviewers: arsenm, rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, arphaman, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73454
vpykhtin [Mon, 27 Jan 2020 14:25:25 +0000 (17:25 +0300)]
[AMDGPU] Fix GCN regpressure trackers for INLINEASM instructions.
Differential revision: https://reviews.llvm.org/D73338
Teresa Johnson [Sat, 25 Jan 2020 15:26:09 +0000 (07:26 -0800)]
[WPD] Emit vcall_visibility metadata for MicrosoftCXXABI
Summary:
The MicrosoftCXXABI uses a separate mechanism for emitting vtable
type metadata, and thus didn't pick up the change from D71907
to emit the vcall_visibility metadata under -fwhole-program-vtables.
I believe this is the cause of a Windows bot failure when I committed
follow on change D71913 that required a revert. The failure occurred
in a CFI test that was expecting to not abort because it expected a
devirtualization to occur, and without the necessary vcall_visibility
metadata we would not get devirtualization.
Note in the equivalent code in CodeGenModule::EmitVTableTypeMetadata
(used by the ItaniumCXXABI), we also emit the vcall_visibility metadata
when Virtual Function Elimination is enabled. Since I am not as familiar
with the details of that optimization, I have marked that as a TODO and
am only inserting under -fwhole-program-vtables.
Reviewers: evgeny777
Subscribers: Prazek, ostannard, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73418
Matt Arsenault [Tue, 21 Jan 2020 14:02:42 +0000 (09:02 -0500)]
GlobalISel: Reimplement widenScalar for G_UNMERGE_VALUES results
Only use shifts if the requested type exactly matches the source type,
and create sub-unmerges otherwise.
David Green [Mon, 27 Jan 2020 13:59:29 +0000 (13:59 +0000)]
[MVE] Fixup order of gather writeback intrinsic outputs
The MVE_VLDRWU32_qi_pre gather loads, like the other _pre/_post mve
loads returns the writeback as result 0, the value as result 1. The llvm
ir intrinsic seems to have this the other way around though, and so when
lowering from one to the other we need to switch the first two outputs.
I've also fixed up the types of _pre/_post on normal MVE loads. There we
were already getting the values the right way around, just not for the
types. I don't believe this was causing anything to go wrong, but it was
very confusing to read in the debug output.
Differential Revision: https://reviews.llvm.org/D73370
Matt Arsenault [Sat, 25 Jan 2020 03:57:49 +0000 (22:57 -0500)]
GlobalISel: Translate vector GEPs
Russell Gallop [Fri, 3 Jan 2020 16:04:19 +0000 (16:04 +0000)]
Re-land [Support] Extend TimeProfiler to support multiple threads
This makes TimeTraceProfilerInstance thread local. Added
timeTraceProfilerFinishThread() which moves the thread local instance to
a global vector of instances. timeTraceProfilerWrite() then writes
recorded data from all instances.
Threads are identified based on their thread ids. Totals are reported
with artificial thread ids higher than the real ones.
This fixes the previous version to work with __thread as well as
thread_local.
Differential Revision: https://reviews.llvm.org/D71059
Igor Kudrin [Mon, 27 Jan 2020 12:33:34 +0000 (19:33 +0700)]
[LLDB] Fix build failures after removing Version from DWARFExpression.
Igor Kudrin [Thu, 23 Jan 2020 02:24:00 +0000 (09:24 +0700)]
[DWARF] Do not pass Version to DWARFExpression. NFCI.
The Version was used only to determine the size of an operand of
DW_OP_call_ref. The size was 4 for all versions apart from 2, but
the DW_OP_call_ref operation was introduced only in DWARF3. Thus,
the code may be simplified and using of Version may be eliminated.
Differential Revision: https://reviews.llvm.org/D73264
Igor Kudrin [Thu, 23 Jan 2020 11:13:30 +0000 (18:13 +0700)]
[DWARF] Simplify DWARFExpression. NFC.
As DataExtractor already has a method to extract an unsigned value of
a specified size, there is no need to duplicate that.
Differential Revision: https://reviews.llvm.org/D73263
Krasimir Georgiev [Mon, 27 Jan 2020 11:37:15 +0000 (12:37 +0100)]
[clang-format] Handle escaped " in C# string-literals
Reviewers: krasimir
Reviewed By: krasimir
Subscribers: klimek, MyDeveloperDay
Tags: #clang-format
Differential Revision: https://reviews.llvm.org/D73353
David Stenberg [Mon, 27 Jan 2020 10:36:03 +0000 (11:36 +0100)]
Improvements to call site register worklist
Summary:
This fixes PR44118. For cases where we have a chain like this:
R8 = R1 (entry value)
R0 = R8
call @foo R0
the code that emits call site entries using entry values would not
follow that chain, instead emitting a call site entry with R8 as
location rather than R0. Such a case was discovered when originally
adding dbgcall-site-orr-moves.mir. This patch fixes that issue. This is
done by changing the ForwardedRegWorklist set to a map in which the
worklist registers always map to the parameter registers that they
describe.
Another thing this patch fixes is that worklist registers now can
describe more than one parameter register at a time. Such a case
occurred in dbgcall-site-interpretation.mir, resulting in a call site
entry not being emitted for one of the parameters.
Reviewers: djtodoro, NikolaPrica, aprantl, vsk
Reviewed By: vsk
Subscribers: hiraditya, llvm-commits
Tags: #debug-info, #llvm
Differential Revision: https://reviews.llvm.org/D73168
Stephen Kelly [Mon, 27 Jan 2020 11:16:50 +0000 (11:16 +0000)]
[ASTMatchers] Fix parent traversal with InitListExpr
Children of InitListExpr are traversed twice by RAV, so this code
populates a vector to represent the possibly-multiple parents (in
reality in this situation the parent is the same and is therefore
de-duplicated).
Sjoerd Meijer [Mon, 27 Jan 2020 11:05:26 +0000 (11:05 +0000)]
[ARM][MVE] Tail-predication: support constant trip count
We had support for runtime trip count values, but not constants, and this adds
supports for that.
And added a minor optimisation while I was add it: don't invoke Cleanup when
there's nothing to clean up.
Differential Revision: https://reviews.llvm.org/D73198
Sam Parker [Mon, 27 Jan 2020 10:58:46 +0000 (10:58 +0000)]
[ARM][LowOverheadLoops] Dont ignore VCTP
When expanding the LoopStart, we try to remove the iteration count
calculation. However, if part of the calculation was also used to
calculate the number of elements we could end up deleting
instructions that were required to feed DLSTP/WLSTP.
Differential Revision: https://reviews.llvm.org/D73275
David Stenberg [Mon, 27 Jan 2020 10:15:55 +0000 (11:15 +0100)]
Don't separate imp/expl def handling for call site params
Summary:
Since D70431 the describeLoadedValue() hook takes a parameter register,
meaning that it can now be asked to describe any register. This means
that we can drop the difference between explicit and implicit defines
that we previously had in collectCallSiteParameters().
I have not found any case for any upstream targets where a parameter
register is only implicitly defined, and does not overlap with any
explicit defines. I don't know if such a case would even make sense. So
as far as I have tested, this patch should be a non-functional change.
However, this reduces the complexity of the code a bit, and it will
simplify the implementation of an upcoming patch which solves PR44118.
Reviewers: djtodoro, NikolaPrica, aprantl, vsk
Reviewed By: djtodoro, vsk
Subscribers: hiraditya, llvm-commits
Tags: #debug-info, #llvm
Differential Revision: https://reviews.llvm.org/D73167
Georgii Rymar [Wed, 22 Jan 2020 12:20:36 +0000 (15:20 +0300)]
[llvm-readobj] - Refine --needed-libs implementation and add a test.
We have no good test for --needed-libs option.
The one we have as a part of Object/readobj-shared-object.test
is not complete.
In this patch I've did a minor NFC changes to the implementation and
added a test. This allowed to remove this piece from
Object/readobj-shared-object.test
Differential revision: https://reviews.llvm.org/D73174
Guillaume Chatelet [Mon, 27 Jan 2020 09:37:01 +0000 (10:37 +0100)]
[Alignment][NFC] Use Align with CreateAlignedLoad
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet, bollu
Subscribers: hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D73449
Raphael Isemann [Mon, 27 Jan 2020 09:55:54 +0000 (10:55 +0100)]
[lldb][NFC] Give import-std-module tests a more unique file names
We want that the *.py names for the tests have unique names but
the current ones are sometimes very simple (e.g., "TestUniquePtr.py")
and could collide with unrelated tests. This just gives all these
tests a "FromStdModule" suffix to make these collisions less likely.
Raphael Isemann [Mon, 27 Jan 2020 09:48:22 +0000 (10:48 +0100)]
[lldb][NFC] Improve documentation for CompletionRequest
Georgii Rymar [Wed, 22 Jan 2020 11:08:42 +0000 (14:08 +0300)]
[llvm-readobj] - Add a test for --dyn-symbols when there are no dynamic symbols.
It removes the Object/readobj-absent.test test and creates a one more case in
dyn-symbols.test we have.
Differential revision: https://reviews.llvm.org/D73169
Georgii Rymar [Tue, 21 Jan 2020 14:49:42 +0000 (17:49 +0300)]
[llvm-readobj] - Add a test for --hash-table option.
We had no test for --hash-table in tools/llvm-readobj.
The one we had was in test/Object and checked that
it is possible to dump the hash table even when an object
doesn't have a section header table.
In this patch I created a test, moved and merged the existent one.
During moving I converted it to be YAML based to stop using the
precompiled binary.
Differential revision: https://reviews.llvm.org/D73105
Guillaume Chatelet [Fri, 24 Jan 2020 16:40:17 +0000 (17:40 +0100)]
[Alignment][NFC] Use Align with CreateMaskedScatter/Gather
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
This patch shows that CreateMaskedScatter/CreateMaskedGather can only take positive non zero alignment values.
Reviewers: courbet
Subscribers: hiraditya, llvm-commits, delena
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73361
Guillaume Chatelet [Fri, 24 Jan 2020 10:37:18 +0000 (11:37 +0100)]
Fix missing dependency in LibcUnitTest
Summary: LibcUnitTest is missing a dependency on LLVMSupport. This prevents building with shared libraries.
Reviewers: sivachandra
Subscribers: mgorny, MaskRay, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D73337
Adam Balogh [Thu, 23 Jan 2020 14:13:30 +0000 (15:13 +0100)]
[clan-tidy] Fix false positive in bugprone-infinite-loop
The checker bugprone-infinite-loop does not track changes of
variables in the initialization expression of a variable
declared inside the condition of the while statement. This
leads to false positives, similarly to the one in the bug
report https://bugs.llvm.org/show_bug.cgi?id=44618. This
patch fixes this issue by enabling tracking of the variables
of this expression as well.
Differential Revision: https://reviews.llvm.org/D73270
Petar Avramovic [Mon, 27 Jan 2020 08:59:50 +0000 (09:59 +0100)]
[MIPS GlobalISel] Select population count (popcount)
G_CTPOP is generated from llvm.ctpop.<type> intrinsics, clang generates
these intrinsics from __builtin_popcount and __builtin_popcountll.
Add lower and narrow scalar for G_CTPOP.
Lower G_CTPOP for MIPS32.
Differential Revision: https://reviews.llvm.org/D73216
Petar Avramovic [Mon, 27 Jan 2020 08:51:06 +0000 (09:51 +0100)]
[MIPS GlobalISel] Select count trailing zeros
llvm.cttz.<type> intrinsic has additional i1 argument is_zero_undef,
it tells whether zero as the first argument produces a defined result.
G_CTTZ is generated from llvm.cttz.<type> (<type> <src>, i1 false)
intrinsics, clang generates these intrinsics from __builtin_ctz and
__builtin_ctzll.
G_CTTZ_ZERO_UNDEF comes from llvm.cttz.<type> (<type> <src>, i1 true).
Clang generates such intrinsics as parts of expansion of builtin_ffs
and builtin_ffsll. It is also traditionally part of and many
algorithms that are now predicated on avoiding zero-value inputs.
Add narrow scalar (algorithm uses G_CTTZ_ZERO_UNDEF) for G_CTTZ.
Lower G_CTTZ and G_CTTZ_ZERO_UNDEF for MIPS32.
Differential Revision: https://reviews.llvm.org/D73215
Petar Avramovic [Mon, 27 Jan 2020 08:43:38 +0000 (09:43 +0100)]
[MIPS GlobalISel] Select count leading zeros
llvm.ctlz.<type> intrinsic has additional i1 argument is_zero_undef,
it tells whether zero as the first argument produces a defined result.
MIPS clz instruction returns 32 for zero input.
G_CTLZ is generated from llvm.ctlz.<type> (<type> <src>, i1 false)
intrinsics, clang generates these intrinsics from __builtin_clz and
__builtin_clzll.
G_CTLZ_ZERO_UNDEF can also be generated from llvm.ctlz with true as
second argument. It is also traditionally part of and many algorithms
that are now predicated on avoiding zero-value inputs.
Add narrow scalar for G_CTLZ (algorithm uses G_CTLZ_ZERO_UNDEF).
Lower G_CTLZ_ZERO_UNDEF and select G_CTLZ for MIPS32.
Differential Revision: https://reviews.llvm.org/D73214
Fangrui Song [Sun, 26 Jan 2020 23:47:32 +0000 (15:47 -0800)]
[MachineVerifier] Simplify and delete LLVM_VERIFY_MACHINEINSTRS from a comment. NFC
The environment variable has been unused since r228079.
Martin Storsjö [Sun, 26 Jan 2020 20:14:41 +0000 (22:14 +0200)]
[libunwind] Treat assembly files as C on mingw
When targeting mingw, current CMake (3.16) fails to get the right
flags for assembly source files for windows gnu/clang targets
(see https://gitlab.kitware.com/cmake/cmake/merge_requests/4287
for a fix), causing builds to fail due to `-fPIC` being unsupported
in clang for mingw targets
In the meantime, restore the behaviour from before
c48974ffd7d1676
selectively on mingw targets, treating the assembly files as C.
Differential Revision: https://reviews.llvm.org/D73436
Qiu Chaofan [Mon, 27 Jan 2020 03:37:43 +0000 (11:37 +0800)]
[NFC] Fix typo in Clang docs
Wang, Pengfei [Fri, 17 Jan 2020 02:32:30 +0000 (10:32 +0800)]
[FPEnv] Divide macro INSTRUCTION into INSTRUCTION and DAG_INSTRUCTION,
and macro FUNCTION likewise. NFCI.
Some functions like fmuladd don't really have a node, we should divide
the declaration form those have node to avoid introducing fake nodes.
Differential Revision: https://reviews.llvm.org/D72871
Saar Raz [Sun, 26 Jan 2020 22:57:31 +0000 (00:57 +0200)]
[Concepts] Fix incorrect TemplateArgs for introduction of local parameters
The wrong set of TemplateArgs was being provided to addInstantiatedParametersToScope.
Caused bug #44658.
Lei Zhang [Sun, 26 Jan 2020 15:55:17 +0000 (10:55 -0500)]
[mlir] Expose getNearestSymbolTable as SymbolTable class method
This is a generally useful utility function for interacting with
symbol tables.
Differential Revision: https://reviews.llvm.org/D73433
Saar Raz [Sun, 26 Jan 2020 22:14:43 +0000 (00:14 +0200)]
[Concepts] Add missing null check to transformConstructor
Caused bug 44671 when transforming a constructor with a type-constraint with no explicit template args.
Martin Storsjö [Sun, 26 Jan 2020 20:11:28 +0000 (22:11 +0200)]
[libunwind] Fix building standalone after
c48974ffd7d1676
After this change, we need to explicitly list the languages the
project uses, otherwise the assembly source files won't get built
at all.
Previously (before that commit), the assembly source files were
simply treated as C.
The toplevel llvm CMakeLists.txt adds these three languages, so
when building libunwind integrated as part of that, it works fine.
Roman Lebedev [Sun, 26 Jan 2020 17:33:29 +0000 (20:33 +0300)]
[X86][BdVer2] Polish LEA instruction scheduling info
Based on exhaustive llvm-exegesis measurements.
There may still be some imperfections for LEA16r/LEA32r.
Much like was observed in D68646, i'm also measuring some outliers
with some specific registers.
Roman Lebedev [Sun, 26 Jan 2020 19:01:33 +0000 (22:01 +0300)]
[NFC][MCA] Re-autogenerate all check lines in all X86 MCA tests
Some whitespace issues have crept in,
and some znver2 check lines were missing..
Simon Pilgrim [Sun, 26 Jan 2020 17:27:53 +0000 (17:27 +0000)]
[InstCombine] Add extra shift(c1,add(c2,y)) tests for PR15141
Simon Pilgrim [Sun, 26 Jan 2020 14:59:53 +0000 (14:59 +0000)]
[X86][AVX] Extend combineCommutableSHUFP to handle v8f32 and v16f32 commutable shufps patterns
Saar Raz [Sun, 26 Jan 2020 18:39:44 +0000 (20:39 +0200)]
[Concepts] Fix parsing of scope specifier in compound-requirements, add more tests for scope specifiers in type-constraints
The code for parsing of type-constraints in compound-requirements was not adapted for the new TryAnnotateTypeConstraint which
caused compound-requirements with scope specifiers to ignore them.
Also add regression tests for scope specifiers in type-constraints in more contexts.
Stephen Kelly [Fri, 24 Jan 2020 23:46:54 +0000 (23:46 +0000)]
NFC: Implement AST node skipping in ParentMapContext
Summary:
This allows ASTContext to store only one parent map, rather than storing
an entire parent map for each traversal mode used.
This is therefore a partial revert of commit
0a717d5b (Make it possible
control matcher traversal kind with ASTContext, 2019-12-06).
Reviewers: aaron.ballman, rsmith, rnk
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73388
Guillaume Chatelet [Wed, 22 Jan 2020 13:27:05 +0000 (14:27 +0100)]
[IR] masked gather/scatter alignment should be set
Summary: masked_load and masked_store instructions require the alignment to be specified and a power of two. It seems to me that this requirement applies to masked_gather and masked_scatter as well.
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73179
Lei Zhang [Sat, 25 Jan 2020 15:09:46 +0000 (10:09 -0500)]
[mlir][spirv] Create builtin variable in nearest symbol table
This commit changes the logic of `getBuiltinVariableValue` to get
or create the builtin variable in the nearest symbol table. This
will allow us to use this function in other partial conversion
cases where we haven't created the spv.module yet.
Differential Revision: https://reviews.llvm.org/D73416
Lei Zhang [Sat, 25 Jan 2020 15:58:18 +0000 (10:58 -0500)]
[mlir][spirv] NFC: simplify load/store builder call sites
This commit introduces default values for load/store builders to
simplify builder call sites.
Differential Revision: https://reviews.llvm.org/D73419
Lei Zhang [Sat, 25 Jan 2020 22:01:26 +0000 (17:01 -0500)]
[mlir][spirv] NFC: expose builtin func op conversion pattern
This commit exposes the func op conversion pattern via a new
`populateBuiltinFuncToSPIRVPatterns` function from the standard
to SPIR-V conversion passs. This is structurally better given
that func op belongs to the builtin dialect. More importantly,
this makes the pattern reusable to other dialect to SPIR-V
dialect conversion as other dialect can well adopt builtin
func op instead of having its own. Besides, it's very common
to use func ops as test wrappers in lit tests, so test passes
will need to handle func ops too.
Differential Revision: https://reviews.llvm.org/D73421
Lei Zhang [Sat, 25 Jan 2020 14:16:29 +0000 (09:16 -0500)]
[mlir][spirv] Relax verification to allow flexible placement
Thus far certain SPIR-V ops have been required to be in spv.module.
While this provides strong verification to catch unexpected errors,
it's quite rigid and makes progressive lowering difficult. Sometimes
we would like to partially lower ops from other dialects, which may
involve creating ops like global variables that should be placed in
other module-like ops. So this commit relaxes the requirement of
such SPIR-V ops' scope to module-like ops. Similarly for function-
like ops.
Differential Revision: https://reviews.llvm.org/D73415
Lei Zhang [Sun, 26 Jan 2020 15:19:24 +0000 (10:19 -0500)]
[mlir][spirv] Add spv.GroupNonUniformElect and spv.GroupNonUniformIAdd
Differential Revision: https://reviews.llvm.org/D73349
Simon Pilgrim [Sun, 26 Jan 2020 14:35:56 +0000 (14:35 +0000)]
[X86][AVX] Add tests showing combineCommutableSHUFP failure to handle v8f32 and v16f32 commutable shufps patterns
Simon Pilgrim [Sun, 26 Jan 2020 14:31:26 +0000 (14:31 +0000)]
[X86][SSE] combineCommutableSHUFP - permilps(shufps(load(),x)) --> permilps(shufps(x,load()))
Pull out combineTargetShuffle code added in rG3fd5d1c6e7db into a helper function and extend it to handle shufps(shufps(load(),x),y) and shufps(y,shufps(load(),x)) cases as well.
Serge Pavlov [Wed, 7 Aug 2019 16:31:26 +0000 (23:31 +0700)]
[FPEnv] Extended FPOptions with new attributes
This change added two new attributes, rounding mode and exception
behavior to the structure FPOptions. These attributes allow more
flexible treatment of specific floating point environment than it is
provided by #pragma STDC FENV_ACCESS.
Differential Revision: https://reviews.llvm.org/D65994
Simon Pilgrim [Sun, 26 Jan 2020 10:01:21 +0000 (10:01 +0000)]
[TargetLowering] Respect recursive depth in SimplifyDemandedBits call to ComputeNumSignBits
Maheaha Shivamallappa [Sun, 26 Jan 2020 08:01:53 +0000 (13:31 +0530)]
AMDGPU/GlobalISel: Clean-up code around ISel for Intrinsics.
Summary:
A minor code clean-up around ISel for intrinsic llvm.amdgcn.end.cf()
Reviewers: arsenm, mshivama
Reviewed By: arsenm
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73358
Fangrui Song [Sun, 26 Jan 2020 02:58:54 +0000 (18:58 -0800)]
[ELF][PPC32] Support range extension thunks with addends
* Generalize the code added in D70637 and D70937. We should eventually remove the EM_MIPS special case.
* Handle R_PPC_LOCAL24PC the same way as R_PPC_REL24.
Reviewed By: Bdragon28
Differential Revision: https://reviews.llvm.org/D73424
George Burgess IV [Sun, 26 Jan 2020 05:44:59 +0000 (21:44 -0800)]
[Support] `const`ify a method; NFC
Pointed out by Stepan on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2020-January/138617.html
Mehdi Amini [Sun, 26 Jan 2020 03:58:30 +0000 (03:58 +0000)]
Mass update the MLIR license header to mention "Part of the LLVM project"
This is an artifact from merging MLIR into LLVM, the file headers are
now aligned with the rest of the project.
Craig Topper [Sun, 26 Jan 2020 02:25:45 +0000 (18:25 -0800)]
[X86] Use a macro to convert X86ISD names to strings in getTargetNodeName.
Every case in the switch had a string version of themselves. Two
of them had a typo that used : instead of ::
By using a macro we can automate the string creation and avoid
the possibility of typos like this.
This is similar to what is done on the AMDGPU target.
Fangrui Song [Sat, 25 Jan 2020 01:49:59 +0000 (17:49 -0800)]
[ELF][PPC32] Support canonical PLT
-fno-pie produces a pair of non-GOT-non-PLT relocations R_PPC_ADDR16_{HA,LO} (R_ABS) referencing external
functions.
```
lis 3, func@ha
la 3, func@l(3)
```
In a -no-pie/-pie link, if func is not defined in the executable, a canonical PLT entry (st_value>0, st_shndx=0) will be needed.
References to func in shared objects will be resolved to this address.
-fno-pie -pie should fail with "can't create dynamic relocation ... against ...", so we just need to think about -no-pie.
On x86, the PLT entry passes the JMP_SLOT offset to the rtld PLT resolver.
On x86-64: the PLT entry passes the JUMP_SLOT index to the rtld PLT resolver.
On ARM/AArch64: the PLT entry passes &.got.plt[n]. The PLT header passes &.got.plt[fixed-index]. The rtld PLT resolver can compute the JUMP_SLOT index from the two addresses.
For these targets, the canonical PLT entry can just reuse the regular PLT entry (in PltSection).
On PPC32: PltSection (.glink) consists of `b PLTresolve` instructions and `PLTresolve`. The rtld PLT resolver depends on r11 having been set up to the .plt (GotPltSection) entry.
On PPC64 ELFv2: PltSection (.glink) consists of `__glink_PLTresolve` and `bl __glink_PLTresolve`. The rtld PLT resolver depends on r12 having been set up to the .plt (GotPltSection) entry.
We cannot reuse a `b PLTresolve`/`bl __glink_PLTresolve` in PltSection as a canonical PLT entry. PPC64 ELFv2 avoids the problem by using TOC for any external reference, even in non-pic code, so the canonical PLT entry scenario should not happen in the first place.
For PPC32, we have to create a PLT call stub as the canonical PLT entry. The code sequence sets up r11.
Reviewed By: Bdragon28
Differential Revision: https://reviews.llvm.org/D73399
Saar Raz [Sat, 25 Jan 2020 20:54:27 +0000 (22:54 +0200)]
[Concepts] Transform constraints of non-template functions to ConstantEvaluated
We would previously try to evaluate atomic constraints of non-template functions as-is,
and since they are now unevaluated at first, this would cause incorrect evaluation (bugs #44657, #44656).
Substitute into atomic constraints of non-template functions as we would atomic constraints
of template functions, in order to rebuild the expressions in a constant-evaluated context.
Simon Pilgrim [Sat, 25 Jan 2020 20:20:37 +0000 (20:20 +0000)]
[SelectionDAG] ComputeNumSignBits - add DemandedElts support for MIN/MAX ops
Fangrui Song [Thu, 23 Jan 2020 05:39:16 +0000 (21:39 -0800)]
[ELF] Rename relocateOne() to relocate() and pass `Relocation` to it
Symbol information can be used to improve out-of-range/misalignment diagnostics.
It also helps R_ARM_CALL/R_ARM_THM_CALL which has different behaviors with different symbol types.
There are many (67) relocateOne() call sites used in thunks, {Arm,AArch64}errata, PLT, etc.
Rename them to `relocateNoSym()` to be clearer that there is no symbol information.
Reviewed By: grimar, peter.smith
Differential Revision: https://reviews.llvm.org/D73254
Simon Pilgrim [Sat, 25 Jan 2020 19:28:57 +0000 (19:28 +0000)]
[X86] Add tests showing ComputeNumSignBits's failure to use DemandedElts for MIN/MAX opcodes
Simon Pilgrim [Sat, 25 Jan 2020 19:15:05 +0000 (19:15 +0000)]
[SelectionDAG] ComputeNumSignBits - add support for rotate non-uniform vector amounts
Simon Pilgrim [Sat, 25 Jan 2020 18:55:47 +0000 (18:55 +0000)]
[SelectionDAG] ComputeNumSignBits - add support for rotate uniform vector amounts
Simon Pilgrim [Sat, 25 Jan 2020 18:24:15 +0000 (18:24 +0000)]
[X86] Add tests showing ComputeNumSignBits's failure to see through rotate vector amounts
Jacques Pienaar [Sat, 25 Jan 2020 17:52:46 +0000 (09:52 -0800)]
[mlir] Revert MSVC specific part of whole_archive_link
Revert the MSVC specific parts in whole_archive_link to previous form to
potentially address https://bugs.llvm.org/show_bug.cgi?id=44660.
Simon Pilgrim [Sat, 25 Jan 2020 17:36:21 +0000 (17:36 +0000)]
[TargetLowering] SimplifyDemandedBits - Remove ashr if all our demandedbits already match the sign bit
Differential Revision: https://reviews.llvm.org/D73412
Jacques Pienaar [Sat, 25 Jan 2020 17:17:31 +0000 (09:17 -0800)]
[mlir] Bootstrap doxygen config
Add basic doxygen config following clang and llvm example with minimal
changes.
Francis Visoiu Mistrih [Sat, 25 Jan 2020 17:14:24 +0000 (09:14 -0800)]
[perf-training] Update ' (in-process)' prefix handling
A recent change added a new line after the prefix, so it's now part of
the prefix list.
serge-sans-paille [Thu, 12 Dec 2019 17:38:31 +0000 (18:38 +0100)]
Improve static checks for sprintf and __builtin___sprintf_chk
Implement a pessimistic evaluator of the minimal required size for a buffer
based on the format string, and couple that with the fortified version to emit a
warning when the buffer size is lower than the lower bound computed from the
format string.
Differential Revision: https://reviews.llvm.org/D71566
Sam McCall [Sat, 25 Jan 2020 14:31:55 +0000 (15:31 +0100)]
[clangd] Make Notification a little safer.
I just fixed a test involving a similar Notification class:
18e6a65bae93a
The pattern (notify() on one thread, wait() and then destroy the Notification
on the other) seems innocuous enough. I'm not sure we actually use it in clangd,
but better safe than sorry.
Sam McCall [Sat, 25 Jan 2020 14:22:12 +0000 (15:22 +0100)]
[Support] Fix race in threading test, found by TSan
Tom Stellard [Sat, 25 Jan 2020 05:52:05 +0000 (21:52 -0800)]
AMDGPU/SILoadStoreOptimizer: Fix uninitialized variable error
This was introduced by
86c944d790728891801778b8d98c2c65a83f36a5 and
caught by the sanitizer-x86_64-linux-fast bot.
Jonas Devlieghere [Sat, 25 Jan 2020 04:54:02 +0000 (20:54 -0800)]
[lldb/Test] Disable hardware check on arm/aarch64
BreakpointSites know they're backed by hardware based on whether the
"hardware index" is set. This does not appear the to be done for
arm/aarch64.
https://llvm.org/PR44659
Jonas Devlieghere [Sat, 25 Jan 2020 04:46:51 +0000 (20:46 -0800)]
[lldb/Test] Update minidebuginfo-set-and-hit-breakpoint.test
Update test to account for the new 'hardware' field between 'resolved'
and 'hit count'.
Matt Arsenault [Sat, 25 Jan 2020 02:59:48 +0000 (21:59 -0500)]
AMDGPU: Generate test checks