Commit Graph

428501 Commits

Author SHA1 Message Date
Piotr Sobczak 4874838a63 [AMDGPU] gfx11 WMMA instruction support
gfx11 introduces new WMMA (Wave Matrix Multiply-accumulate)
instructions.

Reviewed By: arsenm, #amdgpu

Differential Revision: https://reviews.llvm.org/D128756
2022-06-30 11:13:45 -04:00
Valentin Clement a19c213212
[flang][NFC] Fix warning 2022-06-30 16:56:49 +02:00
Sam McCall 8b04c331b5 [pseudo] Forest dump ascii art isn't broken by large indices 2022-06-30 16:53:51 +02:00
Nikolas Klauser adc0f5b3a6 [libc++] Remove dead code and unneeded C++03 specializations from type_traits
Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D128906
2022-06-30 16:49:17 +02:00
Nikolas Klauser 3ee9a50a14 [libc++] Implement P0618R0 (Deprecating <codecvt>)
Reviewed By: ldionne, #libc

Spies: cfe-commits, llvm-commits, libcxx-commits

Differential Revision: https://reviews.llvm.org/D127313
2022-06-30 16:47:50 +02:00
Tue Ly ae5c82502e [libc][Obvious] Do not add __NO_ to targets with FLAG__NO suffix. 2022-06-30 10:45:59 -04:00
Pavel Labath cff509f33b [lldb] Fix libc++ string formatter for the "unstable" layout
D128285 only changed the stable (v1) layout, so the matching change in
D128694 broke the formatting of the unstable strings. This fixes that,
and ensures compatibility with all older layouts as well.
2022-06-30 16:44:54 +02:00
Nikita Popov f34dcf2763 [IRBuilder] Migrate all binops to folding API
Migrate all binops to use FoldXYZ rather than CreateXYZ APIs,
which are compatible with InstSimplifyFolder and fallible constant
folding.

Rather than continuing to add one method for every single operator,
add a generic FoldBinOp (plus variants for nowrap, exact and fmf
operators), which we would need anyway for CreateBinaryOp.

This change is not NFC because IRBuilder with InstSimplifyFolder
may perform more folding. However, this patch changes SCEVExpander
to not use the folder in InsertBinOp to minimize practical impact
and keep this change as close to NFC as possible.
2022-06-30 16:41:17 +02:00
Muhammad Omair Javaid 8e9360db1b Fix PDB/func-symbols.test for Arm/Windows
PDB/func-symbols.test was orignally written for 32bit x86, keeping in
mind cdecl and stdcall calling conventions which does name mangling for
example like adding "_" underscore before function name.
This is only x86 specific but purpose of pointers.test is NOT to test
calling convention.
I have made a minor change to make this test pass on Windows/Arm.
2022-06-30 17:58:19 +04:00
Chen Zheng 36ac436068 add testcases for D128647, NFC 2022-06-30 09:54:49 -04:00
Muhammad Omair Javaid dd01d9aadb Fix TestCommandScript.py for Arm/Windows
TestCommandScript.py fails on Arm/Windows due following issues:
https://llvm.org/pr56288
https://llvm.org/pr56292

LLDB fails to skip prologue and also step over library function or
nodebug functions fails due to PDB/DWARF mismatch.

This patch replace function breakpoint with line breakpoint so that we
can expect LLDB to stop on desired line. Also replace dwarf with PDB
debug info for this test only.
2022-06-30 17:48:28 +04:00
Erich Keane 2f20743952 Deferred Concept Instantiation Implementation
This is a continuation of D119544.  Based on @rsmith 's feed back
showing me https://eel.is/c++draft/temp#friend-9, We should properly
handle friend functions now.

Differential Revision: https://reviews.llvm.org/D126907
2022-06-30 06:47:11 -07:00
Valentin Clement 540a76f074
[flang] Convert assertion to a TODO
The original assertion is not necessarily correct since the shape
argument may involve a slice of an array (an expression) and not a whole
vector with constant length. In the presence of a slice operation, the
size must be computed (left as a TODO for now).

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-06-30 15:46:24 +02:00
LLVM GN Syncbot 7903b35a71 [gn build] Port a591c7ca0d 2022-06-30 13:27:00 +00:00
Nikita Popov 588e229bf9 [VNCoercion] Separate constant/non-constant mem intrinsic implementations (NFCI)
This means we no longer need to have the same API between IRBuilder
and IRBuilderFolder.

The constant case is substantially simpler, so implementing it
separately isn't an undue burden.
2022-06-30 15:26:06 +02:00
Xiang Li a591c7ca0d [HLSL] Change WaveActiveCountBits to wrapper of __builtin_hlsl_wave_active_count_bits
Change WaveActiveCountBits from builtin into wrapper of __builtin_hlsl_wave_active_count_bits.
For comment at
https://reviews.llvm.org/D126857#inline-1235949

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D128855
2022-06-30 06:16:51 -07:00
Prathit Aswar cde1df4ca4 Correct -Winfinite-recursion warning on potentially-unevaluated operand
Fixing issue "incorrect -Winfinite-recursion warning on potentially-
unevaluated operand".

We add a dedicated visit function (VisitCXXTypeidExpr) for typeid,
instead of using the default (VisitStmt). In this new function we skip
over building the CFG for unevaluated operands of typeid.

Fixes #21668

Differential Revision: https://reviews.llvm.org/D128747
2022-06-30 09:09:28 -04:00
Nikita Popov 014c4bdb9d [VNCoercion] Use ConstantFoldLoadFromConst API (NFCI)
Nowdays we have a generic constant folding API to load a type from
an offset. It should be able to do anything that VNCoercion can do.

This avoids the weird templating between IRBuilder and ConstantFolder
in one function, which is will stop working as the IRBuilderFolder
moves from CreateXYZ to FoldXYZ APIs.

Unfortunately, this doesn't eliminate this pattern from VNCoercion
entirely yet.
2022-06-30 14:52:27 +02:00
Aaron Jacobs 007934343c [libTooling][NFC] Add a comment about comment parsing to getAssociatedRange.
It took me multiple hours of debugging plus asking an expert for help to
figure out why this function didn't do what it promised to do. It turns
out there is a flag that needs to be set. Document this, in an attempt
to save the next person the surprise.

Reviewed By: ymandel

Differential Revision: https://reviews.llvm.org/D128774
2022-06-30 12:46:57 +00:00
Nikolas Klauser 44c8ef01ba [libc++] Disentangle _If, _Or and _And
Reviewed By: ldionne, #libc, EricWF

Spies: EricWF, libcxx-commits

Differential Revision: https://reviews.llvm.org/D127919
2022-06-30 14:01:10 +02:00
Florian Hahn 68884dde70
[LV] Move LoopVersioning creation to LVP::execute.
At the moment LoopVersioning is only created for inner-loop
vectorization. This patch moves it to LVP::execute, which means it will
also be added for epilogue vectorization. As a consequence, the proper
noalias metadata is now also added to epilogue vector loops.

LVer will be moved to VPTransformState as follow-up.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D127966
2022-06-30 12:14:32 +01:00
Xiang1 Zhang 988901ac74 [test] Add a lit test fshl-splat-undef.ll 2022-06-30 19:00:18 +08:00
esmeyi 83456f2b4f [NFC][XCOFF] remove an unused global variable. 2022-06-30 06:55:49 -04:00
Michael Platings 9184002d66 Uglify __support/xlocale
This allows including the headers without risk of conflict with
user-defined macros e.g. max

Differential Revision: https://reviews.llvm.org/D128728
2022-06-30 11:45:29 +01:00
Fraser Cormack 643e022c9c [IR] Fix typo in comment. NFC 2022-06-30 11:30:23 +01:00
Nicolas Vasilache 178f9bd63c [mlir][Linalg] Uniformize SplitReduction transforms and add option to use Bufferization::AllocTensor
This revision merges the 2 split_reduction transforms and adds extra control by using attributes.

SplitReduction is known to require a concrete additional buffer to store tempoaray information.
Add an option to introduce a `bufferization.alloc_tensor` instead of `linalg.init_tensor`.
This behaves better with subset-based tiling and bufferization.

Differential Revision: https://reviews.llvm.org/D128722
2022-06-30 03:32:23 -07:00
Sanjay Patel 7c4b90a98d [InstCombine] fix overzealous assert in icmp-shr fold
The assert was added with 0399473de8 and is correct for that
pattern, but it is off-by-1 with the enhancement in d4f39d8333.

The transforms are still correct with the new pre-condition:
https://alive2.llvm.org/ce/z/6_6ghm
https://alive2.llvm.org/ce/z/_GTBUt

And as shown in the new test, the transform is expected with
'ult' - in that case, the icmp reduces to test if the shift
amount is 0.
2022-06-30 06:28:48 -04:00
Nikita Popov 0445c340ff [ConstantFold] Support loads in ConstantFoldInstOperands()
This allows all constant folding to happen through a single
function, without requiring special handling for loads at each
call-site.

This may not be NFC because some callers currently don't do that
special handling.
2022-06-30 12:18:15 +02:00
LLVM GN Syncbot 364673dbe7 [gn build] Port cfb7ffdec0 2022-06-30 10:11:58 +00:00
LLVM GN Syncbot a5a3b5178d [gn build] Port 72cd6b6c83 2022-06-30 10:11:58 +00:00
Muhammad Omair Javaid 8b7f5ee5f0 [LLDB] Fix TestSTL.py Makefile to remove -gdwarf O0
This is a follow up to my previous commit where TestSTL.py got broken
due to 9c6e043592.
Now that we force dwarf symbols by default on windows we dont need to
specifically put -gdwarf O0 in debug flags for this test.
2022-06-30 14:06:21 +04:00
Sven van Haastregt 1d421e6e3b [OpenCL] Remove half scalar vload/vstore builtins
These are not mentioned in the OpenCL C Specification nor in the
OpenCL Extension Specification.

Differential Revision: https://reviews.llvm.org/D128434
2022-06-30 11:01:19 +01:00
Pavel Samolysov 3b7650da72 [Pipelines] Add a test how DCE works after ArgumentPromotion
The ArgumentPromotion pass uses Mem2Reg promotion at the end to cutting
down generated alloca instructions as well as meaningless stores and
this behavior can leave unused (dead) arguments.

The test shows that the arguments are not removed in the current
optimization pipeline.
2022-06-30 12:56:08 +03:00
Nikita Popov 1579fc62fe [Evaluator] Add missing LLVM_DEBUG()
Missed these in 41f0b6a781, resulting
in unconditional debug output.
2022-06-30 11:54:47 +02:00
Nikita Popov 54fcde42c0 [InlineCost] Simplify constant folding
Use a common ConstantFoldInstOperands-based constant folding
implementation, instead of specifying the folding function for
each function individually. Going through the generic handling
doesn't appear to have any significant compile-time impact.

As the test change shows, this is not NFC, because we now use
DataLayout-aware constant folding, which can do slightly better
in some cases (e.g. those involving GEPs).
2022-06-30 11:49:17 +02:00
Chen Zheng bb0896e96f add testcase for D127202, NFC 2022-06-30 05:40:34 -04:00
Chen Zheng b05801de35 [InlineFunction] Only check pointer arguments for a call
Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D128529
2022-06-30 05:39:47 -04:00
Muhammad Omair Javaid 5fe0da6d7b [LLDB] Fix TestSTL.py on Windows
TestSTL.py was broken by 9c6e043592.
This patch fixes it with changes to its Makefile.
2022-06-30 13:27:14 +04:00
Phoebe Wang abeeae570e [X86] Support `_Float16` on SSE2 and up
This is split from D113107 to address #56204 and https://discourse.llvm.org/t/how-to-build-compiler-rt-for-new-x86-half-float-abi/63366

Reviewed By: zahiraam, rjmccall, bkramer, MaskRay

Differential Revision: https://reviews.llvm.org/D128571
2022-06-30 17:21:37 +08:00
Nikita Popov 41f0b6a781 [Evaluator] Use ConstantFoldInstOperands()
For instructions that don't need any special handling, use
ConstantFoldInstOperands(), rather than re-implementing individual
cases.

This is probably not NFC because it can handle cases the previous
code missed (e.g. vector operations).
2022-06-30 11:10:17 +02:00
Nikita Popov a6d4b4138f [ConstantFold] Supports compares in ConstantFoldInstOperands()
Support compares in ConstantFoldInstOperands(), instead of
forcing the use of ConstantFoldCompareInstOperands(). Also handle
insertvalue (extractvalue was already handled).

This removes a footgun, where many uses of ConstantFoldInstOperands()
need a separate check for compares beforehand. It's particularly
insidious if called on a constant expression, because it doesn't
fail in that case, but will just not do DL-dependent folding.
2022-06-30 11:05:24 +02:00
Weining Lu ed7d351309 [LoongArch] Fix wrong function names in bstrpick_w.ll. NFC 2022-06-30 16:59:26 +08:00
Fraser Cormack d5213c83ff [RISCV] Add a test covering a (reverted) codegen issue
This test checks one of problematic cases outlined in D128006, leading
to the patch's reversal. I thought it best to add a test just in case
this sort of optimization is attempted again in the future in some
fashion.
2022-06-30 09:27:52 +01:00
Valentin Clement 411f839ae3
[flang] Fix for array upper bounds with *
Even though the array is declared with '*' upper bounds, it has an
initial value that has a statically known shape. Use the shape from
the type of the initializer when the declared size is '*'.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-06-30 10:37:22 +02:00
Valentin Clement c628e9eb5e
[flang][NFC] Add FIR array test
This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-06-30 10:36:18 +02:00
Amir Ayupov 66b01a8934 [BOLT] Fix getDynoStats to handle BCs with no functions
Address fuzzer crash

Reviewed By: yota9

Differential Revision: https://reviews.llvm.org/D120696
2022-06-30 01:18:45 -07:00
Florian Hahn 24b5f8e0d0
[VPlan] Make sure optimizeInductions removes wide ind from scalar plan.
In some cases, there may be widened users of inductions even though the
plan includes the scalar VF. In those cases, make sure we still replace
the VPWidenIntOrFpInductionRecipe with scalar steps, as otherwise we may
try to execute a VPWidenIntOrFpInductionRecipe with a scalar VF.

Alternatively the patch could also split the range if needed.

This fixes a crash exposed by D123720.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D128755
2022-06-30 09:11:48 +01:00
Valentin Clement 06d103ff95
[flang] Correct bug in literal CHARACTER constant names
The names of CHARACTER strings were being truncated leading to invalid
collisions and other failures. This change makes sure to use the entire
string as the seed for the unique name.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-06-30 10:10:37 +02:00
Matthias Springer 76f7e4b7a3 [mlir][SCF][bufferize][NFC] Utilize recently added helper function
This should have been part of D128666.

Differential Revision: https://reviews.llvm.org/D128885
2022-06-30 09:54:52 +02:00
Chuanqi Xu f595003e8e [NFC] [Modules] Add test for inherit default arguments 2022-06-30 15:48:22 +08:00