platform/upstream/llvm.git
2 years ago[MLIR][Presburger] Remove forward declaration to PresburgerLocalSpace
Groverkss [Thu, 31 Mar 2022 08:57:36 +0000 (14:27 +0530)]
[MLIR][Presburger] Remove forward declaration to PresburgerLocalSpace

This patch removes a forward declaration to PresburgerLocalSpace, a
class which does not exist anymore.

2 years ago[flang] Allow user to recover from bad edit descriptor with INTEGER
Jean Perier [Thu, 31 Mar 2022 08:57:01 +0000 (10:57 +0200)]
[flang] Allow user to recover from bad edit descriptor with INTEGER

Runtime was crashing when an INTEGER passed in formatted output with
a bad edit descriptor even when the user did provide IOSTAT. Flang
is already signaling an error when facing similar error with other
types. Do the same with INTEGERs.

The input case is already signaling an error in the related input error
case.

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

2 years ago[flang] Skip `D` when including D debug line
Jean Perier [Thu, 31 Mar 2022 08:54:15 +0000 (10:54 +0200)]
[flang] Skip `D` when including D debug line

When including debug lines as code, the `D` should be considered as
a white space. Currently an error was raised about bad labels because
it the `D` remained a `D` when considering the source line as code.

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

2 years ago[X86] combineCarryThroughADD - recognise X86ISD::ADD(AND(X,1),-1) pattern can be...
Simon Pilgrim [Thu, 31 Mar 2022 08:52:55 +0000 (09:52 +0100)]
[X86] combineCarryThroughADD - recognise X86ISD::ADD(AND(X,1),-1) pattern can be folded to X86ISD::BT

As mentioned on D122482, if we've generated a masked overflow test see if we can fold it to X86ISD::BT to feed a X86ISD::ADC/SBB

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

2 years ago[RISCV][RVV] Add Uses = [FRM] and mayRaiseFPException = true to RVV instructions
ShihPo Hung [Mon, 7 Mar 2022 07:42:49 +0000 (23:42 -0800)]
[RISCV][RVV] Add Uses = [FRM] and mayRaiseFPException = true to RVV instructions

This patch adds Uses = [FRM] and mayRaiseFPException = true to following
instructions:

VFADD, VFSUB, VFRSUB, VFMUL, VFDIV, VFRDIV
VFWADD, VFWSUB, VFWMUL
VFMADD, VFMACC, VFMSAC, VFMSUB
VFNMADD, VFNMACC, VFNMSAC, VVFNMSUB
VFWMACC, VFWMSAC,
VFWNMACC, VFWNMSAC
VFSQRT, VFREC7
VFREDOSUM, VFREDUSUM,
VFWREDOSUM, VFWREDUSUM
and only adds mayRaiseFPException = true to following instructions:

VFRSQRT7,
VFMIN, VFMAX, VFREDMIN, VFREDMAX
VMFEQ, VMFNE, VMFLT,VMFLE, VMFGT, VMFGE

Reviewed By: rogfer01

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

2 years ago[LV] Invalidate widening decisions after maximizing vector bandwidth
David Green [Thu, 31 Mar 2022 08:19:31 +0000 (09:19 +0100)]
[LV] Invalidate widening decisions after maximizing vector bandwidth

When MaximizeVectorBandwidth is enabled, we can end up (via calls to
collectUniformsAndScalars/setCostBasedWideningDecision through
calculateRegisterUsage) making widening decisions before we have decided
whether to fold the tail by masking. These decisions will be wrong if we
later decided to fold the tail, for example when the trip count is very
low. It will use incorrect costs for loads that should get masked, using
standard memory operation costs instead.

This still at the moment uses the EmulatedMaskMemRefHack costs (a bit
unfortunately), but the old costs without this change were 1, leading to
too optimistic vectorization.

This slightly changes the way that the MaximizeVectorBandwidth option
works to make it easier to test, always honouring the option if it is
set.

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

2 years ago[mlir][memref][NFC] Remove unused function
Matthias Springer [Thu, 31 Mar 2022 08:15:31 +0000 (17:15 +0900)]
[mlir][memref][NFC] Remove unused function

This fixes a compiler warning.

2 years ago[AMDGPU] Document the intended semantics of llvm.amdgcn.s.buffer.load
Jay Foad [Tue, 29 Mar 2022 13:30:41 +0000 (14:30 +0100)]
[AMDGPU] Document the intended semantics of llvm.amdgcn.s.buffer.load

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

2 years ago[mlir][tensor] Fix bufferization of CollapseShapeOp / ExpandShapeOp
Matthias Springer [Thu, 31 Mar 2022 08:04:38 +0000 (17:04 +0900)]
[mlir][tensor] Fix bufferization of CollapseShapeOp / ExpandShapeOp

Infer a tighter MemRef type instead of always falling back to the most dynamic MemRef type. This is inefficient and caused op verification errors.

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

2 years ago[RISCV][NFC] Fix comment to refer to correct file
Fraser Cormack [Thu, 31 Mar 2022 07:58:59 +0000 (08:58 +0100)]
[RISCV][NFC] Fix comment to refer to correct file

2 years ago[mlir][memref] Fix CollapseShapeOp verifier
Matthias Springer [Thu, 31 Mar 2022 08:04:15 +0000 (17:04 +0900)]
[mlir][memref] Fix CollapseShapeOp verifier

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

2 years ago[mlir][memref] Fix ExpandShapeOp verifier
Matthias Springer [Thu, 31 Mar 2022 08:03:41 +0000 (17:03 +0900)]
[mlir][memref] Fix ExpandShapeOp verifier

* Complete rewrite of the verifier.
* CollapseShapeOp verifier will be updated in a subsequent commit.
* Update and expand op documentation.
* Add a new builder that infers the result type based on the source type, result shape and reassociation indices. In essence, only the result layout map is inferred.

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

2 years ago[Support/BLAKE3] Re-enable building with the simd-optimized implementations, v2
Argyrios Kyrtzidis [Thu, 31 Mar 2022 07:43:28 +0000 (00:43 -0700)]
[Support/BLAKE3] Re-enable building with the simd-optimized implementations, v2

* Support compiling with clang-5
* Check for `LLVM_DISABLE_ASSEMBLY_FILES` and have it set by
  `compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh`
  which wants to receive and process only bitcode files.

2 years agoRevert "[Clang] Add option to set alternative toolchain path"
Qiu Chaofan [Thu, 31 Mar 2022 07:51:11 +0000 (15:51 +0800)]
Revert "[Clang] Add option to set alternative toolchain path"

--overlay-platform-toolchain inserts a whole new toolchain path with
higher priority than system default, which could be achieved by
composing smaller options. We need to figure out alternative solution
and what is missing among these basic options.

2 years ago[runtimes] Create Tests.cmake if it does not exist
Petr Hosek [Wed, 30 Mar 2022 19:07:41 +0000 (12:07 -0700)]
[runtimes] Create Tests.cmake if it does not exist

This is necessary so that Tests.cmake is always included in the
generated build file and any changes made by subbuilds are detected
without needing to rerun CMake.

This is equivalent to an earlier version of D121647.

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

2 years ago[docs] [tools] Document and alphabetize all llvm-config command-line options
Frances Wingerter [Thu, 31 Mar 2022 07:20:41 +0000 (08:20 +0100)]
[docs] [tools] Document and alphabetize all llvm-config command-line options

Also implements explicit handling for the already-documented --help
flag.

2 years ago[VP][LangRef] Correct select operands in vp.fptosi docs
Fraser Cormack [Thu, 31 Mar 2022 07:30:18 +0000 (08:30 +0100)]
[VP][LangRef] Correct select operands in vp.fptosi docs

2 years ago[RISCV] Add VL patterns for vfwmul/vfwadd/vfwsub
Lian Wang [Thu, 24 Mar 2022 03:26:14 +0000 (03:26 +0000)]
[RISCV] Add VL patterns for vfwmul/vfwadd/vfwsub

Reviewed By: frasercrmck

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

2 years ago[test-release] Added -silent-log flag to test-release.sh
Tobias Hieta [Thu, 31 Mar 2022 06:34:30 +0000 (08:34 +0200)]
[test-release] Added -silent-log flag to test-release.sh

This flag silents the build output of test-release.sh so that
it can be used in CI systems a bit better. It will still log
the build output to the log files but not echo it to stdout.

Reviewed By: tstellar

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

2 years ago[Driver] Move legacy -f[no-]unit-at-a-time to clang_ignored_gcc_optimization_f_Group
Fangrui Song [Thu, 31 Mar 2022 06:20:49 +0000 (23:20 -0700)]
[Driver] Move legacy -f[no-]unit-at-a-time to clang_ignored_gcc_optimization_f_Group

Move to clang_ignored_gcc_optimization_f_Group like other ignored options. This
decreases code size a bit: ~400 bytes on x86-64.

2 years agoMapping of FP operations to constrained intrinsics
Serge Pavlov [Wed, 30 Mar 2022 04:23:49 +0000 (11:23 +0700)]
Mapping of FP operations to constrained intrinsics

A new function 'getConstrainedIntrinsic' is added, which for any gived
instruction returns id of the corresponding constrained intrinsic. If
there is no constrained counterpart for the instruction or the instruction
is already a constrained intrinsic, the function returns zero.

This is recommit of 115b3ace369254f573ca28934ef30ab9d8f497ef, reverted in
8160dd582b67430a5c24c836a57ae3c15cfa973c.

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

2 years ago[LoongArch] Construct codegen infra and generate first add instruction.
wanglei [Thu, 31 Mar 2022 03:48:03 +0000 (11:48 +0800)]
[LoongArch] Construct codegen infra and generate first add instruction.

This patch constructs codegen infra and successfully generate the first
'add' instruction. Add integer calling convention for fixed arguments which
are passed with general-purpose registers.

New test added here:

  CodeGen/LoongArch/ir-instruction/add.ll

The test file is placed in a subdirectory because we will use
subdirctories to distinguish different categories of tests (e.g.
 intrinsic, inline-asm ...)

Reviewed By: MaskRay, SixWeining

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

2 years ago[C++20] [Modules] Use '-' as the separator of partitions when searching
Chuanqi Xu [Thu, 31 Mar 2022 03:21:37 +0000 (11:21 +0800)]
[C++20] [Modules] Use '-' as the separator of partitions when searching
in filesystems

It is simpler to search for module unit by -fprebuilt-module-path
option. However, the separator ':' of partitions is not friendly.
According to the discussion in https://reviews.llvm.org/D118586, I think
we get consensus to use '-' as the separator instead. The '-' is the
choice of GCC too.

Previously I thought it would be better to add an option. But I feel it
is over-engineering now. Another reason here is that there are too many
options for modules (for clang module mainly) now. Given it is not bad
to use '-' when searching, I think it is acceptable to not add an
option.

Reviewed By: iains

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

2 years ago[GVNHoist] drop debug location according to the debug info guide
Aditya Kumar [Wed, 30 Mar 2022 20:20:44 +0000 (13:20 -0700)]
[GVNHoist] drop debug location according to the debug info guide

According to the LLVM debug info update guide: https://llvm.org/docs/HowToUpdateDebugInfo.html,
"Hoisting identical instructions which appear in several successor
blocks into a predecessor block. In this case there is no single
merged instruction. The rule for dropping locations applies".

Thanks to Yuanbo Li for reporting this.

Reviewed By: dblaikie

Reviewers: sebpop, tejohnson, dblaikie

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

2 years ago[mlir][Vector] Fold ShuffleOp if result is identical to one of source vectors.
jacquesguan [Wed, 30 Mar 2022 06:53:47 +0000 (14:53 +0800)]
[mlir][Vector] Fold ShuffleOp if result is identical to one of source vectors.

For example, we could do the following eliminations:
  fold vector.shuffle V1, V2, [0, 1, 2, 3] : <4xi32>, <2xi32> -> V1
  fold vector.shuffle V1, V2, [4, 5] : <4xi32>, <2xi32> -> V2

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

2 years ago[X86] Add test with abs intrinsic for x86-partial-reduction optimization
Wei Xiao [Wed, 30 Mar 2022 14:41:31 +0000 (22:41 +0800)]
[X86] Add test with abs intrinsic for x86-partial-reduction optimization

2 years ago[flang] Correct a typo when parsing format token white space
V Donaldson [Wed, 30 Mar 2022 00:16:39 +0000 (17:16 -0700)]
[flang] Correct a typo when parsing format token white space

A format such as "( D   C, X6. 2  )" is parsed the same as "(DC,X6.2)".

2 years ago[LLDB] Fix NSIndexPathSyntheticFrontEnd::Impl::Clear() to only clear the active union...
Shafik Yaghmour [Thu, 31 Mar 2022 01:00:37 +0000 (18:00 -0700)]
[LLDB] Fix NSIndexPathSyntheticFrontEnd::Impl::Clear() to only clear the active union member

NSIndexPathSyntheticFrontEnd::Impl::Clear() currently calls Clear() on both
unions members regardless of which one is active. I modified it to only call
Clear() on the active member.

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

2 years ago[Utils] Add URL formatting for revert_checker
Jordan R Abrahams-Whitehead [Thu, 31 Mar 2022 00:27:19 +0000 (17:27 -0700)]
[Utils] Add URL formatting for revert_checker

This lets the revert_checker.py get called with the -u option, which
formats the revert and reverted SHAs into handy URLs which point to the
LLVM reviews associated with those SHAs. This is useful for viewers to
look quickly at the changes made by SHAs that were potentially reverted.

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

2 years ago[LoopIdiom] Merge TBAA of adjacent stores when creating memset
Stephen Long [Wed, 30 Mar 2022 23:51:37 +0000 (16:51 -0700)]
[LoopIdiom] Merge TBAA of adjacent stores when creating memset

Factor in the TBAA of adjacent stores instead of just the head store
when merging stores into a memset. We were seeing GVN remove a load that
had a TBAA that matched the 2nd store because GVN determined it didn't
match the TBAA of the memset. The memset had the TBAA of only the first
store.

i.e. Loading the field pi_ of shared_count after memset to create an
array of shared_ptr

template<class T>
class shared_ptr {
  T *p;
  shared_count refcount;
};

class shared_count {
  sp_counted_base *pi_;
};

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

2 years ago[Clang][CodeGen]Beautify dump format, add indent for nested struct and struct members
wangyihan [Wed, 30 Mar 2022 23:38:37 +0000 (07:38 +0800)]
[Clang][CodeGen]Beautify dump format, add indent for nested struct and struct members

Beautify dump format, add indent for nested struct and struct members, also fix test cases in dump-struct-builtin.c
for example:
struct:
```
  struct A {
    int a;
    struct B {
      int b;
      struct C {
        struct D {
          int d;
          union E {
            int x;
            int y;
          } e;
        } d;
        int c;
      } c;
    } b;
  };
```
Before:
```
struct A {
int a = 0
struct B {
    int b = 0
struct C {
struct D {
            int d = 0
union E {
                int x = 0
                int y = 0
                }
            }
        int c = 0
        }
    }
}
```
After:
```
struct A {
    int a = 0
    struct B {
        int b = 0
        struct C {
            struct D {
                int d = 0
                union E {
                    int x = 0
                    int y = 0
                }
            }
            int c = 0
        }
    }
}
```

Reviewed By: erichkeane

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

2 years ago[libc] Improve the performance of expm1f.
Tue Ly [Sun, 27 Mar 2022 04:01:26 +0000 (00:01 -0400)]
[libc] Improve the performance of expm1f.

Improve the performance of expm1f:
- Rearrange the selection logic for different cases to improve the overall
throughput.
- Use the same degree-4 polynomial for large inputs as `expf`
(https://reviews.llvm.org/D122418), reduced from a degree-7 polynomial.

Performance benchmark using perf tool from CORE-MATH project
(https://gitlab.inria.fr/core-math/core-math/-/tree/master):
Before this patch:
```
$ ./perf.sh expm1f

CORE-MATH reciprocal throughput   : 15.362
System LIBC reciprocal throughput : 53.288
LIBC reciprocal throughput        : 54.572

$ ./perf.sh expm1f --latency

CORE-MATH latency   : 57.759
System LIBC latency : 147.146
LIBC latency        : 118.057
```

After this patch:
```
$ ./perf.sh expm1f

CORE-MATH reciprocal throughput   : 15.359
System LIBC reciprocal throughput : 53.188
LIBC reciprocal throughput        : 14.600

$ ./perf.sh expm1f --latency

CORE-MATH latency   : 57.774
System LIBC latency : 147.119
LIBC latency        : 60.280

```

Reviewed By: michaelrj, santoshn, zimmermann6

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

2 years ago[clang-format] Indent import statements in JavaScript.
sstwcw [Wed, 30 Mar 2022 23:17:27 +0000 (23:17 +0000)]
[clang-format] Indent import statements in JavaScript.

[clang-format] Indent import statements in JavaScript.

Take for example this piece of code found at
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import>.

```
for (const link of document.querySelectorAll("nav > a")) {
  link.addEventListener("click", e => {
    e.preventDefault();

    import('/modules/my-module.js')
        .then(module => {
          module.loadPageInto(main);
        })
        .catch(err => {
          main.textContent = err.message;
        });
  });
}
```

Previously the import line would be unindented, looking like this.

```
for (const link of document.querySelectorAll("nav > a")) {
  link.addEventListener("click", e => {
    e.preventDefault();

import('/modules/my-module.js')
        .then(module => {
          module.loadPageInto(main);
        })
        .catch(err => {
          main.textContent = err.message;
        });
  });
}
```

Actually we were going to fix this along with fixing Verilog import
statements.  But the patch got too big.

Reviewed By: MyDeveloperDay, curdeius

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

2 years ago[lldb] Change the way we pick a platform for fat binaries
Jonas Devlieghere [Wed, 30 Mar 2022 17:36:18 +0000 (10:36 -0700)]
[lldb] Change the way we pick a platform for fat binaries

Currently, when creating a target for a fat binary, we error out if more
than one platforms can support the different architectures in the
binary. There are situations where it makes sense for multiple platforms
to support the same architectures: for example the host and
remote-macosx platform on Darwin.

The only way to currently disambiguate between them is to specify the
architecture. This patch changes that to take into account the selected
and host platform. The new algorithm works a follows:

1. Pick the selected platform if it matches any of the architectures.
2. Pick the host platform if it matches any of the architectures.
3. If there's one platform that works for all architectures, pick that.

If none of the above apply then we either have no platform supporting
the architectures in the fat binary or multiple platforms with no good
way to disambiguate between them.

I've added a bunch of unit tests to codify this new behavior.

rdar://90360204

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

2 years agoRevert "[MLIR][Presburger] LexSimplex::addEquality: add equalities as fixed columns"
Arjun P [Wed, 30 Mar 2022 22:24:00 +0000 (23:24 +0100)]
Revert "[MLIR][Presburger] LexSimplex::addEquality: add equalities as fixed columns"

This reverts commit 5630143af33f7e6e0dabdf38982cc9800140bb75. The
implementation in this commit was incorrect. Also, handling this representation
of equalities in the upcoming support for symbolic lexicographic minimization
makes that patch much more complex. It will be easier to review that without
this representaiton and then reintroduce the fixed column representation
later, hence the revert rather than a bug fix.

2 years ago[Debuginfod] Use env to fix debuginfod.test on Win32.
Daniel Thornburgh [Tue, 22 Mar 2022 17:09:51 +0000 (17:09 +0000)]
[Debuginfod] Use env to fix debuginfod.test on Win32.

2 years ago[VPlan] Track current vector loop in VPTransformState (NFC).
Florian Hahn [Wed, 30 Mar 2022 21:16:40 +0000 (22:16 +0100)]
[VPlan] Track current vector loop in VPTransformState (NFC).

Instead of looking up the vector loop using the header, keep track of
the current vector loop in VPTransformState. This removes the
requirement for the vector header block being part of the loop up front.

A follow-up patch will move the code to generate the Loop object for the
vector loop to VPRegionBlock.

Depends on D121619.

Reviewed By: Ayal

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

2 years ago[libcxx] [doc] Update Windows build instructions after deprecating the legacy standal...
Martin Storsjö [Wed, 30 Mar 2022 10:13:45 +0000 (13:13 +0300)]
[libcxx] [doc] Update Windows build instructions after deprecating the legacy standalone builds

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

2 years ago[lldb-vscode] Avoid a -Wunused-but-set-variable warning. NFC.
Martin Storsjö [Wed, 30 Mar 2022 08:57:53 +0000 (11:57 +0300)]
[lldb-vscode] Avoid a -Wunused-but-set-variable warning. NFC.

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

2 years ago[llvm-profgen] Read sample profiles for post-processing.
Hongtao Yu [Wed, 30 Mar 2022 19:27:10 +0000 (12:27 -0700)]
[llvm-profgen] Read sample profiles for post-processing.

Sometimes we would like to run post-processing repeatedly on the original sample profile for tuning. In order to avoid regenerating the original profile from scratch every time, this change adds the support of reading in the original profile (called symbolized profile) and running the post-processor on it.

Reviewed By: wenlei

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

2 years ago[lld/mac] Give range extension thunks for local symbols local visibility
Nico Weber [Tue, 29 Mar 2022 00:17:08 +0000 (20:17 -0400)]
[lld/mac] Give range extension thunks for local symbols local visibility

When two local symbols (think: file-scope static functions, or functions in
unnamed namespaces) with the same name in two different translation units
both needed thunks, ld64.lld previously created external thunks for both
of them. These thunks ended up with the same name, leading to a duplicate
symbol error for the thunk symbols.

Instead, give thunks for local symbols local visibility.

(Hitting this requires a jump to a local symbol from over 128 MiB away.
It's unlikely that a single .o file is 128 MiB large, but with ICF
you can end up with a situation where the local symbol is ICF'd with
a symbol in a separate translation unit. And that can introduce a
large enough jump to require a thunk.)

Fixes PR54599.

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

2 years agoRecommit "[Docs] Add documentation for llvm-remark-size-diff"
Jessica Paquette [Wed, 30 Mar 2022 20:35:50 +0000 (13:35 -0700)]
Recommit "[Docs] Add documentation for llvm-remark-size-diff"

Add it to the toctree for the LLVM command guide.

2 years agoRevert "[Docs] Add documentation for llvm-remark-size-diff"
Jessica Paquette [Wed, 30 Mar 2022 20:34:03 +0000 (13:34 -0700)]
Revert "[Docs] Add documentation for llvm-remark-size-diff"

This reverts commit bdea2afc8c16e51edc8877479623e16261940e00.

Bot failure.

2 years ago[AutoUpgrade] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds
Fangrui Song [Wed, 30 Mar 2022 20:31:17 +0000 (13:31 -0700)]
[AutoUpgrade] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds

2 years ago[Docs] Add documentation for llvm-remark-size-diff
Jessica Paquette [Wed, 30 Mar 2022 16:42:51 +0000 (09:42 -0700)]
[Docs] Add documentation for llvm-remark-size-diff

Add documentation describing how to

- Use `llvm-remark-size-diff`
- Interpret the output from the tool

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

2 years agoDemangle: Fix crash-on-invalid demangling of a module name with no underlying entity
David Blaikie [Wed, 30 Mar 2022 20:18:40 +0000 (20:18 +0000)]
Demangle: Fix crash-on-invalid demangling of a module name with no underlying entity

2 years ago[MC][BOLT] Add setter for AllowAtInName
Amir Ayupov [Tue, 29 Mar 2022 22:54:08 +0000 (15:54 -0700)]
[MC][BOLT] Add setter for AllowAtInName

Use the setter in BOLT to allow printing names with variant kind in the name
(e.g. "func@PLT").
Fixes BOLT buildbot tests that broke after D122516:
https://lab.llvm.org/buildbot/#/builders/215/builds/3595

Reviewed By: maksfb

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

2 years ago[AMDGPU] Remove empty comments in 2 tests. NFC.
Stanislav Mekhanoshin [Wed, 30 Mar 2022 19:56:46 +0000 (12:56 -0700)]
[AMDGPU] Remove empty comments in 2 tests. NFC.

2 years ago[clang][extract-api][NFC] Don't remap the generated input buffer in PPOpts
Daniel Grumberg [Wed, 30 Mar 2022 19:38:09 +0000 (20:38 +0100)]
[clang][extract-api][NFC] Don't remap the generated input buffer in PPOpts

This was triggering some build failures so removing this change for now.

2 years ago[AArch64] Fix AArch64TargetParser.def to match AArch64.td.
Eli Friedman [Tue, 22 Mar 2022 23:41:16 +0000 (16:41 -0700)]
[AArch64] Fix AArch64TargetParser.def to match AArch64.td.

Currently, we have two different lists of features each CPU supports...
and those lists aren't consistent. This patch assumes AArch64.td is
right, and tries to fix AArch64TargetParser to match.

It's hard to find documentation for the right features, but reviewers
have confirmed these changes.

Probably we should try to unify the two lists at some point, but
synchronizing them seems like a prerequisite to that anyway.

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

2 years agoExpanding HLSL attribute diagnostics
Chris Bieneman [Wed, 30 Mar 2022 18:32:24 +0000 (13:32 -0500)]
Expanding HLSL attribute diagnostics

Updating the diagnostics as per the feedback on
https://reviews.llvm.org/D122627.

This change correctly handles missing argument lists, and changes the
subject for the `numthreads` attribute to be global functions.

I did not handle applying the attribute to template functions because
that currently fails parsing in a way that is consisetent with the
current DXC codebase (Microsoft attributes are not supported on
templates).

A future improvement to the diagnostic maybe warranted.

2 years ago[libc++] Ensure that all public C++ headers include <__assert>
Louis Dionne [Fri, 25 Mar 2022 16:55:36 +0000 (12:55 -0400)]
[libc++] Ensure that all public C++ headers include <__assert>

This patch changes the requirement for getting the declaration of the
assertion handler from including <__assert> to including any public
C++ header of the library. Note that C compatibility headers are
excluded because we don't implement all the C headers ourselves --
some of them are taken straight from the C library, like assert.h.

It also adds a generated test to check it. Furthermore, this new
generated test is designed in a way that will make it possible to
replace almost all the existing test-generation scripts with this
system in upcoming patches.

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

2 years ago[VFS] RedirectingFileSystem only replace path if not already mapped
Ben Barham [Sun, 27 Mar 2022 21:08:48 +0000 (14:08 -0700)]
[VFS] RedirectingFileSystem only replace path if not already mapped

If the `ExternalFS` has already remapped a path then the
`RedirectingFileSystem` should not change it to the originally provided
path. This fixes the original path always being used if multiple VFS
overlays were provided and the path wasn't found in the highest (ie.
first in the chain).

This also renames `IsVFSMapped` to `ExposesExternalVFSPath` and only
sets it if `UseExternalName` is true. This flag then represents that the
`Status` has an external path that's different from its virtual path.
Right now the contained path is still the external path, but further PRs
will change this to *always* be the virtual path. Clients that need the
external can then request it specifically.

Note that even though `ExposesExternalVFSPath` isn't set for all
VFS-mapped paths, `IsVFSMapped` was only being used by a hack in
`FileManager` that was specific to module searching. In that case
`UseExternalNames` is always `true` and so that hack still applies.

Resolves rdar://90578880 and llvm-project#53306.

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

2 years ago[RISCV] ISel (and (shift X, C1), C2)) to shift pair in more cases
Craig Topper [Wed, 30 Mar 2022 18:37:34 +0000 (11:37 -0700)]
[RISCV] ISel (and (shift X, C1), C2)) to shift pair in more cases

Previously, these isel optimizations were disabled if the AND could
be selected as a ANDI instruction. This patch disables the optimizations
only if the immediate is valid for C.ANDI. If we can't use C.ANDI,
we might be able to compress the shift instructions instead.

I'm not checking the C extension since we have relatively poor test
coverage of the C extension. Without C extension the code size
should be equal. My only concern would be if the shift+andi had
better latency/throughput on a particular CPU.

I did have to add a peephole to match SRLIW if the input is zexti32
to prevent a regression in rv64zbp.ll.

Reviewed By: luismarques

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

2 years ago[scudo] Reland: Add noreturn/pragma to suppress compiler warnings
Dominic Chen [Wed, 16 Mar 2022 20:42:49 +0000 (13:42 -0700)]
[scudo] Reland: Add noreturn/pragma to suppress compiler warnings

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

2 years ago[RISCV] Use getSplatBuildVector instead of getSplatVector for fixed vectors.
Craig Topper [Wed, 30 Mar 2022 18:33:35 +0000 (11:33 -0700)]
[RISCV] Use getSplatBuildVector instead of getSplatVector for fixed vectors.

The splat_vector will be legalized to build_vector eventually
anyway. This patch makes it take fewer steps.

Unfortunately, this results in some codegen changes. It looks
like it comes down to how the nodes were ordered in the topological
sort for isel. Because the build_vector is created earlier we end up
with a different ordering of nodes.

Reviewed By: frasercrmck

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

2 years agoValue-number GVNHoist loads by result type as well as pointer address.
Chang-Sun Lin Jr [Wed, 30 Mar 2022 18:31:17 +0000 (11:31 -0700)]
Value-number GVNHoist loads by result type as well as pointer address.

Avoids merge errors when opaque pointers are loaded into different types.

Reviewed by: jcranmer-intel, hiraditya
Differential Revision: https://reviews.llvm.org/D122521

2 years ago[SelectionDAG] Move extension type for ConstantSDNode from getCopyToRegs to HandlePHI...
Craig Topper [Wed, 30 Mar 2022 18:24:01 +0000 (11:24 -0700)]
[SelectionDAG] Move extension type for ConstantSDNode from getCopyToRegs to HandlePHINodesInSuccessorBlocks.

D122053 set the ExtendType for ConstantSDNodes in getCopyToRegs to
ZERO_EXTEND to match assumptions in ComputePHILiveOutRegInfo. PHIs
are probably not the only way ConstantSDNodeNodes can get to
getCopyToRegs.

This patch adds an ExtendType parameter to CopyValueToVirtualRegister and
has HandlePHINodesInSuccessorBlocks pass ISD::ZERO_EXTEND for ConstantInts.
This way we only affect ConstantSDNodes for PHIs.

Reviewed By: RKSimon

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

2 years agoDo not generate x86_64 test targets on AS hosts
Julian Lettner [Wed, 30 Mar 2022 02:09:59 +0000 (19:09 -0700)]
Do not generate x86_64 test targets on AS hosts

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

2 years ago[clang] Fix shared build. NFC.
Michael Liao [Wed, 30 Mar 2022 18:03:31 +0000 (14:03 -0400)]
[clang] Fix shared build. NFC.

2 years ago[clang][extract-api] Add support for macros
Daniel Grumberg [Tue, 29 Mar 2022 16:48:11 +0000 (17:48 +0100)]
[clang][extract-api] Add support for macros

To achieve this we hook into the preprocessor during the
ExtractAPIAction and record definitions for macros that don't get
undefined during preprocessing.

2 years ago[clang][extractapi] Tie API and serialization to the FrontendAction
Daniel Grumberg [Tue, 29 Mar 2022 15:53:39 +0000 (16:53 +0100)]
[clang][extractapi] Tie API and serialization to the FrontendAction

Make the API records a property of the action instead of the ASTVisitor
so that it can be accessed outside the AST visitation and push back
serialization to the end of the frontend action.

This will allow accessing and modifying the API records outside of the
ASTVisitor, which is a prerequisite for supporting macros.

2 years ago[Clang] Add a compatibiliy warning for non-literals in constexpr.
Corentin Jabot [Tue, 22 Mar 2022 18:48:01 +0000 (19:48 +0100)]
[Clang] Add a compatibiliy warning for non-literals in constexpr.

Reviewed By: aaron.ballman, hubert.reinterpretcast

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

2 years agoRevert "[ASTMatchers] Output currently matching node on crash"
Nathan James [Wed, 30 Mar 2022 17:10:11 +0000 (18:10 +0100)]
Revert "[ASTMatchers] Output currently matching node on crash"

This reverts commit 6e33e45b943061f79ab6de1b60d04d4c6f32f8f9.

Fails to build on 32bit machines due to PointerUnion limitations

2 years ago[LV] Do not create separate latch block in VPlan::execute.
Florian Hahn [Wed, 30 Mar 2022 16:31:38 +0000 (17:31 +0100)]
[LV] Do not create separate latch block in VPlan::execute.

Now that all dependencies on creating the latch block up-front have been
removed, there is no need to create it early.

Depends on D121618.

Reviewed By: Ayal

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

2 years ago[VP] Add vp.icmp comparison intrinsic and docs
Fraser Cormack [Wed, 30 Mar 2022 12:14:33 +0000 (13:14 +0100)]
[VP] Add vp.icmp comparison intrinsic and docs

This patch mostly follows up on D121292 which introduced the vp.fcmp
intrinsic.

Reviewed By: craig.topper

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

2 years ago[LangRef][NFC] Correct select operands in vp.fcmp docs
Fraser Cormack [Wed, 30 Mar 2022 16:02:41 +0000 (17:02 +0100)]
[LangRef][NFC] Correct select operands in vp.fcmp docs

Thanks for craig.topper for spotting this.

2 years ago[ASTMatchers] Output currently matching node on crash
Nathan James [Wed, 30 Mar 2022 16:13:59 +0000 (17:13 +0100)]
[ASTMatchers] Output currently matching node on crash

Extend D120185 to also log the node being matched on in case of a crash.
This can help if a matcher is causing a crash or there are not enough interesting nodes bound.

Reviewed By: aaron.ballman

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

2 years ago[ELF] Default to --no-fortran-common
Fangrui Song [Wed, 30 Mar 2022 16:12:09 +0000 (09:12 -0700)]
[ELF] Default to --no-fortran-common

D86142 introduced --fortran-common and defaulted it to true (matching GNU ld
but deviates from gold/macOS ld64). The default state was motivated by transparently
supporting some FORTRAN 77 programs (Fortran 90 deprecated common blocks).
Now I think it again. I believe we made a mistake to change the default:

* this is a weird and legacy rule, though the breakage is very small
* --fortran-common introduced complexity to parallel symbol resolution and will slow down it
* --fortran-common more likely causes issues when users mix COMMON and
  STB_GLOBAL definitions (see https://github.com/llvm/llvm-project/issues/48570 and
  https://maskray.me/blog/2022-02-06-all-about-common-symbols).
  I have seen several issues in our internal projects and Android.
  On the other hand, --no-fortran-common is safer since
  COMMON/STB_GLOBAL have the same semantics related to archive member extraction.

Therefore I think we should switch back, not punishing the common uage.
A platform wanting --fortran-common can implement ld.lld as a shell script
wrapper around `lld -flavor gnu --fortran-common "$@"`.

Reviewed By: ikudrin, sfertile

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

2 years ago[X86][test] Precommit D122541 tests for prologue/epilogue CFI
Fangrui Song [Wed, 30 Mar 2022 16:02:23 +0000 (09:02 -0700)]
[X86][test] Precommit D122541 tests for prologue/epilogue CFI

Currently there is no CFI_INSTRUCTION MIR test with .ll input. This patch
adds some -stop-after=prologepilog tests.

2 years ago[clang][ABI] New C++20 module mangling scheme
Nathan Sidwell [Tue, 18 Jan 2022 15:14:08 +0000 (07:14 -0800)]
[clang][ABI] New C++20 module mangling scheme

Implement a demangleable strong ownership symbol mangling.

 * The original module symbol mangling scheme turned out to be
undemangleable.

 * The hoped-for C++17 compatibility of weak ownership turns out to be
fragile

* C++20 now has better ways of controlling C++17 compatibility

The issue is captured on the ABI list at:
  https://github.com/itanium-cxx-abi/cxx-abi/issues/134

GCC implements this new mangling.

The old mangling is unceremoniously dropped.  No backwards
compatibility, no deprectated old-mangling flag.  It was always
labelled experimental.  (Old and new manglings cannot be confused.)

Reviewed By: dblaikie

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

2 years ago[AutoUpgrade] Don't upgrade intrinsics returning overloaded struct type
Nikita Popov [Wed, 30 Mar 2022 15:25:49 +0000 (17:25 +0200)]
[AutoUpgrade] Don't upgrade intrinsics returning overloaded struct type

We only want to do the upgrade from named to anonymous struct
return if the intrinsic is declared to return a struct, but not
if it has an overloaded return type that just happens to be a
struct. In that case the struct type will be mangled into the
intrinsic name and there is no problem.

This should address the problem reported in
https://reviews.llvm.org/D122471#3416598.

2 years ago[libunwind] Add a _LIBUNWIND_VERSION macro
Louis Dionne [Fri, 4 Mar 2022 19:34:46 +0000 (14:34 -0500)]
[libunwind] Add a _LIBUNWIND_VERSION macro

This allows us to detect whether we're being compiled with LLVM's libunwind
more easily, without CMake having to set explicit variables.

As discussed in https://llvm.org/D119538.

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

2 years ago[SDAG] avoid libcalls to fmin/fmax for soft-float targets
Sanjay Patel [Wed, 30 Mar 2022 14:24:54 +0000 (10:24 -0400)]
[SDAG] avoid libcalls to fmin/fmax for soft-float targets

This is an extension of D70965 to avoid creating a mathlib
call where it did not exist in the original source. Also see
D70852 for discussion about an alternative proposal that was
abandoned.

In the motivating bug report:
https://github.com/llvm/llvm-project/issues/54554
...we also have a more general issue about handling "no-builtin" options.

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

2 years agoRecommit [lldb/test] Make category-skipping logic "platform"-independent
Pavel Labath [Mon, 14 Mar 2022 15:32:51 +0000 (16:32 +0100)]
Recommit [lldb/test] Make category-skipping logic "platform"-independent

This recommits dddf4ce03, which was reverted because of a couple of test
failures on macos. The reason behind the failures was that the patch
inadvertenly changed the value returned by the host platform from
"macosx" to "darwin". The new version fixes that.

Original commit message was:

The decision which categories are relevant for a particular test run
happen very early in the test setup process. They use the SBPlatform
object to determine which categories should be skipped. The platform
object created for this purpose transcends individual test runs.

This setup is not compatible with the direction discussed in
<https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594>
-- when platform objects are tied to a specific (SB)Debugger, they need
to be created alongside it, which currently happens in the test setUp
method.

This patch is the first step in that direction -- it rewrites the
category skipping logic to avoid depending on a global SBPlatform
object. Fortunately, the skipping logic is fairly simple (and I believe
it outght to stay that way) and mainly consists of comparing the
platform name against some hardcoded lists. This patch bases this
comparison on the platform name instead of the os part of the triple (as
reported by the platform).

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

2 years agoFix invalid overflow check in flang
serge-sans-paille [Wed, 30 Mar 2022 06:17:56 +0000 (08:17 +0200)]
Fix invalid overflow check in flang

Statically checking for overflow with

    if constexpr (sizeof(std::size_t) <= sizeof(std::int64_t)) {
         return static_cast<std::int64_t>(length);
    }

Doesn't work if `sizeof(std::size_t) == sizeof(std::int64_t)` because std::size_t
is unsigned.

if `length == std::numeric_limits<size_t>` casting it to `int64_t` is going to overflow.

This code would be much simpler if returning a `uint64_t` instead of a signed
value...

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

2 years ago[NFC] Use range based loop.
Jun Zhang [Tue, 29 Mar 2022 07:24:48 +0000 (15:24 +0800)]
[NFC] Use range based loop.

Signed-off-by: Jun Zhang <jun@junz.org>
Differential Revision: https://reviews.llvm.org/D122657

2 years ago[VP] Add vp.fcmp comparison intrinsic and docs
Fraser Cormack [Wed, 9 Mar 2022 15:02:53 +0000 (15:02 +0000)]
[VP] Add vp.fcmp comparison intrinsic and docs

This patch adds the first support for vector-predicated comparison
intrinsics, starting with vp.fcmp. It uses metadata to encode its
condition code, like the llvm.experimental.constrained.fcmp intrinsic.

Reviewed By: craig.topper

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

2 years ago[SDAG] try to canonicalize logical shift after bswap
Sanjay Patel [Wed, 30 Mar 2022 13:29:32 +0000 (09:29 -0400)]
[SDAG] try to canonicalize logical shift after bswap

When shifting by a byte-multiple:
bswap (shl X, C) --> lshr (bswap X), C
bswap (lshr X, C) --> shl (bswap X), C

This is the backend version of D122010 and an alternative
suggested in D120648.
There's an extra check to make sure the shift amount is
valid that was not in the rough draft.

I'm not sure if there is a larger motivating case for RISCV (bug report?),
but the ARM diffs show a benefit from having a late version of the
transform (because we do not combine the loads in IR).

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

2 years ago[x86] add tests for fcmp with 0.0 operand; NFC
Sanjay Patel [Tue, 29 Mar 2022 21:07:41 +0000 (17:07 -0400)]
[x86] add tests for fcmp with 0.0 operand; NFC

2 years ago[SystemZ] generate full checks for tests; NFC
Sanjay Patel [Tue, 29 Mar 2022 19:03:14 +0000 (15:03 -0400)]
[SystemZ] generate full checks for tests; NFC

These may change if we transform the fcmp (setcc) to avoid a constant operand.

2 years ago[X86] Extend xor-lea test coverage
Simon Pilgrim [Wed, 30 Mar 2022 12:34:14 +0000 (13:34 +0100)]
[X86] Extend xor-lea test coverage

Add XOR(ADD/SUB(X,Y),MIN_SIGNED_VALUE) tests and adjust some XOR(SHL(X,C),MIN_SIGNED_VALUE) shifts to better match LEA scales

2 years ago[SelectionDAG] Don't create illegally-typed nodes while constant folding
Fraser Cormack [Thu, 24 Mar 2022 11:03:26 +0000 (11:03 +0000)]
[SelectionDAG] Don't create illegally-typed nodes while constant folding

This patch fixes a (seemingly very rare) crash during vector constant
folding introduced in D113300.

Normally, during legalization, if we create an illegally-typed node during
a failed attempt at constant folding it's cleaned up before being
visited, due to it having no uses.

If, however, an illegally-typed node is created during one round of
legalization and isn't cleaned up, it's possible for a second round of
legalization to create new illegally-typed nodes which add extra uses to
the old illegal nodes. This means that we can end up visiting the old
nodes before they're known to be dead, at which point we crash.

I'm not happy about this fix. Creating illegal types at all seems like a
bad idea, but we all-too-often rely on illegal constants being
successfully folded and being fixed up afterwards. However, we can't
rely on constant folding actually happening, and we don't have a
foolproof way of peering into the future.

Perhaps the correct fix is to revisit the node-iteration order during
legalization, ensuring we visit all uses of nodes before the nodes
themselves. Or alternatively we could try and clean up dead nodes
immediately after failing constant folding.

Reviewed By: RKSimon

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

2 years ago[LV] Pass LoopHeaderBB directly to updateDominatorTree. (NFC)
Florian Hahn [Wed, 30 Mar 2022 12:11:20 +0000 (13:11 +0100)]
[LV] Pass LoopHeaderBB directly to updateDominatorTree. (NFC)

At the call site, we already know what the vector header block is. Pass
it directly.

2 years ago[RuntimeDebugBuilder] Remove pointer element type accesses
Nikita Popov [Wed, 30 Mar 2022 12:00:24 +0000 (14:00 +0200)]
[RuntimeDebugBuilder] Remove pointer element type accesses

2 years ago[X86] Add test coverage based off Issue #51609
Simon Pilgrim [Wed, 30 Mar 2022 11:56:49 +0000 (12:56 +0100)]
[X86] Add test coverage based off Issue #51609

2 years ago[RISCV] Add index check for vset/vget
wangpc [Wed, 30 Mar 2022 11:28:38 +0000 (19:28 +0800)]
[RISCV] Add index check for vset/vget

Index of vset/vget must be a constant integer and be
located in right range.

Reviewed By: kito-cheng

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

2 years agoDon't diagnostic atomic object access as UB in an unevaluated context
Aaron Ballman [Wed, 30 Mar 2022 11:12:04 +0000 (07:12 -0400)]
Don't diagnostic atomic object access as UB in an unevaluated context

We started diagnosing this situation with a more clear diagnostic
message, but it was pointed out that unevaluated contexts don't really
have the undefined behavior property as there is no runtime access
involved.

This augments the changes in https://reviews.llvm.org/D122656 to not
diagnose in an unevaluated context.

2 years ago[MC][X86] Ensure all opcode tests are sorted by instruction name
Simon Pilgrim [Wed, 30 Mar 2022 10:08:03 +0000 (11:08 +0100)]
[MC][X86] Ensure all opcode tests are sorted by instruction name

Noticed while reviewing D122449

2 years ago[X86][AMX] Pre-checkin the test case for AMX undef and zero
Luo, Yuanke [Wed, 30 Mar 2022 09:51:47 +0000 (17:51 +0800)]
[X86][AMX] Pre-checkin the test case for AMX undef and zero

2 years agoRevert "Mapping of FP operations to constrained intrinsics"
Serge Pavlov [Wed, 30 Mar 2022 09:43:34 +0000 (16:43 +0700)]
Revert "Mapping of FP operations to constrained intrinsics"

This reverts commit 115b3ace369254f573ca28934ef30ab9d8f497ef.
Starting from this commit the buildbot sanitizer-x86_64-linux-bootstrap-msan
starts failing (build 10071). Reverted for investigation.

2 years ago[X86][AMX] Fix bug for amx cast tranform
Luo, Yuanke [Wed, 30 Mar 2022 09:20:22 +0000 (17:20 +0800)]
[X86][AMX] Fix bug for amx cast tranform

After combining amx cast operation, some amx cast intrinsic may be dead
code. This patch is to delete such dead code and avoid crash.

2 years ago[CodeGen] Avoid access after runtime
Vitaly Buka [Wed, 30 Mar 2022 01:35:55 +0000 (18:35 -0700)]
[CodeGen] Avoid access after runtime

Insts must be destroyd before xParent
or it can read it with stack like this:
   0 in llvm::MachineInstr::getMF() const MachineInstr.cpp:637:3
   1 in getMF MachineInstr.h:302:50
   2 in removeNodeFromList MachineBasicBlock.cpp:163:32

2 years ago[MLIR] Remove LLVMVectorType
Nikita Popov [Wed, 30 Mar 2022 08:03:08 +0000 (10:03 +0200)]
[MLIR] Remove LLVMVectorType

While this claims to be the base class for fixed and scalable
vectors, this is no longer the case since D94405. In fact,
LLVMVectorType is not usable, since the methods it declares are
never defined. Remove this leftover.

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

2 years ago[X86] Add PR47857 test case
Simon Pilgrim [Wed, 30 Mar 2022 08:51:26 +0000 (09:51 +0100)]
[X86] Add PR47857 test case

2 years ago[RISCV] Add CMIX isel pattern for (xor (and (xor rs1, rs3), rs2), rs3)
Liqin Weng [Wed, 30 Mar 2022 07:57:46 +0000 (15:57 +0800)]
[RISCV] Add CMIX isel pattern for (xor (and (xor rs1, rs3), rs2), rs3)

Reviewed By: craig.topper

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

2 years ago[mlir] Allow Diagnostic/InFlightDiagnostic to convert to FailureOr.
bzcheeseman [Wed, 30 Mar 2022 08:36:41 +0000 (01:36 -0700)]
[mlir] Allow Diagnostic/InFlightDiagnostic to convert to FailureOr.

Allow conversion of a diagnostic to FailureOr. This conversion only results
in `failure` because in the case where operator LogicalResult would return
success, the FailureOr constructor would assert.

Reviewed By: rriddle

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

2 years agoadd missing include for -DLLVM_ENABLE_MODULES=On
Luboš Luňák [Wed, 30 Mar 2022 08:29:23 +0000 (10:29 +0200)]
add missing include for -DLLVM_ENABLE_MODULES=On

2 years ago[X86] combineADC - fold ADC(C1,C2,Carry) -> ADC(0,C1+C2,Carry)
Simon Pilgrim [Tue, 29 Mar 2022 21:24:02 +0000 (22:24 +0100)]
[X86] combineADC - fold ADC(C1,C2,Carry) -> ADC(0,C1+C2,Carry)

If we're not relying on the flag result, we can fold the constants together into the RHS immediate operand and set the LHS operand to zero, simplifying for further folds.

We could do something similar if the flag result is in use and the constant fold doesn't affect it, but I don't have any real test cases for this yet.

As suggested by @davezarzycki on Issue #35256

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

2 years ago[CostModel][X86] Reduce cost of v2i64 icmp base cost on SSE2 targets
Simon Pilgrim [Fri, 25 Mar 2022 11:09:40 +0000 (11:09 +0000)]
[CostModel][X86] Reduce cost of v2i64 icmp base cost on SSE2 targets

Based off the script from D103695, we were exaggerating the cost of the v2i64 comparison expansion using instruction count instead of effective throughput