Commit Graph

418162 Commits

Author SHA1 Message Date
wangyihan
bab468f253 [llvm][ADT] Remove duplicate code in llvm::StringMapImpl::RehashTable
Remove duplicate code in llvm::StringMapImpl::RehashTable, near StringMap.cpp:229

```
if (!NewTableArray[NewBucket]) {
  NewTableArray[FullHash & (NewSize - 1)] = Bucket;
  NewHashArray[FullHash & (NewSize - 1)] = FullHash;
  if (I == BucketNo)
    NewBucketNo = NewBucket;
  continue;
}
```

Reviewed By: MaskRay, dexonsmith

Differential Revision: https://reviews.llvm.org/D121726
2022-03-16 01:01:35 -07:00
Vlad Serebrennikov
a603f566db [clang] CWG 2354: prohibit alignas for enums
Reviewed By: aaron.ballman, erichkeane

Differential Revision: https://reviews.llvm.org/D121723
2022-03-16 15:48:18 +08:00
serge-sans-paille
989f1c72e0 Cleanup codegen includes
This is a (fixed) recommit of https://reviews.llvm.org/D121169

after:  1061034926
before: 1063332844

Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D121681
2022-03-16 08:43:00 +01:00
Fangrui Song
c9dbf407af [ELF] Move invalid binding diagnostic from initializeSymbols to postParse
It is excessive to have a diagnostic for STB_LOCAL. Just reuse the invalid
binding diagnostic for STB_LOCAL.
2022-03-16 00:31:29 -07:00
Weining Lu
c008a697ff [LoongArch] Add some missing comments. NFC
Add more comments /*Lower=*/ and /*Upper=*/ calling generateImmOutOfRangeError.
2022-03-16 14:57:08 +08:00
Fangrui Song
bdb98bd979 [ELF] Use endianness-aware read32 to avoid dispatch. NFC 2022-03-15 23:51:11 -07:00
Fangrui Song
385573e07b [ELF] Inline ARMExidxSyntheticSection::classof. NFC
To optimize the only call site `dyn_cast<ARMExidxSyntheticSection>(first)` and
decrease code size.
2022-03-15 23:41:30 -07:00
Fangrui Song
1a590232f4 [ELF] Optimize "Strip sections"
If SHT_LLVM_SYMPART is unused, don't iterate over inputSections.
If neither --strip-debug/--strip-all, don't iterate over inputSections.
2022-03-15 23:15:43 -07:00
Valentin Clement
9daf576583
[flang] Lower date_and_time and cpu_time intrinsics
This patch lowers the `cpu_time` and the `date_and_time` instrinsics to
FIR and runtime calls.

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

Depends on D121704

Reviewed By: PeteSteinfeld

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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-16 06:38:26 +01:00
Valentin Clement
a75b949320
[flang][NFC] Remove duplicated header file
Remove IntervalSet.h since it is a duplicate from
flang/include/flang/Lower/IntervalSet.h.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D121747
2022-03-16 06:36:41 +01:00
Shengchen Kan
052d37dc7c [NFC][X86] Rename some variables and functions about target features
This is preparation for D121768. The member's name should align w/
the interface for trival target feature.
2022-03-16 13:08:52 +08:00
MaheshRavishankar
4b644fca08 [mlir][Linalg] Add multi-result op cast test.
https://reviews.llvm.org/D121369 fixed an issue with canonicalizing a
linalg op producer with a cast op consumer. Adding a test to verify
that change.

Reviewed By: hanchung

Differential Revision: https://reviews.llvm.org/D121648
2022-03-16 05:06:20 +00:00
River Riddle
0bf9aabd09 [mlir:OpenMP] Fix memory leak in asan translation
A fake unreachable was created and removed, but never
erased.
2022-03-15 21:54:55 -07:00
Alex Brachet
89aa4bd3fb [libc] Unlock after pop_back 2022-03-16 04:00:26 +00:00
Alex Brachet
968c1aa54f [libc][NFC] Use more common variable naming convention
We were in between two styles when this file was initially
checked in.
2022-03-16 03:34:54 +00:00
Manoj Gupta
1f82d0f795 [msan] Add interceptors for Linux 64-bit stat variants
glibc >= 2.33 uses shared functions for stat family functions.
D111984 added support for non-64 bit variants but they
do not appear to be enough as we have been noticing msan
errors on 64-bit stat variants on Chrome OS.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D121652
2022-03-15 20:22:28 -07:00
Sterling Augustine
103f23d63d Updated mlir-tablegen dependencies for f96a8675cd
Differential Revision: https://reviews.llvm.org/D121764
2022-03-15 19:41:42 -07:00
Fangrui Song
7c7702b318 [ELF] Move section assignment from initializeSymbols to postParse
https://discourse.llvm.org/t/parallel-input-file-parsing/60164

initializeSymbols currently sets Defined::section and handles non-prevailing
COMDAT groups. Move the code to the parallel postParse to reduce work from the
single-threading code path and make parallel section initialization infeasible.

Postpone reporting duplicate symbol errors so that the messages have the
section information. (`Defined::section` is assigned in postParse and another
thread may not have the information).

* duplicated-synthetic-sym.s: BinaryFile duplicate definition (very rare) now
  has no section information
* comdat-binding: `%t/w.o %t/g.o` leads to an undesired undefined symbol. This
  is not ideal but we report a diagnostic to inform that this is unsupported.
  (See release note)
* comdat-discarded-lazy.s: %tdef.o is unextracted. The new behavior (discarded
  section error) makes more sense
* i386-comdat.s: switched to a better approach working around
  .gnu.linkonce.t.__x86.get_pc_thunk.bx in glibc<2.32 for x86-32.
  Drop the ancient no-longer-relevant workaround for __i686.get_pc_thunk.bx

Depends on D120640

Differential Revision: https://reviews.llvm.org/D120626
2022-03-15 19:24:41 -07:00
Haocong.Lu
6a54776fe0 [RISCV] Select SRLI+SLLI for AND with leading ones mask
Select SRLI+SLLI for and i64 %x, imm if the imm is a leading ones mask.
It's useful in RV64 when the mask exceeds simm32 (cannot be generated by LUI).

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D121598
2022-03-16 02:10:57 +00:00
Sam McCall
e4cab4e24d [lit] Remove clang_libs_dir
Seems to have been added accidentally in 58db03a116 and then
copied into clangd by me (but not actually needed).
2022-03-16 03:03:02 +01:00
Fangrui Song
9b61fff0eb Revert D120626 "[ELF] Move section assignment from initializeSymbols to postParse"
This reverts commit c30e6447c0.
It exposed brittle support for __x86.get_pc_thunk.bx.
Need to think a bit how to support __x86.get_pc_thunk.bx.
2022-03-15 19:00:54 -07:00
Fangrui Song
48a02152ab [ELF][test] Improve i386-linkonce.s
Make it behave like the glibc<2.32 .gnu.linkonce usage that we want to work around.
2022-03-15 18:47:52 -07:00
Shafik Yaghmour
37400dd3e8 [LLDB][NFC] Remove dead code from Section.cpp
Removing comment out code, looks like debugging code left over from a while ago.
2022-03-15 18:11:30 -07:00
Vitaly Buka
678f88e0e2 [lsan] Attempt to fix s390x after a63932a8 2022-03-15 18:02:03 -07:00
Sam Clegg
4690bf2ed3 [lld][WebAssembly] Take advantage of extended const expressions when available
In particular we use these in two places:

1. When building PIC code we no longer need to combine output segments
   into a single segment that can be initialized at `__memory_base`.
   Instead each segment can encode its offset from `__memory_base` in
   its initializer.  e.g.

```
(i32.add (global.get __memory_base) (i32.const offset)
```

2. When building PIC code we no longer need to relocation internalized
   global addresses.  We can just initialize them with their correct
   offsets.

Differential Revision: https://reviews.llvm.org/D121420
2022-03-15 17:50:05 -07:00
Zequan Wu
384e890dd3 [LLDB][NativePDB] Remove REQUIRES: system-windows for local-variables-regsiters.s 2022-03-15 17:49:46 -07:00
Nico Weber
fd20ec6b6e [gn build] (manually) port 89cd86bbc5 (clang-pseudo move) 2022-03-15 20:45:36 -04:00
Aart Bik
f98e1c40ca [mlir][sparse] add one extra index test on f32 matrix
Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D121743
2022-03-15 17:43:30 -07:00
River Riddle
3c405c3b9b [mlir:PDLInterp][NFC] Switch to using prefixed accessors
PDLInterp is effectively an internal dialect, so there isn't a need to
stage the switch.
2022-03-15 17:36:36 -07:00
River Riddle
ccfcfa9423 [mlir:Toy][NFC] Switch toy to use prefixed accessors 2022-03-15 17:36:36 -07:00
Jez Ng
8ce3750ff6 [lld-macho] Set FinalDefinitionInLinkageUnit on most LTO externs
Since Mach-O has a two-level namespace (unlike ELF), we can usually set
this property to true.

(I believe this setting is only available in the new LTO backend, so I
can't really use ld64 / libLTO's behavior as a reference here... I'm
just doing what I think is correct.)

See {D119294} for the work done to calculate the `interposable` used in
this diff.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D119506
2022-03-15 20:25:06 -04:00
Fangrui Song
c1d4c67718 [ELF] Suppress duplicate symbol error for __x86.get_pc_thunk.bx 2022-03-15 17:20:29 -07:00
Tobias Nießen
eaafa70017 [libfuzzer] improve introductory sentence
This merely adds a missing "an" in the introductory sentence.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D121760
2022-03-15 17:19:20 -07:00
Sam McCall
89cd86bbc5 Reapply [pseudo] Move pseudoparser from clang to clang-tools-extra"
This reverts commit 049f4e4eab.

The problem was a stray dependency in CLANG_TEST_DEPS which caused cmake
to fail if clang-pseudo wasn't built. This is now removed.
2022-03-16 01:10:55 +01:00
Sam McCall
049f4e4eab Revert "[pseudo] Move pseudoparser from clang to clang-tools-extra"
This reverts commit b97856c4cf.

Breaks a bunch of bots:
https://lab.llvm.org/buildbot/#/builders/193/builds/8513
2022-03-16 01:06:24 +01:00
Michael Jones
74b411d38c [libc][bazel] split support_standalone_cpp target
previously the support_standalone_cpp target contained all of the files
in the __support/cpp folder. This change splits these out so that only
what is needed is included. In addition, this change adds the new
support files that previously didn't have targets.

Reviewed By: lntue, gchatelet

Differential Revision: https://reviews.llvm.org/D121314
2022-03-15 16:40:43 -07:00
Philip Reames
1cfa986d68 [SLP] Optionally preserve MemorySSA
This initial patch adds code to preserve MemorySSA through a run of SLP vectorizer. The eventual plan is to use MemorySSA to accelerate SLP's memory dependence checking, but we're a ways from that.  In particular, this patch is correct, but really slow. It's being landed so that we can work incrementally in tree, not because it's expected to be useful to anyone just yet.

The broader effort is being tracked in https://github.com/llvm/llvm-project/issues/54256.  Its worth noting expicitly that this may not work out, and if not, we will be reverting all of the MSSA support in SLP at some point in the next few weeks.

Differential Revision: https://reviews.llvm.org/D117926
2022-03-15 16:36:15 -07:00
Sam McCall
b97856c4cf [pseudo] Move pseudoparser from clang to clang-tools-extra
This should make clearer that:
 - it's not part of clang proper
 - there's no expectation to update it along with clang (beyond green tests)
 - clang should not depend on it

This is intended to be expose a library, so unlike other tools has a split
between include/ and lib/.

The main renames are:
  clang/lib/Tooling/Syntax/Pseudo/*           => clang-tools-extra/pseudo/lib/*
  clang/include/clang/Tooling/Syntax/Pseudo/* => clang-tools-extra/pseudo/include/clang-pseudo/*
  clang/tools/clang/pseudo/*                  => clang-tools-extra/pseudo/tool/*
  clang/test/Syntax/*                         => clang-tools-extra/pseudo/test/*
  clang/unittests/Tooling/Syntax/Pseudo/*     => clang-tools-extra/pseudo/unittests/*
  #include "clang/Tooling/Syntax/Pseudo/*"    => #include "clang-pseudo/*"
  namespace clang::syntax::pseudo             => namespace clang::pseudo
  check-clang                                 => check-clang-pseudo
  clangToolingSyntaxPseudo                    => clangPseudo
The clang-pseudo and ClangPseudoTests binaries are not renamed.

See discussion around:
https://discourse.llvm.org/t/rfc-a-c-pseudo-parser-for-tooling/59217/50

Differential Revision: https://reviews.llvm.org/D121233
2022-03-16 00:14:11 +01:00
Nico Weber
78d29203ad [gn build] (manually) port 2b69eb4a7d 2022-03-15 19:05:46 -04:00
Bixia Zheng
3580721a59 [mlir][sparse][taco] Support the use of index values in tensor expressions.
PyTACO DSL doesn't support the use of index values as in A[i] = B[i]+ i.
We extend the DSL to support such a use in MLIR-PyTACO.

Remove an obsolete unit test. Add unit tests and PyTACO tests.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D121716
2022-03-15 15:30:55 -07:00
Sam Clegg
86c90f9bfd [lld][WebAssembly] Add --unresolved-symbols=import-dynamic
This is a new mode for handling unresolved symbols that allows all
symbols to be imported in the same that they would be in the case of
`-fpie` or `-shared`, but generting an otherwise fixed/non-relocatable
binary.

Code linked in this way should still be compiled with `-fPIC` so that
data symbols can be resolved via imports.

This essentially allows the building of static binaries that have
dynamic imports.  See:
https://github.com/emscripten-core/emscripten/issues/12682

As with other uses of the experimental dynamic linking ABI, this
behaviour will produce a warning unless run with `--experimental-pic`.

Differential Revision: https://reviews.llvm.org/D91577
2022-03-15 15:10:21 -07:00
Valentin Clement
7783de7fe3
[flang] Move null entry at the correct place
This is a fix for failing buildbot
https://lab.llvm.org/buildbot/#/builders/172/builds/9652
2022-03-15 22:56:48 +01:00
River Riddle
ee2c6cd906 [mlir][toy] Define a FuncOp operation in toy and drop the dependence on FuncOp
FuncOp is being moved out of the builtin dialect, and defining a custom
toy operation showcases various aspects of defining function-like operation
(e.g. inlining, passes, etc.).

Differential Revision: https://reviews.llvm.org/D121264
2022-03-15 14:55:51 -07:00
River Riddle
f96a8675cd [mlir][PDL] Define a new PDLInterp::FuncOp operation and drop uses of FuncOp
Defining our own function operation allows for the PDL interpreter
to be more self contained, and also removes any dependency on FuncOp;
which is moving out of the Builtin dialect.

Differential Revision: https://reviews.llvm.org/D121253
2022-03-15 14:55:51 -07:00
Siva Chandra Reddy
e9c9ee9fe6 [libc][NFC] Fix typos and reduntent code triggering compiler warinings. 2022-03-15 21:51:12 +00:00
Ian Bearman
7ecb7efc89 [MLIR] UnknownLoc on Inlinable Calls in LLVMIR Translation
During MLIR translation to LLVMIR if an inlineable call has an UnkownLoc we get this error message:

```
inlinable function call in a function with debug info must have a !dbg location
  call void @callee()
```

There is code that checks for this case and strips debug information to avoid this situation. I'm expanding this code to handle the case where an debug location points at a UnknownLoc. For example, a NamedLoc whose child location is an UnknownLoc.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D121633
2022-03-15 14:48:50 -07:00
Fangrui Song
6be457c14d [ELF] Work around not-fully-supported .gnu.linkonce.t.__x86.get_pc_thunk.bx 2022-03-15 14:48:29 -07:00
Jonas Devlieghere
527d2c5867
[lldb] Fix AppleObjCRuntime log channels
The log channel was changed from Types to Commands in
a007a6d844:

-    Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_TYPES));
+    Log *log = GetLog(LLDBLog::Process | LLDBLog::Commands);
2022-03-15 14:47:33 -07:00
Valentin Clement
c3ba885dd7
[flang] Fix intrinsic entry 2022-03-15 22:40:11 +01:00
Valentin Clement
a1918fdf08
[flang] Lower random_[init|number|seed] intrinsics
Thsi patch add the infrastructure to lower the random related
intrinsics:

- `random_init`
- `random_number`
- `random_seed`

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

Reviewed By: PeteSteinfeld, schweitz

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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-15 22:31:56 +01:00