platform/upstream/llvm.git
14 months agoReland "[Driver] Support multi /guard: options"
Phoebe Wang [Thu, 18 May 2023 04:38:12 +0000 (12:38 +0800)]
Reland "[Driver] Support multi /guard: options"

Fixes unexpected warning.

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

14 months ago[ARM] Remove unused member variable MulCandidate::ReadOnly
Kazu Hirata [Sat, 20 May 2023 06:32:42 +0000 (23:32 -0700)]
[ARM] Remove unused member variable MulCandidate::ReadOnly

The last use was removed by:

  commit a33e311a3b96086248cf347222f18e14e7adcf84
  Author: Sam Parker <sam.parker@arm.com>
  Date:   Mon May 13 09:23:32 2019 +0000

14 months ago[Hexagon] Remove unused declaration getModuleMatchQuality
Kazu Hirata [Sat, 20 May 2023 06:29:09 +0000 (23:29 -0700)]
[Hexagon] Remove unused declaration getModuleMatchQuality

getModuleMatchQuality was removed by:

  commit c3719c36e61f6ac28fc1e12587131bcae6581671
  Author: Daniel Dunbar <daniel@zuster.org>
  Date:   Sun Aug 2 23:37:13 2009 +0000

The Hexagon port was later added with getModuleMatchQuality by:

  commit 1213a7a57fdcb6c875b3f79103fc96d3e9d30b40
  Author: Tony Linthicum <tlinth@codeaurora.org>
  Date:   Mon Dec 12 21:14:40 2011 +0000

While we are at it, this patch removes a reference to
getModuleMatchQuality in the documentation.

14 months ago[Hexagon] Remove unused declaration constToFloat
Kazu Hirata [Sat, 20 May 2023 05:49:37 +0000 (22:49 -0700)]
[Hexagon] Remove unused declaration constToFloat

The declaration was added without a corresponding function definition
by:

  commit 167d918225ecd05a63f6b8d449c317feda741e18
  Author: Krzysztof Parzyszek <kparzysz@codeaurora.org>
  Date:   Thu Jul 28 20:01:59 2016 +0000

14 months ago[Hexagon] Remove unused declaration WidenHvxFpIntConv
Kazu Hirata [Sat, 20 May 2023 05:49:35 +0000 (22:49 -0700)]
[Hexagon] Remove unused declaration WidenHvxFpIntConv

The declaration was added without a corresponding function definition
by:

  commit 94a71361d6ada8a0e25817fe8ebe443092677e6c
  Author: Krzysztof Parzyszek <kparzysz@quicinc.com>
  Date:   Fri Sep 2 12:04:49 2022 -0700

14 months ago[Hexagon] Remove unused declaration LowerHvxSetCC
Kazu Hirata [Sat, 20 May 2023 05:49:34 +0000 (22:49 -0700)]
[Hexagon] Remove unused declaration LowerHvxSetCC

The corresponding function definition was removed by:

  commit 88f11003a091219b01f234bf9f1cea11c40f808d
  Author: Krzysztof Parzyszek <kparzysz@codeaurora.org>
  Date:   Tue Feb 6 14:24:57 2018 +0000

14 months ago[BPF] Remove unused declaration PreprocessCopyToReg
Kazu Hirata [Sat, 20 May 2023 05:49:32 +0000 (22:49 -0700)]
[BPF] Remove unused declaration PreprocessCopyToReg

The corresponding function definition was removed by:

  commit ec51851026a55e1cfc7f006f0e75f0a19acb32d3
  Author: Jiong Wang <wong.kwongyuan.tools@gmail.com>
  Date:   Wed Oct 16 15:27:59 2019 +0000

14 months ago[ARM] Remove unused declaration CreateParallelPairs
Kazu Hirata [Sat, 20 May 2023 05:49:31 +0000 (22:49 -0700)]
[ARM] Remove unused declaration CreateParallelPairs

The declaration was added without a corresponding function definition
by:

  commit 85ad78b1cfa3932eb658365b74f5b08c25dbfb0e
  Author: Sam Parker <sam.parker@arm.com>
  Date:   Thu Jul 11 07:47:50 2019 +0000

14 months agoRevert "InstSimplify: Use isKnownNeverInfOrNaN"
Alina Sbirlea [Fri, 19 May 2023 22:54:54 +0000 (15:54 -0700)]
Revert "InstSimplify: Use isKnownNeverInfOrNaN"

This reverts commit 494dee0f7a7701a57f7c5b755b4133844d0dcbdf.
Related to the other reverts, causes test failure due to nan/inf
mismatch.

14 months ago[SLP] Cleanup: Remove `tryToVectorizePair()`, most probably NFC
Vasileios Porpodas [Fri, 19 May 2023 21:32:12 +0000 (14:32 -0700)]
[SLP] Cleanup: Remove `tryToVectorizePair()`, most probably NFC

`tryToVectorizePair()` adds a level of indirection over `tryToVectorizeList()`.
I am not really sure why it is needed, it looks redundant.

I replaced all calls to `tryToVectorizePair()` with calls to
`tryToVectorizeList()` and I am not seeing any failures.

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

14 months ago[X86] Remove patterns for IMUL with immediate 8 and optimize during MC lowering,...
Shengchen Kan [Sat, 20 May 2023 02:50:49 +0000 (10:50 +0800)]
[X86] Remove patterns for IMUL with immediate 8 and optimize during MC lowering, NFCI

14 months ago[lldb] Fix process pid parsing issue
Med Ismail Bennani [Sat, 20 May 2023 03:07:43 +0000 (20:07 -0700)]
[lldb] Fix process pid parsing issue

This patch should fix an issue when parsing the process pid and setting
it in the scripted process.

It can happen that the `crashlog.process_id` attribute is sometimes
parsed as a string. That would cause the scripted process to pick the
default value (0).

To address that, this patch makes sure that the parsed attributed is
converted to the integer type before passing it to the scripted process.

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

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
14 months ago[lldb/crashlog] Load inlined symbol into interactive crashlog
Med Ismail Bennani [Sat, 20 May 2023 03:05:05 +0000 (20:05 -0700)]
[lldb/crashlog] Load inlined symbol into interactive crashlog

Sometimes, crash reports come with inlined symbols. These provide the
exact stacktrace from the user binary.

However, when investigating a crash, it's very likely that the images related
to the crashed thread are not available on the debugging user system or
that the versions don't match. This causes interactive crashlog to show
a degraded backtrace in lldb.

This patch aims to address that issue, by parsing the inlined symbols
from the crash report and load them into lldb's target.

This patch is a follow-up to 27f27d1, focusing on inlined symbols
loading from legacy (non-json) crash reports.

To do so, it updates the stack frame regular expression to make the
capture groups more granular, to be able to extract the symbol name, the
offset and the source location if available, while making it more
maintainable.

So now, when parsing the crash report, we build a data structure
containing all the symbol information for each stackframe. Then, after
launching the scripted process for interactive mode, we write a JSON
symbol file for each module, only containing the symbols that it contains.

Finally, we load the json symbol file into lldb, before showing the user
the process status and backtrace.

rdar://97345586

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

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
14 months ago[NFC][CLANG] Fix issue with dereference null return value found by Coverity static...
Manna, Soumi [Sat, 20 May 2023 02:41:27 +0000 (19:41 -0700)]
[NFC][CLANG] Fix issue with dereference null return value found by Coverity static analyzer tool

Reported by Coverity:

  In clang::FunctionDecl::isReplaceableGlobalAllocationFunction(std::optional<unsigned int> *, bool *): Return value of function which returns null is dereferenced without checking

  if (!IsSizedDelete && !Ty.isNull() && Ty->isEnumeralType()) {
       QualType T = Ty;
       //Condition TD, taking false branch.
      while (const auto *TD = T->getAs<TypedefType>())
        T = TD->getDecl()->getUnderlyingType();
        //returned_null: getAs returns nullptr (checked 95 out of 97 times).

      //Dereference null return value (NULL_RETURNS)
      // dereference: Dereferencing a pointer that might be nullptr T->getAs() when calling getDecl.
      IdentifierInfo *II = T->getAs<EnumType>()->getDecl()->getIdentifier();
      if (II && II->isStr("__hot_cold_t"))
        Consume();
    }

This patch uses castAs instead of getAs which will assert if the type doesn't match.

Reviewed By: erichkeane

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

14 months ago[BOLT] Add isParentOf and isParentOrChildOf BF checks
Amir Ayupov [Fri, 19 May 2023 18:33:21 +0000 (11:33 -0700)]
[BOLT] Add isParentOf and isParentOrChildOf BF checks

Add helper methods and simplify cases where we want to check if two functions
are parent-child of each other (function-fragment relationship).

Reviewed By: #bolt, rafauler

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

14 months ago[BOLT][NFC] Extract DataAggregator::parseLBRSample
Amir Ayupov [Fri, 19 May 2023 18:20:11 +0000 (11:20 -0700)]
[BOLT][NFC] Extract DataAggregator::parseLBRSample

Reviewed By: #bolt, rafauler

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

14 months ago[mlir][sparse][gpu] recognize SpMM cuSparse during sparsification
Aart Bik [Tue, 16 May 2023 20:34:28 +0000 (13:34 -0700)]
[mlir][sparse][gpu] recognize SpMM cuSparse during sparsification

Reviewed By: Peiming

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

14 months ago[mlir][sparse][gpu] derive type of cuSparse op
Aart Bik [Fri, 19 May 2023 23:08:37 +0000 (16:08 -0700)]
[mlir][sparse][gpu] derive type of cuSparse op

This no longer assumes just F64 output.

Note, however, that it will be cleaner to carry the data type in the corresponding operation (rather than tracking operands). That will also allow for mixed type cases, where operands and result type are different

This will be done in a follow revision where the result type is carried by the SpMV/SpMM op itself (and friends).

Reviewed By: Peiming

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

14 months ago[mlir][sparse] Improving error-detection for `STEA::get{Pos,Crd}Type`
wren romano [Fri, 19 May 2023 20:29:55 +0000 (13:29 -0700)]
[mlir][sparse] Improving error-detection for `STEA::get{Pos,Crd}Type`

Reviewed By: aartbik

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

14 months ago[MLIR][TOSA] add tosa erf operator
Manupa Karunaratne [Fri, 19 May 2023 00:10:25 +0000 (17:10 -0700)]
[MLIR][TOSA] add tosa erf operator

This commit adds tosa erf operator and its lowering
to math lib functions.

Reviewed By: eric-k256, jpienaar

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

14 months agoValueTracking: Add baseline tests for some assume handling
Matt Arsenault [Wed, 19 Apr 2023 01:46:29 +0000 (21:46 -0400)]
ValueTracking: Add baseline tests for some assume handling

14 months agoFix broken C++ mode comment
Matt Arsenault [Fri, 19 May 2023 16:58:06 +0000 (17:58 +0100)]
Fix broken C++ mode comment

14 months agoGlobalISel: Move fconstant matching into tablegen
Matt Arsenault [Tue, 9 May 2023 10:57:27 +0000 (11:57 +0100)]
GlobalISel: Move fconstant matching into tablegen

I don't really understand what the point of wip_match_opcode is.
It doesn't seem to have any purpose other than to list opcodes
to have all the logic in pure C++. You can't seem to  use it to
select multiple opcodes in the same way you use match.

Something is wrong with it, since the match emitter prints
"errors" if an opcode is covered by wip_match_opcode and
then appears in another pattern. For exmaple with this patch,
you see this several times in the build:

  error: Leaf constant_fold_fabs is unreachable
  note: Leaf idempotent_prop will have already matched

The combines are actually produced and the tests for them
do pass, so this seems to just be a broken warning.

14 months ago[clang][AST] Propagate the value-dependent bit for VAArgExpr.
Haojian Wu [Fri, 19 May 2023 10:00:38 +0000 (12:00 +0200)]
[clang][AST] Propagate the value-dependent bit for VAArgExpr.

Fixes https://github.com/llvm/llvm-project/issues/62711

We never set the value-dependent bit for the VAArgExpr before this
patch, this was fine becase the dependent-type TypoExpr was always
resolved before checking the operands (see https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaExpr.cpp#L21173-L21180)

Now we have enabled the dependence by default for C, the typo expr is
not early resolved before checking rather than delayed (share the same
codepath with C++).

The fix is to propagate the value-dependent bit for VAArgExpr where it contains
a TypoExpr, so that the AST node can be handled properly.

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

14 months ago[bazel] Rework zlib dependency
Aaron Siddhartha Mondal [Fri, 19 May 2023 21:03:46 +0000 (23:03 +0200)]
[bazel] Rework zlib dependency

Switches the library to use the zlib-ng implementation since the
original implementation is warning-incompatible with recent versions of clang.

Removes the wrapper logic for zlib in the bazel build and introduces new
logic to handle `LLVM_ENABLE_ZLIB`.

Removes the `BAZEL_LLVM_ZLIB_STRATEGY` environment variable and instead
introduces a boolean `--@llvm_zlib//:llvm_enable_zlib` flag which defaults
to true.

To migrate:
    * The previous "external" strategy is the default. May be explicitly
      enabled with `--@llvm_zlib//:llvm_enable_zlib=true`. For custom zlib
      variants you can use the BUILD file at `third_party_build/zlib.BUILD`
      as reference and adjust the `@llvm_zlib` archive in the `WORKSPACE`
      directly.
    * The previous "disable" strategy may be enabled with
      `--@llvm_zlib//:llvm_enable_zlib=false`.
    * The previous "system" strategy has been removed since it breaks
      hermeticity. If you need the "system" setup, use the "external"
      strategy and override the zlib dependency.

Addresses breakages of downstream projects using upstream clang and the
previously "external" zlib strategy (D141553).

Reviewed By: MaskRay, GMNGeoffrey

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

14 months ago[AMDGPU] Rewrite device ctor / dtor handling to use .init / .fini sections
Joseph Huber [Tue, 16 May 2023 14:52:26 +0000 (09:52 -0500)]
[AMDGPU] Rewrite device ctor / dtor handling to use .init / .fini sections

Currently, AMDGPU has special handling for constructors and destructors.
We manuall emit a kernel that calls the functoins listed in the global
constructor / destructor list. This currently has two main problems. The
first is that we do not repsect the priortiy and simply call them in any
order. The second is that we redefine the symbol unconditionally which
coulid have a different definition, meaning we cannot merge any code
with a constructor post-codegen. This patch changes the handling to
instead use the standard support for travering the `.init_array` and
`.fini_array` sections the compiler creates. This allows us to emit a
single kernel with `odr` semantics, so even if we emit this multiple
times they will be merged into a single kernel.

Reviewed By: arsenm

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

14 months ago[RISCV] Simplify and improve getLMULCost.
Craig Topper [Fri, 19 May 2023 21:09:50 +0000 (14:09 -0700)]
[RISCV] Simplify and improve getLMULCost.

Use divideCeil for fixed vectors which avoids the need for a std::max
with 1 and should be more correct for odd sized vectors if those
occur.

Use conditional operator instead of an if/else.

14 months ago[mlir][Vector] Extend xfer_read(extract)->scalar load to support multiple uses
Diego Caballero [Fri, 19 May 2023 19:45:06 +0000 (19:45 +0000)]
[mlir][Vector] Extend xfer_read(extract)->scalar load to support multiple uses

This patch extends the vector.extract(vector.transfer_read) -> scalar
load patterns to support vector.transfer_read with multiple uses. For
now, we check that all the uses are vector.extract operations.
Supporting multiple uses is predicated under a flag.

Reviewed By: hanchung

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

14 months agoFix quadratic behavior from Operation::setAttr() (NFC)
Mehdi Amini [Fri, 19 May 2023 20:08:33 +0000 (13:08 -0700)]
Fix quadratic behavior from Operation::setAttr()  (NFC)

This API tries to ensure some backward compatibility for properties,
but doing so in multiple-layers was causing quadratic behavior.
Instead of `setAttrs()` repeatingly calling to `setAttr()` we inline
the logic and apply it locally in a single traversal.

Fixes #62800

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

14 months ago[libc++] Fix issue with std::map::find in Objective-C++ with modules
Louis Dionne [Thu, 18 May 2023 17:26:06 +0000 (10:26 -0700)]
[libc++] Fix issue with std::map::find in Objective-C++ with modules

This works around an issue with modules where Clang complains that
it doesn't know about `coroutine_handle<>` when trying to write very
basic code using std::map::find.

rdar://106813461

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

14 months ago[clang][CodeGen] Break up TargetInfo.cpp [5/8]
Sergei Barannikov [Sat, 29 Apr 2023 16:37:32 +0000 (19:37 +0300)]
[clang][CodeGen] Break up TargetInfo.cpp [5/8]

Make `occupiesMoreThan` a protected member of `SwiftABIInfo`.
This method is only used by implementations of `SwiftABIInfo`.
Making it protected will allow to use it after the implementations
are moved to dedicated cpp files.

Reviewed By: efriedma

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

14 months ago[clang][CodeGen] Break up TargetInfo.cpp [4/8]
Sergei Barannikov [Sat, 29 Apr 2023 15:22:44 +0000 (18:22 +0300)]
[clang][CodeGen] Break up TargetInfo.cpp [4/8]

Remove `getABIInfo` overrides returning references to target-specific
implementations of `ABIInfo`.
The methods may be convenient, but they are only used in one place and
prevent from `ABIInfo` implementations from being put into anonymous
namespaces in different cpp files.

Reviewed By: efriedma

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

14 months ago[clang][CodeGen] Break up TargetInfo.cpp [3/8]
Sergei Barannikov [Sat, 29 Apr 2023 15:08:49 +0000 (18:08 +0300)]
[clang][CodeGen] Break up TargetInfo.cpp [3/8]

Don't derive from `DefaultTargetCodeGenInfo`.
This class is going to stay in `TargetInfo.cpp`, whereas its derivants
are going to be moved to separate translation units. Just derive from
the base `TargetCodeGenInfo` class instead.

Reviewed By: efriedma

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

14 months ago[clang][CodeGen] Break up TargetInfo.cpp [2/8]
Sergei Barannikov [Sat, 29 Apr 2023 15:08:23 +0000 (18:08 +0300)]
[clang][CodeGen] Break up TargetInfo.cpp [2/8]

Move `ABIKind` enums out of `*ABIInfo` classes to break the dependency
between `getTargetCodeGenInfo` and the classes.
This will allow to move the classes to different cpp files.

Reviewed By: efriedma

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

14 months ago[clang][CodeGen] Break up TargetInfo.cpp [1/8]
Sergei Barannikov [Sat, 29 Apr 2023 15:07:37 +0000 (18:07 +0300)]
[clang][CodeGen] Break up TargetInfo.cpp [1/8]

`CCState` is a helper class originally used by the x86 implementation
but has since been abused by other implementations.
Remove this dependency by implementing customized versions of the class
for implementations that need such functionality.

Reviewed By: efriedma, MaskRay

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

14 months ago[RegScavenger] Change scavengeRegister to pick registers in allocation order
Jay Foad [Wed, 17 May 2023 11:57:14 +0000 (12:57 +0100)]
[RegScavenger] Change scavengeRegister to pick registers in allocation order

This matches what scavengeRegisterBackwards does.

This is in preparation for converting most uses of scavengeRegister to
scavengeRegisterBackwards, to reduce test case churn when that lands and
to help with bisection if anything goes wrong.

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

14 months ago[mlir][arith] Fold `or(x, xor(x, 1))` -> `1`
Ivan Butygin [Wed, 17 May 2023 18:22:27 +0000 (20:22 +0200)]
[mlir][arith] Fold `or(x, xor(x, 1))` -> `1`

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

14 months ago[GVN] Do not combine convergent calls in GVN/NewGVN
Jay Foad [Fri, 19 May 2023 15:33:19 +0000 (16:33 +0100)]
[GVN] Do not combine convergent calls in GVN/NewGVN

Note that this is very conservative since it will not even combine
convergent calls that appear in the same basic block, but EarlyCSE will
handle that case.

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

14 months ago[AMDGPU] Fix odd implicit operand handling in clause breaking
Jay Foad [Fri, 19 May 2023 09:29:32 +0000 (10:29 +0100)]
[AMDGPU] Fix odd implicit operand handling in clause breaking

By inspection. Because of the strange behaviour of MI.uses(), this was
adding implicit defs to the clause *uses* set, and then wrongly
detecting a conflict between explicit defs and implicit defs.

For example it would detect a conflict on this pair of instructions:

   $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr0_sgpr1_sgpr2_sgpr3, 0, 4088, 0, 0, implicit $exec, implicit-def $vgpr0_vgpr1 :: (load (s32) from %stack.1, addrspace 5)
   $vgpr1 = BUFFER_LOAD_DWORD_OFFSET $sgpr0_sgpr1_sgpr2_sgpr3, 0, 4092, 0, 0, implicit $exec, implicit-def $vgpr0_vgpr1 :: (load (s32) from %stack.1 + 4, addrspace 5)

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

14 months ago[SelectionDAGBuilder] Use getPtrExtOrTrunc in place of getZExtOrTrunc. NFC
Craig Topper [Fri, 19 May 2023 20:08:39 +0000 (13:08 -0700)]
[SelectionDAGBuilder] Use getPtrExtOrTrunc in place of getZExtOrTrunc. NFC

This getZExtOrTrunc seems to have been added when getPtrExtOrTrunc
was introduced. getPtrExtOrTrunc is currently equivalent to getZExtOrTrunc,
but could be changed for some target in the future.

Reviewed By: t.p.northover

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

14 months ago[lldb][NFCI] Consolidate segment names in ObjectFileMachO
Alex Langford [Fri, 19 May 2023 20:00:14 +0000 (13:00 -0700)]
[lldb][NFCI] Consolidate segment names in ObjectFileMachO

We have static functions for each one, we should use them where it makes
sense.

14 months ago[mlir][sparse] Updating STEA documentation examples to use "lvlTypes"
wren romano [Fri, 19 May 2023 00:26:50 +0000 (17:26 -0700)]
[mlir][sparse] Updating STEA documentation examples to use "lvlTypes"

Followup to D150330.

Reviewed By: aartbik

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

14 months ago[mlir][sparse][gpu] add SpMM to GPU ops dialect
Aart Bik [Mon, 15 May 2023 21:55:45 +0000 (14:55 -0700)]
[mlir][sparse][gpu] add SpMM to GPU ops dialect

Reviewed By: ThomasRaoux, K-Wu

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

14 months ago[test] Make mut-rec-scc.ll a bit more robust
Arthur Eubanks [Fri, 19 May 2023 19:25:05 +0000 (12:25 -0700)]
[test] Make mut-rec-scc.ll a bit more robust

By adding noinline

Also make the SCC have 3 functions to prevent test changes with an upcoming change.

14 months ago[clang] Convert a few tests to opaque pointers
Sergei Barannikov [Thu, 18 May 2023 17:47:14 +0000 (20:47 +0300)]
[clang] Convert a few tests to opaque pointers

Reviewed By: nikic

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

14 months ago[Hexagon] Clone dependencies instead of moving in HVC
Krzysztof Parzyszek [Fri, 19 May 2023 01:58:59 +0000 (18:58 -0700)]
[Hexagon] Clone dependencies instead of moving in HVC

Loads can share dependencies, and moving them for each load separately
can end up placing them in a wrong location. There was already a check
for that, but it wasn't correct.
Instead of trying to find the right location for all moved instructions
at once, create clones for each individual load.

14 months agoFix typo in comment: @{ -> @}
Krzysztof Parzyszek [Fri, 19 May 2023 00:34:22 +0000 (17:34 -0700)]
Fix typo in comment: @{ -> @}

14 months ago[Hexagon] Add more comments to HexagonVectorCombine.cpp, NFC
Krzysztof Parzyszek [Fri, 19 May 2023 00:27:59 +0000 (17:27 -0700)]
[Hexagon] Add more comments to HexagonVectorCombine.cpp, NFC

14 months ago[libc] Fix test failing on the GPU due to undefined floating point type
Joseph Huber [Fri, 19 May 2023 17:46:18 +0000 (12:46 -0500)]
[libc] Fix test failing on the GPU due to undefined floating point type

We got build failures due to the handling here, explicitly set the type.

Reviewed By: sivachandra

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

14 months ago[CUDA] provide wrapper functions for new NVCC builtins.
Artem Belevich [Thu, 18 May 2023 18:09:58 +0000 (11:09 -0700)]
[CUDA] provide wrapper functions for new NVCC builtins.

For sm_80 NVCC introduced a handful of builtins with the names that deviate from
the historic __nvvm_/__nv naming convention. Clang/LLVM does provide equivalent
builtins, but using different names. This patch maps NVCC-style builtins to
their clang counterparts.

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

14 months ago[clang][RecoveryExpr] Fix a crash where a dependent type crahes on c-only code path.
Haojian Wu [Fri, 19 May 2023 09:35:43 +0000 (11:35 +0200)]
[clang][RecoveryExpr] Fix a crash where a dependent type crahes on c-only code path.

A depenent type is possible in C-only path, add a proper handling when
checking the enum constant.

Fixes https://github.com/llvm/llvm-project/issues/62446

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

14 months ago[AMDGPU] Remove function if FeatureWavefrontSize 32 is not supported on current GPU
skc7 [Fri, 21 Apr 2023 08:43:47 +0000 (14:13 +0530)]
[AMDGPU] Remove function if FeatureWavefrontSize 32 is not supported on current GPU

Reviewed By: arsenm, b-sumner

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

14 months ago[NVPTX/CUDA] added an optional src_size argument to __nvvm_cp_async*
Artem Belevich [Wed, 17 May 2023 21:41:47 +0000 (14:41 -0700)]
[NVPTX/CUDA] added an optional src_size argument to __nvvm_cp_async*

The optional argument is needed for CUDA-11+ headers when we're compiling for
sm_80+ GPUs.

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

14 months ago[AMDGPU] Fix warnings
Kazu Hirata [Fri, 19 May 2023 17:56:22 +0000 (10:56 -0700)]
[AMDGPU] Fix warnings

This patch fixes warnings like:

  llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h:711: warning:
  enumerated and non-enumerated type in conditional expression

14 months agoRelax test
Adrian Prantl [Fri, 19 May 2023 17:51:43 +0000 (10:51 -0700)]
Relax test

14 months ago[BOLT][CMake] Use correct output paths and passthrough necessary options
Petr Hosek [Wed, 17 May 2023 05:41:42 +0000 (05:41 +0000)]
[BOLT][CMake] Use correct output paths and passthrough necessary options

This addresses https://github.com/llvm/llvm-project/issues/62748.

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

14 months ago[mlir][sparse] Support packing external data into arbitrary sparse tensor encoding.
Peiming Liu [Tue, 16 May 2023 22:16:21 +0000 (22:16 +0000)]
[mlir][sparse] Support packing external data into arbitrary sparse tensor encoding.

We previously only support packing two array (values and coordinates) into COO tensors.
This patch allows packing inputs into arbitrary sparse tensor format.

It also deletes the "implicit" data canonicalization performed inside sparse compiler,
but instead requires users to canonicalize the data before passing it to the sparse compiler.

Reviewed By: aartbik

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

14 months agoFix tests failure on 75993812d5c1f269b781c34987748f2a792a579d
Zequan Wu [Fri, 19 May 2023 17:34:29 +0000 (13:34 -0400)]
Fix tests failure on 75993812d5c1f269b781c34987748f2a792a579d

It follows the rules:
1. Use native path if it's already absolute
2. Use Windows back-slash if it's windows formatting.
3. Use Posix style otherwise.

14 months ago[SLP][NFC] Cleanup: Remove KeyNodes set.
Vasileios Porpodas [Fri, 5 May 2023 22:33:39 +0000 (15:33 -0700)]
[SLP][NFC] Cleanup: Remove KeyNodes set.

I don't see a good reason form having the `KeyNodes` set.
This patch removes the set.

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

14 months agoWork around a modularization issue in the Python headers.
Adrian Prantl [Fri, 19 May 2023 17:22:27 +0000 (10:22 -0700)]
Work around a modularization issue in the Python headers.

14 months ago[NFC][CLANG] Fix dereference issue before null check found by Coverity static analyze...
Manna, Soumi [Fri, 19 May 2023 17:05:45 +0000 (10:05 -0700)]
[NFC][CLANG] Fix dereference issue before null check found by Coverity static analyzer tool

Reported by Coverity static analyzer tool:

Inside "ParsePragma.cpp" file, in <unnamed>::PragmaRISCVHandler::HandlePragma(clang::Preprocessor &, clang::PragmaIntroducer, clang::Token &): All paths that lead to this null pointer comparison already dereference the pointer earlier

  PP.Lex(Tok);
  II = Tok.getIdentifierInfo();
  //deref_ptr_in_call: Dereferencing pointer II.
  StringRef IntrinsicClass = II->getName();

    //Dereference before null check (REVERSE_INULL)
    //check_after_deref: Null-checking II suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    if (!II || !(II->isStr("vector") || II->isStr("sifive_vector"))) {
      PP.Diag(Tok.getLocation(), diag::warn_pragma_invalid_argument)
          << PP.getSpelling(Tok) << "riscv" << /*Expected=*/true
          << "'vector' or 'sifive_vector'";
      return;
  }

This patch removes redundant StringRef type 'IntrinsicClass' and checks
II->isStr("vector") || II->isStr("sifive_vector") instead to set Actions.DeclareRISCVVBuiltins or
Actions.DeclareRISCVVectorBuiltins.

Reviewed By: erichkeane

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

14 months ago[VPlan] Use isUniformAfterVec in VPReplicateRecipe::execute.
Florian Hahn [Fri, 19 May 2023 17:15:20 +0000 (18:15 +0100)]
[VPlan] Use isUniformAfterVec in VPReplicateRecipe::execute.

I was unable to find a case where this actually changes generated code,
but it enables the bug fix in D144434. It also brings codegen in line
with the handling of stores to uniform addresses in the cost model
(D134460).

Reviewed By: Ayal

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

14 months ago[1/11][IR] Permit load/store/alloca for struct of the same scalable vector type
eopXD [Thu, 23 Mar 2023 08:51:39 +0000 (01:51 -0700)]
[1/11][IR] Permit load/store/alloca for struct of the same scalable vector type

This patch-set aims to simplify the existing RVV segment load/store
intrinsics to use a type that represents a tuple of vectors instead.

To achieve this, first we need to relax the current limitation for an
aggregate type to be a target of load/store/alloca when the aggregate
type contains homogeneous scalable vector types. Then to adjust the
prolog of an LLVM function during lowering to clang. Finally we
re-define the RVV segment load/store intrinsics to use the tuple types.

The pull request under the RVV intrinsic specification is
riscv-non-isa/rvv-intrinsic-doc#198

---

This is the 1st patch of the patch-set. This patch is originated from
D98169.

This patch allows aggregate type (StructType) that contains homogeneous
scalable vector types to be a target of load/store/alloca. The RFC of
this patch was posted in LLVM Discourse.

https://discourse.llvm.org/t/rfc-ir-permit-load-store-alloca-for-struct-of-the-same-scalable-vector-type/69527

The main changes in this patch are:

Extend `StructLayout::StructSize` from `uint64_t` to `TypeSize` to
accommodate an expression of scalable size.

Allow `StructType:isSized` to also return true for homogeneous
scalable vector types.

Let `Type::isScalableTy` return true when `Type` is `StructType`
and contains scalable vectors

Extra description is added in the LLVM Language Reference Manual on the
relaxation of this patch.

Authored-by: Hsiangkai Wang <kai.wang@sifive.com>
Co-Authored-by: eop Chen <eop.chen@sifive.com>
Reviewed By: craig.topper, nikic

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

14 months agoReword diagnostic for style; NFC
Aaron Ballman [Fri, 19 May 2023 16:37:44 +0000 (12:37 -0400)]
Reword diagnostic for style; NFC

Clang diagnostics do not start with a capital letter.

14 months ago[PowerPC][lit] Recognize triple ppc64le.*-linux
Tulio Magno Quites Machado Filho [Fri, 19 May 2023 15:15:00 +0000 (12:15 -0300)]
[PowerPC][lit] Recognize triple ppc64le.*-linux

Some Linux distributions, e.g. Red Hat, use the triple
ppc64le-redhat-linux. Add a pattern that treats ppc64le.*-linux as
powerpc64le-linux during test execution.

Reviewed By: qiucf

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

14 months ago[libc++] Install GCC 13 in the docker containers
Nikolas Klauser [Wed, 17 May 2023 01:24:16 +0000 (18:24 -0700)]
[libc++] Install GCC 13 in the docker containers

Reviewed By: ldionne, #libc, Mordante

Spies: Mordante, libcxx-commits, arichardson

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

14 months ago[Clang][clang-cl] Implement `__builtin_FUNCSIG`
Jakub Mazurkiewicz [Fri, 19 May 2023 15:57:49 +0000 (11:57 -0400)]
[Clang][clang-cl] Implement `__builtin_FUNCSIG`

This patch implements __builtin_FUNCSIG intrinsic which returns the same string as __FUNCSIG__.

Fixes https://github.com/llvm/llvm-project/issues/58951
Differential Revision: https://reviews.llvm.org/D150183

14 months ago[flang][hlfir] Use complete form of DesignateOp for im/re array designators.
Slava Zakharin [Fri, 19 May 2023 15:21:35 +0000 (08:21 -0700)]
[flang][hlfir] Use complete form of DesignateOp for im/re array designators.

With this change, the lowering provides full slice triples for
designators like ...%array_comp%im/re, so that the codegen
does not have to figure it out for the array_comp.
Basically, ...%array_comp%im/re is lowered the same way
as ...%array_comp(:,:,...)%im/re.

Reviewed By: jeanPerier

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

14 months ago[AMDGPU][AsmParser] Refine parsing of some 32-bit instruction operands.
Ivan Kosarev [Fri, 19 May 2023 15:28:34 +0000 (16:28 +0100)]
[AMDGPU][AsmParser] Refine parsing of some 32-bit instruction operands.

Eliminates the need for the custom code in parseCustomOperand().

The remaining uses of NamedOperandU32 are to be addressed separately.

Part of <https://github.com/llvm/llvm-project/issues/62629>.

Reviewed By: dp

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

14 months ago[GVN] Precommit tests for convergent calls in GVN/NewGVN
Jay Foad [Fri, 19 May 2023 14:51:04 +0000 (15:51 +0100)]
[GVN] Precommit tests for convergent calls in GVN/NewGVN

14 months ago[AArch64][GlobalISel] Selection support for v8s8, v4s16, v16s8 G_INSERT_VECTOR_ELT...
Vladislav Dzhidzhoev [Wed, 22 Mar 2023 13:14:16 +0000 (14:14 +0100)]
[AArch64][GlobalISel] Selection support for v8s8, v4s16, v16s8 G_INSERT_VECTOR_ELT with GPR scalar

This is to support some NEON intrinsics on GlobalISel.

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

14 months ago[CLANG][AArch64][SVE2.1] Add UCLAMP/SCLAMP/FCLAMP function prototypes
Caroline Concatto [Fri, 19 May 2023 14:40:23 +0000 (14:40 +0000)]
[CLANG][AArch64][SVE2.1] Add UCLAMP/SCLAMP/FCLAMP function prototypes

Submitting this patch in the name of: David Sherwood <david.sherwood@arm.com>

Reviewed By: sdesmalen

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

14 months ago[flang][hlfir] Added a TODO note for parameterized array component shapes.
Slava Zakharin [Fri, 19 May 2023 15:11:22 +0000 (08:11 -0700)]
[flang][hlfir] Added a TODO note for parameterized array component shapes.

Without the TODO, MLIR verifier fails because of invalid hlfir.declare
or fir.alloca that lowering produces.

Reviewed By: clementval

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

14 months ago[libc++][format] Improves fill character.
Mark de Wever [Thu, 9 Feb 2023 20:38:42 +0000 (21:38 +0100)]
[libc++][format] Improves fill character.

The main change is to allow a UCS scalar value as fill character.
Especially for char based formatting this increase the number of valid
characters. Originally this was to be expected ABI breaking, however the
current change does not seem to break the ABI.

Implements
- P2572 std::format() fill character allowances

Depends on D144499

Reviewed By: ldionne, tahonermann, #libc

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

14 months ago[asan] Don't use libstdc++ in test
Alex Brachet [Fri, 19 May 2023 15:17:59 +0000 (15:17 +0000)]
[asan] Don't use libstdc++ in test

It shouldn't be assumed that libstdc++ is always available even on Linux.
Just let the compiler pick the default

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

14 months ago[GVN] Fix test case for convergent calls
Jay Foad [Fri, 19 May 2023 15:11:41 +0000 (16:11 +0100)]
[GVN] Fix test case for convergent calls

Without "willreturn" this did not get as far as testing the convergent
handling in GVN.

14 months agoAllow -fsanitize=function on all targets
Fangrui Song [Fri, 19 May 2023 14:59:37 +0000 (07:59 -0700)]
Allow -fsanitize=function on all targets

Functions instrumented with -fsanitize=function have two words before
the function label: a signature and a RTTI proxy.
Instrumented call sites check the signature first to skip checks
for uninstrumented callees.

The code is generic and works for all targets supporting C++ RTTI.
Change clangDriver to allow all targets. Add tests for Armv8.5
Branch Target Identification and `-fpatchable-function-entry=`.

Reviewed By: peter.smith

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

14 months agoChange -fsanitize=function to place two words before the function entry
Fangrui Song [Fri, 19 May 2023 14:50:29 +0000 (07:50 -0700)]
Change -fsanitize=function to place two words before the function entry

The current implementation of -fsanitize=function places two words (the prolog
signature and the RTTI proxy) at the function entry, which makes the feature
incompatible with Intel Indirect Branch Tracking (IBT) that needs an ENDBR instruction
at the function entry. To allow the combination, move the two words before the
function entry, similar to -fsanitize=kcfi.

Armv8.5 Branch Target Identification (BTI) has a similar requirement.

Note: for IBT and BTI, whether a function gets a marker instruction at the entry
generally cannot be assumed (it can be disabled by a function attribute or
stronger LTO optimizations).

It is extremely unlikely for two words preceding a function entry to be
inaccessible. One way to achieve this is by ensuring that a function is
aligned at a page boundary and making the preceding page unmapped or
unreadable. This is not reasonable for application or library code.
(Think: the first text section has crt* code not instrumented by
-fsanitize=function.)

We use 0xc105cafe for all targets. .long 0xc105cafe disassembles to invalid
instructions on all architectures I have tested, except Power where it is
`lfs 8, -13570(5)` (Load Floating-Point with a weird offset, unlikely to be used in real code).

---

For the removed function in AsmPrinter.cpp, remove an assert: `mdconst::extract`
already asserts non-nullness.

For compiler-rt/test/ubsan/TestCases/TypeCheck/Function/function.cpp,
when the function doesn't have prolog/epilog (-O1 and above), after moving the two words,
the address of the function equals the address of ret instruction,
so symbolizing the function will additionally get a non-zero column number.
Adjust the test to allow an optional column number.
```
  .long   3238382334
  .long   .L__llvm_rtti_proxy-_Z1fv
_Z1fv:   // symbolizing here retrieves the line table entry from the second .loc
  .file   0 ...
  .loc    0 1 0
  .cfi_startproc
  .loc    0 2 1 prologue_end
  retq
```

Reviewed By: peter.smith

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

14 months ago[GVN] Simplify presplit coroutine handling. NFC.
Jay Foad [Fri, 19 May 2023 14:46:11 +0000 (15:46 +0100)]
[GVN] Simplify presplit coroutine handling. NFC.

14 months ago[RISCV][MC] Add support for experimental Zvfbfwma extension
Alex Bradbury [Fri, 19 May 2023 14:28:42 +0000 (15:28 +0100)]
[RISCV][MC] Add support for experimental Zvfbfwma extension

Provides MC layer support for Zvfbfwma: vector BF16 widening mul-add.

As currently specified, Zvfbfwma does not appear to have a dependency on
Zvfbfmin or Zfbfmin.

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

14 months ago[flang] Change return type of reduction intrinsics
Jacob Crawley [Thu, 18 May 2023 15:35:36 +0000 (15:35 +0000)]
[flang] Change return type of reduction intrinsics

Comments in the recent patch https://reviews.llvm.org/D149964,
mentioned that using hlfir_ExprType in cases where intrinsics
return simple scalars adds unnecessary abstraction that isn't
needed unless an array type is being used.

This patch modifies the HLFIR operations for product, sum and any
so that they only return a hlfir_ExprType when the result is an array,
otherwise they will return just the simple scalar type.

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

14 months ago[Sema] Mark ineligibility of special member functions correctly
Roy Jacobson [Fri, 5 May 2023 14:50:50 +0000 (17:50 +0300)]
[Sema] Mark ineligibility of special member functions correctly

I checked if the member function declaration was a copy constructor, but it's not sufficient; We need to check
the arguments against the instantiated class.

Fixed https://github.com/llvm/llvm-project/issues/62555

Reviewed By: erichkeane

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

14 months ago[RISCV][MC] Add support for experimental Zvfbfmin extension
Alex Bradbury [Fri, 19 May 2023 14:26:25 +0000 (15:26 +0100)]
[RISCV][MC] Add support for experimental Zvfbfmin extension

Provides MC layer support for Zfbfmin: vector BF16 conversions.

Zvfbfmin does not appear to have a dependency on Zfbfmin as currently
specified.

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

14 months agoRevert "Revert "[X86] Remove patterns for ADC/SBB with immediate 8 and optimize durin...
Shengchen Kan [Fri, 19 May 2023 14:21:56 +0000 (22:21 +0800)]
Revert "Revert "[X86] Remove patterns for ADC/SBB with immediate 8 and optimize during MC lowering, NFCI""

This reverts commit cb16b33a03aff70b2499c3452f2f817f3f92d20d.

In fact, the test https://bugs.chromium.org/p/chromium/issues/detail?id=1446973#c2
already passed after 5586bc539acb26cb94e461438de01a5080513401

14 months ago[RISCV][MC] Add support for experimental Zfbfmin extension
Alex Bradbury [Fri, 19 May 2023 14:16:38 +0000 (15:16 +0100)]
[RISCV][MC] Add support for experimental Zfbfmin extension

Provides MC layer support for Zfbfmin: scalar BF16 conversions.

As documented, this extension includes FLH, FSH, FMV.H.X, and FMH.X.H as
defined in Zfh/Zfhmin, but doesn't require either extension.

No Zfbfinxmin has been defined (though you would expect one in the
future, for symmetry with Zfhinxmin). See issue
https://github.com/riscv/riscv-bfloat16/issues/27.

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

14 months ago[GVN] No else after return. NFC.
Jay Foad [Fri, 19 May 2023 14:07:31 +0000 (15:07 +0100)]
[GVN] No else after return. NFC.

14 months ago[flang][hlfir] Implement hlfir.forall codegen when no temp is required
Jean Perier [Fri, 19 May 2023 08:24:25 +0000 (10:24 +0200)]
[flang][hlfir] Implement hlfir.forall codegen when no temp is required

The patch applies the schedule built with the utility added in the
previous D150455 patch to generate the code for an ordered assignment
tree. For now, it only supports forall that do not contain user defined
assignments or assignments to vector subscripted entities, and for
which the scheduling analysis does not require temporary storages.

Support for temporary, WHERE, and user-defined/vector subscript
assignment will be added in later patches.

This enables end-to-end support with HLFIR for forall where the schedule
analysis can prove there is no need to create temporary storage.

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

14 months ago[RISCV] Add test for unprofitable SLP vectorization
Luke Lau [Tue, 2 May 2023 13:08:17 +0000 (14:08 +0100)]
[RISCV] Add test for unprofitable SLP vectorization

Reviewed By: ABataev

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

14 months ago[RISCV] Add tests for store merging with unaligned scalar access
Luke Lau [Wed, 17 May 2023 12:01:08 +0000 (13:01 +0100)]
[RISCV] Add tests for store merging with unaligned scalar access

Reviewed By: reames

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

14 months agoRevert "[RFC][MC][MachO]Only emits compact-unwind format for "canonical" personality...
Nico Weber [Fri, 19 May 2023 13:40:06 +0000 (09:40 -0400)]
Revert "[RFC][MC][MachO]Only emits compact-unwind format for "canonical" personality symbols. For the rest, use DWARFs."

This reverts commit 09aaf53a05e3786eea374f3ce57574225036412d.
Causes toolchain asserts building libc++ for x86_64,
see https://reviews.llvm.org/D144999#4356215

14 months ago[gn build] Port 094ab4781262
LLVM GN Syncbot [Fri, 19 May 2023 13:23:07 +0000 (13:23 +0000)]
[gn build] Port 094ab4781262

14 months agoAdd control of hex casing in APInt::toString
Thomas Preud'homme [Thu, 18 May 2023 09:10:21 +0000 (09:10 +0000)]
Add control of hex casing in APInt::toString

This will be used in implementing arbitrary precision support to
FileCheck's numeric variables and expressions.

Reviewed By: foad, RKSimon

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

14 months agoRevert "Reland [clang-repl] Introduce Value to capture expression results"
Jun Zhang [Fri, 19 May 2023 12:56:21 +0000 (20:56 +0800)]
Revert "Reland [clang-repl] Introduce Value to capture expression results"

This reverts commit d71a4e02277a64a9dece591cdf2b34f15c3b19a0.
See http://45.33.8.238/macm1/61024/step_7.txt

14 months agoUse windows baskslash on anonymous tag locations if using MSVCFormatting and it's...
Zequan Wu [Wed, 17 May 2023 21:06:42 +0000 (17:06 -0400)]
Use windows baskslash on anonymous tag locations if using MSVCFormatting and it's not absolute path.

This fixes a nondeterminism on debug info when building on windows natively vs
cross building to windows.

[1] https://github.com/llvm/llvm-project/blob/llvmorg-17-init/clang/lib/Lex/HeaderSearch.cpp#L465

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

14 months agoRevert "[X86] Remove patterns for ADC/SBB with immediate 8 and optimize during MC...
Hans Wennborg [Fri, 19 May 2023 12:29:06 +0000 (14:29 +0200)]
Revert "[X86] Remove patterns for ADC/SBB with immediate 8 and optimize during MC lowering, NFCI"

This caused compiler assertions, see comment on
https://reviews.llvm.org/D150107.

This also reverts the dependent follow-up change:

> [X86] Remove patterns for ADD/AND/OR/SUB/XOR/CMP with immediate 8 and optimize during MC lowering, NFCI
>
> This is follow-up of D150107.
>
> In addition, the function `X86::optimizeToFixedRegisterOrShortImmediateForm` can be
> shared with project bolt and eliminates the code in X86InstrRelaxTables.cpp.
>
> Differential Revision: https://reviews.llvm.org/D150949

This reverts commit 2ef8ae134828876ab3ebda4a81bb2df7b095d030 and
5586bc539acb26cb94e461438de01a5080513401.

14 months ago[Flang][OpenMP] Add Todo for doconcurrent with worksharing loop
Kiran Chandramohan [Fri, 19 May 2023 11:51:58 +0000 (11:51 +0000)]
[Flang][OpenMP] Add Todo for doconcurrent with worksharing loop

This is a valid usage. We do not handle it as of now. Gfortran/Ifx produces an error, possibly because `do concurrent` was not allowed in previous versions of the OpenMP standard.

Fixes #62649

Reviewed By: Leporacanthicus

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

14 months ago[mlir][linalg] Fix unused variable on opt build
Goran Flegar [Fri, 19 May 2023 12:00:38 +0000 (14:00 +0200)]
[mlir][linalg] Fix unused variable on opt build

14 months ago[MLIR][OpenMP][OMPIRBuilder] Lower OpenMP version attributes to LLVM IR
Dominik Adamski [Fri, 19 May 2023 11:42:16 +0000 (06:42 -0500)]
[MLIR][OpenMP][OMPIRBuilder] Lower OpenMP version attributes to LLVM IR

MLIR version attribute should be lowered to LLVM IR module metadata.
The lowering is done by OpenMPIRBuilder.

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

Reviewed By: kiranchandramohan

14 months agoRevert "[mlir] Fix memory explosion when converting global variable bodies in ModuleT...
Kiran Chandramohan [Fri, 19 May 2023 10:30:15 +0000 (10:30 +0000)]
Revert "[mlir] Fix memory explosion when converting global variable bodies in ModuleTranslation"

Reverting due to failure in spec cam4 benchmark. See github issue
https://github.com/llvm/llvm-project/issues/62802 for details.

This reverts commit 095e6ac9fd92d03dcb1e19b60cb06a8140aae69d.

14 months ago[OpenMP][MLIR][Flang][bbc][Driver] Add fopenmp-version and generate corresponding...
Dominik Adamski [Fri, 19 May 2023 11:14:52 +0000 (06:14 -0500)]
[OpenMP][MLIR][Flang][bbc][Driver] Add fopenmp-version and generate corresponding MLIR attribute

This patch adds flag -fopenmp-version to the Flang frontend and bbc tool.
This flag is lowered to MLIR OpenMP flag attribute.

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

Reviewed By: kiranchandramohan