Commit Graph

426785 Commits

Author SHA1 Message Date
jeanPerier a370a4ffce
[flang] Avoid raising a TODO in fir.boxproc rewrite when not needed (#1560)
The pass was raising TODOs when a function both had a fir.boxproc<> argument
and a fir.type<> argument (even if the fir.type<> did not contain a
fir.boxproc itself).

Prevent the TODO from firing when a fir.type<> does not actually contain
a fir.boxproc. Add the location for the remaining TODO (it will be
needed when procedure pointer components are supported in lowering).

FYI, I actually tried to just implement the TODO, but I there is  a funny
issue. When creating the new fir::RecordType, since the name and context
are the same as the type being translated, fir::RecordType:get just
returns the existing type, and there is no way to change it (finalize()
does nothing since it is already finalized). So this will require to add
the ability to mutate the existing type, and I am not sure what are the
MLIR constraints here, so I escaped and left the TODO for that case.

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

Reviewed By: jeanPerier, PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-06-13 17:36:56 +02:00
Jean Perier c8a9afe7c8
[flang] Handle reversed bounds and negative length in inlined allocation
ALLOCATE statement allows reversed bounds (see Fortran 2018 9.7.1.2
point 1) in which case the extents are zero.

The same applies for the character length provided in the type spec that
can be negative. In which case the new length is zero.

Use genMaxWithZero to deal with these cases.

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

Reviewed By: jeanPerier, PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-06-13 17:35:03 +02:00
Joseph Huber 1054a73187 [Clang] Change host/device only compilation to a driver mode
We use the flags `--offload-host-only` and `--offload-device-only` to
change the driver's code generation for offloading programs. These are
currently parsed out independently in many places. This patch simply
refactors this to work as a mode for the Driver. This stopped us from
emitting warnings if unused because it's always used now, but I don't
think this is a great loss.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D127515
2022-06-13 11:33:54 -04:00
vdonaldson 70ade047a4
[flang] system_clock intrinsic calls with dynamically optional arguments
system_clock intrinsic calls with dynamically optional arguments

Modify intrinsic system_clock calls to allow for an argument that is optional
or a disassociated pointer or an unallocated allocatable.  A call with such an
argument is the same as a call that does not specify that argument.

Rename (genIsNotNull -> genIsNotNullAddr) and (genIsNull -> genIsNullAddr)
and add a use of genIsNotNullAddr.

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-06-13 17:33:28 +02:00
Guillaume Chatelet 111b32ecb4 [NFC][Alignment] Use getAlign in Attributor classes 2022-06-13 15:13:05 +00:00
Guillaume Chatelet 2887dd754e [NFC][Alignment] Use getAlign in VNCoercion 2022-06-13 15:13:05 +00:00
Guillaume Chatelet dff32e36f6 [NFC][Alignment] Use getAlign in SPIRVEmitIntrinsics 2022-06-13 15:13:05 +00:00
Guillaume Chatelet 5a293d21fc [NFC][Alignment] Use getAlign in SelectionDAGBuilder 2022-06-13 15:13:05 +00:00
Jan Svoboda d9390b6ac3 Reapply "[clang][lex] NFCI: Use DirectoryEntryRef in HeaderSearch::load*()"
This reverts commit 340654e0f2, essentially reapplying 1d3ba05e4a.

The test VFS/real-path-found-first.m that was failing on Windows is now passing with a workaround.
2022-06-13 17:03:32 +02:00
Matthias Springer 6ab1ed43f5 [mlir][shape][bufferize] Fix typo in external model
Differential Revision: https://reviews.llvm.org/D127639
2022-06-13 16:38:56 +02:00
Kazu Hirata 23d9ca10ae [CodeGen] Remove EvictionTrack (NFC)
The last of getEvictor use was removed on Jun 5, 2022 in commit
5c06f7168f, which was itself a patch to
remove unused code.

Once we remove getEvictor, EvictionTrack becomes a write-only data
structure.  The data in it won't affect compilation, so the entire
class is essentially dead.
2022-06-13 07:21:29 -07:00
Quinn Pham 35aaf54823 [clang][driver] fix to correctly set devtoolset on RHEL
This patch correctly sets the devtoolset on RHEL.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D127310
2022-06-13 09:12:49 -05:00
Andrzej Warzynski e9bf76675d [flang] Add target/triple in a test
A test added in https://reviews.llvm.org/D127207 is missing
target/triple. This has caused the PowerPC buildbot to start failing:
  * https://lab.llvm.org/buildbot/#/builders/21/builds/42860
(on PowerPC `; CHECK: ret` should be replaced with `; CHECK: `blr`).

Sending this without a review as the fix is rather straightforward. Note
that I've decided to add triple/target instead of e.g. removing:
`; CHECK: ret`. That's for consistency with other tests that generate
assembly. We could change that if that's what folks prefer.
2022-06-13 14:01:37 +00:00
Kazu Hirata 246e83e973 [GlobalISel] Remove buildSequence (NFC)
The last use was removed on Jun 27, 2019 in commit
8138996128.
2022-06-13 06:58:36 -07:00
Sanjay Patel 310adb658c [InstCombine] reorder mask folds for efficiency
This shows narrowing improvements on the logic tests
(transforms recently added with e247b0e5c9).

This is not a complete fix. That would require adding
folds to visitOr/visitXor. But it enables the expected
transforms for the basic patterns in the affected tests.
2022-06-13 09:49:57 -04:00
Stephen Tozer 30bb659c6f [Dexter] Allow Dexter watch commands to specify a range of acceptable FP values
This patch adds an optional argument to DexExpectWatchBase, float_range,
which defines a +- acceptance range for expected floating point values.
If passed, this assumes every expected value to be a floating point
value, and an exception will be thrown if this is not the case.

Differential Revision: https://reviews.llvm.org/D124511
2022-06-13 14:44:28 +01:00
Arnamoy Bhattacharyya 3f4a63e5f8 [Flang][OpenMP] Implementation of lowering of SIMD construct.
This patch adds code so that using bbc we are able to see an end-to-end lowering of simd construct in action.

Reviewed By: kiranchandramohan, peixin, shraiysh

Differential Revision: https://reviews.llvm.org/D125282
2022-06-13 09:46:20 -04:00
Guillaume Chatelet 45a5cd41e5 [NFC][Alignment] Simplify code in MemorySanitizer 2022-06-13 13:36:36 +00:00
Guillaume Chatelet 4296f91323 [NFC][Alignment] Simplify code in JSONExporter 2022-06-13 13:36:36 +00:00
Guillaume Chatelet 310e3279d5 [NFC] Remove dead code in MipsFastISel 2022-06-13 13:36:36 +00:00
Guillaume Chatelet 93082108b7 [NFC][Alignment] Use getAlign in DXILBitcodeWriter 2022-06-13 13:36:36 +00:00
Guillaume Chatelet 01a8b89edb [NFC][Alignment] Use getAlign in ARMFastISel 2022-06-13 13:36:36 +00:00
Nikita Popov b9a7dea917 [SelectionDAG] Handle trapping aggregate (PR49839)
Call canTrap() on Constant to account for trapping
ConstantAggregate.
2022-06-13 15:06:53 +02:00
Nikita Popov 483a4b2226 [SelectionDAG] Add test for PR49839 (NFC) 2022-06-13 15:06:53 +02:00
Guillaume Chatelet 86f455750b [NFC] Remove dead code 2022-06-13 12:59:38 +00:00
Guillaume Chatelet eeda07e14b [NFC][Alignment] Use proper type in tests 2022-06-13 12:59:38 +00:00
Guillaume Chatelet a6c2ab0c3f [NFC][Alignment] Use proper type in instrumentLoadOrStore 2022-06-13 12:59:38 +00:00
Guillaume Chatelet d1a27d0b9c [NFC][Alignment] Use proper version of getAlign 2022-06-13 12:59:38 +00:00
Guillaume Chatelet 40109fa101 [NFC][Alignment] Use proper type in LLVMGetAlignment 2022-06-13 12:59:37 +00:00
Nikita Popov 571c713144 [SimplifyCFG] Handle trapping aggregates (PR49839)
Handle the fact that not only constant expressions, but also
constant aggregates containing expressions can trap.

This still doesn't fix the original C reproducer, probably due to
more issues remaining in other passes.
2022-06-13 14:56:49 +02:00
Amaury Séchet 9ecf423453 [AArch64] Autogenerate sve-fixed-length tests. NFC
As per title. This makes it easier to work onc hange that require "shotgun diffs" over the codebase.

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D127118
2022-06-13 12:50:07 +00:00
Vladislav Khmelevsky 6e26ffa064 [BOLT][AARCH64] Skip R_AARCH64_LD_PREL_LO19 relocation
Supress failed to analyze relocations warning for R_AARCH64_LD_PREL_LO19
relocation. This relocation is mostly used to get value stored in CI and
we don't process it since we are caluclating target address using the
instruction value in evaluateMemOperandTarget().

Differential Revision: https://reviews.llvm.org/D127413
2022-06-13 15:40:06 +03:00
wangpc 93b4a41b55 [RISCV] Add vread_csr and vwrite_csr to riscv_vector.h
These two functions are described in RVV intrinsics doc
to read/write RVV CSRs. This matches what GCC does.

This reapply aebe24a which was reverted in 0f6f429 due
to missing REQUIRES in tests.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D125875
2022-06-13 20:38:52 +08:00
Jay Foad 438c312c03 [AMDGPU] Add GFX11 flat scratch test coverage 2022-06-13 13:38:12 +01:00
Nikita Popov abefed6f97 [SimplifyCFG] Add test for PR49839 (NFC) 2022-06-13 14:35:09 +02:00
Benjamin Kramer 5724231af2 [InstCombine] Only fold trunc(ext) pairs to bitcast if the source and destination types are the same
This used to be always the case, but the addition of bfloat to the type
matrix makes this invalid.
2022-06-13 14:34:18 +02:00
Frederik Gossen ff6ce9e8fc Add `createDynamicDimValues` to tensor dialect utils
The function creates dim ops for each dynamic dimension of the raked tensor
argument and returns these as values.

Differential Revision: https://reviews.llvm.org/D127533
2022-06-13 08:26:28 -04:00
Valentin Clement a405db9c37
[flang][NFC] Fix typo 2022-06-13 14:19:45 +02:00
LLVM GN Syncbot 5a0ec6ff68 [gn build] Port e183bf8e15 2022-06-13 12:03:48 +00:00
Jan Svoboda 2de36d0369 [clang][driver] Only run multi-arch tests on Darwin
This fixes the test introduced in a85670001b that causes failures on non-Darwin systems.
2022-06-13 14:03:23 +02:00
Jez Ng b422dac240 [lld-macho][reland] Support EH frames under arm64
This reverts commit 10641a42e2.

Differential Revision: https://reviews.llvm.org/D124561
2022-06-13 07:45:27 -04:00
Jez Ng e183bf8e15 [lld-macho][reland] Initial support for EH Frames
This reverts commit 942f4e3a7c.

The additional change required to avoid the assertion errors seen
previously is:

  --- a/lld/MachO/ICF.cpp
  +++ b/lld/MachO/ICF.cpp
  @@ -443,7 +443,9 @@ void macho::foldIdenticalSections() {
                                 /*relocVA=*/0);
           isec->data = copy;
         }
  -    } else {
  +    } else if (!isEhFrameSection(isec)) {
  +      // EH frames are gathered as hashables from unwindEntry above; give a
  +      // unique ID to everything else.
         isec->icfEqClass[0] = ++icfUniqueID;
       }
     }

Differential Revision: https://reviews.llvm.org/D123435
2022-06-13 07:45:16 -04:00
Jez Ng e4a21e1644 [MC] Fix likely uninitialized memory bug
See https://reviews.llvm.org/D122258#inline-1223493. I can't repro the
issue locally but this seems like the likely culprit.

Reviewed By: uabelho

Differential Revision: https://reviews.llvm.org/D127630
2022-06-13 07:41:17 -04:00
wangpc 0f6f4295d1 Revert "[RISCV] Add vread_csr and vwrite_csr to riscv_vector.h"
This reverts commit aebe24a856.

`REQUIRES` for RISCV target is needed in tests.
2022-06-13 19:31:25 +08:00
Jan Svoboda a85670001b [clang][driver] Fix compilation database dump with multiple architectures
Command lines with multiple `-arch` arguments expand into multiple entries in the compilation database. However, the file writes are not appending, meaning subsequent writes end up overwriting the previous ones, resulting in garbled output.

This patch fixes that by always appending to the file.

rdar://90165004

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D121997
2022-06-13 13:30:57 +02:00
Jan Svoboda c12577c61d [clang][driver] Introduce new -fdriver-only flag
This patch introduces the new -fdriver-only flag which instructs Clang to only execute the driver logic without running individual jobs. In a way, this is very similar to -###, with the following differences:
 * it doesn't automatically print all jobs,
 * it doesn't avoid side effects (e.g. it will generate compilation database when -MJ is specified).

This flag will be useful in testing D121997.

Reviewed By: dexonsmith, egorzhdan

Differential Revision: https://reviews.llvm.org/D127408
2022-06-13 13:30:56 +02:00
Mats Petersson 84b9ae6624 [flang]Add support for do concurrent
[flang]Add support for do concurrent

Upstreaming from fir-dev on https://github.com/flang-compiler/f18-llvm-project

Support for concurrent execution in do-loops.

A selection of tests are also added.

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D127240
2022-06-13 12:28:49 +01:00
wangpc aebe24a856 [RISCV] Add vread_csr and vwrite_csr to riscv_vector.h
These two functions are described in RVV intrinsics doc
to read/write RVV CSRs. This matches what GCC does.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D125875
2022-06-13 19:12:15 +08:00
Simon Pilgrim 7d8fd4f5db [DAG] visitINSERT_VECTOR_ELT - attempt to reconstruct BUILD_VECTOR before other fold interfere
Another issue unearthed by D127115

We take a long time to canonicalize an insert_vector_elt chain before being able to convert it into a build_vector - even if they are already in ascending insertion order, we fold the nodes one at a time into the build_vector 'seed', leaving plenty of time for other folds to alter it (in particular recognising when they come from extract_vector_elt resulting in a shuffle_vector that is much harder to fold with).

D127115 makes this particularly difficult as we're almost guaranteed to have the lost the sequence before all possible insertions have been folded.

This patch proposes to begin at the last insertion and attempt to collect all the (oneuse) insertions right away and create the build_vector before its too late.

Differential Revision: https://reviews.llvm.org/D127595
2022-06-13 11:48:18 +01:00
Simon Pilgrim f97e15ef45 [ARM] Fix "local variable is initialized but not referenced" MSVX warning. NFC 2022-06-13 11:48:06 +01:00