Commit Graph

426870 Commits

Author SHA1 Message Date
owenca 462b49f18c [libcxx] Remove extraneous '---' lines in .clang-format files 2022-06-15 01:34:37 -07:00
Benjamin Kramer 0886ea902b [mlir][Arith] Fix a use-after-free after rewriting ops to unsigned
Just short-circuit when a change was made, the erased value is invalid
after that. Found by asan.

This pass looks like it could use rewrite patterns instead which don't
have this issue, but let's fix the asan build first.
2022-06-15 10:28:43 +02:00
Kito Cheng 687e56614f [RISCV] Fixing undefined physical register issue when subreg liveness tracking enabled.
RISC-V expand register tuple spilling into series of register spilling after
register allocation phase by the pseudo instruction expansion, however part of
register tuple might be still undefined during spilling, machine verifier will
complain the spill instruction is using an undefined physical register.

Optimal solution should be doing liveness analysis and do not emit spill
and reload for those undefined parts, but accurate liveness info at that point
is not so easy to get.

So the suboptimal solution is still spill and reload those undefined parts, but
adding implicit-use of super register to spill function, then machine
verifier will only report report using undefined physical register if
the when whole super register is undefined, and this behavior are also
documented in MachineVerifier::checkLiveness[1].

Example for demo what happend:

```
  v10m2 = xxx
  # v12m2 not define yet
  PseudoVSPILL2_M2 v10m2_v12m2
  ...
```

After expansion:
```
  v10m2 = xxx
  # v12m2 not define yet
  # Expand PseudoVSPILL2_M2 v10m2_v12m2 to 2 vs2r
  VS2R_V v10m2
  VS2R_V v12m2 # Use undef reg!
```

What this patch did:
```
  v10m2 = xxx
  # v12m2 not define yet
  # Expand PseudoVSPILL2_M2 v10m2_v12m2 to 2 vs2r
  VS2R_V v10m2 implicit v10m2_v12m2
  # Use undef reg (v12m2), but v10m2_v12m2 ins't totally undef, so
  # that's OK.
  VS2R_V v12m2 implicit v10m2_v12m2
```

[1] https://github.com/llvm-mirror/llvm/blob/master/lib/CodeGen/MachineVerifier.cpp#L2016-L2019

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D127642
2022-06-15 16:23:39 +08:00
Matthias Springer a36c801d12 [mlir][bufferize] Better implementation of AnalysisState::isTensorYielded
If `create-deallocs=0`, mark all bufferization.alloc_tensor ops as escaping. (Unless they already have an `escape` attribute.) In the absence of analysis information, check SSA use-def chains to see if the value may be yielded.

Differential Revision: https://reviews.llvm.org/D127302
2022-06-15 10:15:47 +02:00
Siva Chandra Reddy 0f72a0d2ae [libc][Obvious] Removed few unused vars. 2022-06-15 08:13:38 +00:00
Matthias Springer a3bca1181b [mlir][bufferize][NFC] Merge AlwaysCopyAnalysisState into AnalysisState
`AnalysisState` now has default implementations of all virtual functions.

Differential Revision: https://reviews.llvm.org/D127301
2022-06-15 10:08:52 +02:00
Heejin Ahn b2f4112f25 [InstCombine] Improve check for catchswitch BBs (NFC)
Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D127810
2022-06-15 01:06:13 -07:00
Matthias Springer cd80617a8a [mlir][bufferize][NFC] Make func BufferizableOpInterface impl compatible with One-Shot Bufferize
Bufferization of the func dialect must go through `OneShotModuleBufferize`. With this change, the analysis interface methods of the BufferizableOpInterface of func dialect ops can be used together with the normal `OneShotBufferize`. (In the absence of analysis information, they will return conservative results.)

Differential Revision: https://reviews.llvm.org/D127299
2022-06-15 10:05:15 +02:00
Peixin-Qiao 9441003b52 [flang][OpenMP] Add one semantic check for data-sharing clauses
As OpenMP 5.0, for firstprivate, lastprivate, copyin, and copyprivate
clauses, if the list item is a polymorphic variable with the allocatable
attribute, the behavior is unspecified.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D127601
2022-06-15 16:02:27 +08:00
Matthias Springer ad2e635fae [mlir][linalg][bufferize] Remove always-aliasing-with-dest option
This flag was introduced for a use case in IREE, but it is no longer needed.

Differential Revision: https://reviews.llvm.org/D126965
2022-06-15 09:56:53 +02:00
Martin Boehme 665da187cc [Clang] Add the `annotate_type` attribute
This is an analog to the `annotate` attribute but for types. The intent is to allow adding arbitrary annotations to types for use in static analysis tools.

For details, see this RFC:

https://discourse.llvm.org/t/rfc-new-attribute-annotate-type-iteration-2/61378

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D111548
2022-06-15 09:47:28 +02:00
Peixin-Qiao 3151fb5ef7 [flang] Change C889 from error into warning
This constraint is used in OMP2012 benchmark, and other compilers do not
enforce it. Change it into one warning. This addresses the issue
https://github.com/llvm/llvm-project/issues/56003.

Reviewed By: klausler, kiranchandramohan

Differential Revision: https://reviews.llvm.org/D127740
2022-06-15 15:39:13 +08:00
Nikita Popov 2dac2c4f76 [SimplifyLibCalls] Drop duplicate check (NFC)
The same condition already exists inside optimizeMemCmpConstantSize().
2022-06-15 09:37:09 +02:00
Austin Kerbow 4bba82116a [AMDGPU] Fix buildbot failures after 48ebc1af29
Some buildbots (lto, windows) were failing due to some function reference
variables being improperly initialized.
2022-06-15 00:23:30 -07:00
Siva Chandra Reddy f0e608de27 [libc] Add linux threads targets only if __support/OSUtil targets are available. 2022-06-15 07:18:57 +00:00
Petr Hosek 7524fe962e [libFuzzer] Use the compiler to link the relocatable object
Rather than invoking the linker directly, let the compiler driver
handle it. This ensures that we use the correct linker in the case
of cross-compiling.

Differential Revision: https://reviews.llvm.org/D127828
2022-06-15 07:16:40 +00:00
Matthias Springer d361ecbd0d [mlir][SCF][bufferize] Implement `resolveConflicts` for SCF ops
scf::ForOp and scf::WhileOp must insert buffer copies not only for out-of-place bufferizations, but also to enforce additional invariants wrt. to buffer aliasing behavior. This is currently happening in the respective `bufferize` methods. With this change, the tensor copy insertion pass will also enforce these invariants by inserting copies. The `bufferize` methods can then be simplified and made independent of the `AnalysisState` data structure in a subsequent change.

Differential Revision: https://reviews.llvm.org/D126822
2022-06-15 09:07:31 +02:00
owenca 485c18c11b [mlir] Add missing newline at end of .clang-format file 2022-06-14 23:59:00 -07:00
chenglin.bi 04a84e3331 [LSR] Add test for LoopStrenghtReduce for Ldp; NFC
#53877
2022-06-15 14:51:39 +08:00
Siva Chandra Reddy a099139fa9 [libc][NFC] Add src.__support.OSUtil targets conditionally.
Before this change, they were unconditionally added, irrespective of the
availability of the architecture specific pieces.
2022-06-15 06:33:31 +00:00
Kadir Cetinkaya 3ecfeb4c2f
[clangd] Wire up compilation for style blocks
Differential Revision: https://reviews.llvm.org/D127749
2022-06-15 08:15:32 +02:00
Yeting Kuo 9096a52566 [RISCV] Teach vsetvli insertion to not insert redundant vsetvli right after VLEFF/VLSEGFF.
VSETVLIInfos right after VLEFF/VLSEGFF are currently unknown since they modify
VL. Unknown VSETVLIInfos make next vector operations needed to be inserted
VSET(I)VLI. Actually the next vector operation of VLEFF/VLSEGFF may not need to
be inserted VSET(I)VLI if it uses same VTYPE and the resulted vl of
VLEFF/VLSEGFF.

Take the below C code as an example,

  vint8m4_t vec_src1 = vle8ff_v_i8m4(str1, &new_vl, vl);
  vbool2_t mask1 = vmseq_vx_i8m4_b2(vec_src1, 0, new_vl);
  vsetvli insertion adds a redundant vsetvli for that,

Assembly result:
  vsetvli a2,a2,e8,m4,ta,mu
  vle8ff.v v28,(a0)
  csrr a3,vl ; redundant
  vsetvli zero,a3,e8,m4,ta,mu ; redundant
  vmseq.vi v25,v28,0

After D126794, VLEFF/VLSEGFF has a define having value of VL. The patch consider
there is a ghost vsetvli right after VLEFF/VLSEGFF. The ghost VSET(I)LIs use the
vl output of the VLEFF/VLSEGFF as its AVL and same VTYPE of the VLEFF/VLSEGFF.
The ghost vsetvli must be redundant, and we could use it to get the VSETVLIInfo
right after VLEFF/VLSEGFF.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D127576
2022-06-15 13:58:40 +08:00
Ping Deng c06f77ec0d [SelectionDAG] fold 'Op0 - (X * MulC)' to 'Op0 + (X << log2(-MulC))'
Reviewed By: craig.topper, spatel

Differential Revision: https://reviews.llvm.org/D127474
2022-06-15 05:50:18 +00:00
Siva Chandra Reddy 2eafb96289 [libc][NFC] Use uint32_t to represent futex words.
Futexes are 32 bits in size on all platforms, including 64-bit systems.
2022-06-15 05:44:00 +00:00
owenca 07b3446d72 [clang-format] Never analyze insert/remove braces in the same pass
Turn off RemoveBracesLLVM while analyzing InsertBraces and vice
versa to avoid potential interference of each other and better the
performance.

Differential Revision: https://reviews.llvm.org/D127685
2022-06-14 22:42:54 -07:00
LLVM GN Syncbot b5e9241eba [gn build] Port 48ebc1af29 2022-06-15 05:24:12 +00:00
Austin Kerbow 48ebc1af29 [AMDGPU] Add more expressive sched_barrier controls
The sched_barrier builtin allow the scheduler's behavior to be shaped by users
when very specific codegen is needed in order to create highly optimized code.
This patch adds more granular control over the types of instructions that are
allowed to be reordered with respect to one or multiple sched_barriers. A mask
is used to specify groups of instructions that should be allowed to be scheduled
around a sched_barrier. The details about this mask may be used can be found in
llvm/include/llvm/IR/IntrinsicsAMDGPU.td.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D127123
2022-06-14 22:03:05 -07:00
Austin Kerbow bd9eed3aec [AMDGPU] Add isMFMA helper function. NFC
Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D127124
2022-06-14 22:01:49 -07:00
Fangrui Song 94d1692aa1 [MC] Remove unused MCStreamer::SwitchSection
switchSection should be used instead.
2022-06-14 21:25:56 -07:00
Peter S. Housel 612f0a7789 [ORC-RT] Add integration tests for AArch64
This change adds test cases targeting the AArch64 Linux platform to
the ORC runtime integration test suite.

Reviewed By: lhames, sunho

Differential Revision: https://reviews.llvm.org/D127720
2022-06-14 20:49:56 -07:00
Ping Deng a0af049614 [RISCV][NFC] Add more tests for instruction selection of 'mul'
precommit tests for D127474

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D127475
2022-06-15 03:48:17 +00:00
Joe Loser cb48ed38b8
[libc++][NFCI] span: replace enable_if with concepts
Several span constructors use `enable_if` which is verbose. Replace these with
concepts or requires expressions.
2022-06-14 21:25:50 -06:00
Venkata Ramanaiah Nalamothu ab7fcf2484 [LLDB] CommandObjectThreadUntil::DoExecute() sets the wrong selected thread ID
For the 'thread until' command, the selected thread ID, to perform the operation on, could be of the current thread or the specified thread.

Reviewed By: jingham

Differential Revision: https://reviews.llvm.org/D48865
2022-06-15 08:52:29 +05:30
Lei Zhang 06c6758a98 [mlir][spirv] Handle corner cases for math.powf conversion
Per GLSL Pow extended instruction spec: "Result is undefined if
x < 0. Result is undefined if x = 0 and y <= 0." So we need to
handle negative `x` values specifically.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D127816
2022-06-14 23:02:44 -04:00
wangpc 8910349e43 [RISCV][NFC] Set default value for BaseInstr in RISCVVPseudo
Since almost all pseudos have the same form of BaseInstr, we
can just set it as default value to reduce some lines.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D127632
2022-06-15 10:59:45 +08:00
Ben Shi 753b915167 [Driver] Improve linking options for target AVR
1. Support user specified linker (-fuse-ld)
2. Support user specified linker script (-T)

Reviewed By: MaskRay, haowei

Differential Revision: https://reviews.llvm.org/D126192
2022-06-15 02:57:31 +00:00
Amir Ayupov 5965878d4d [X86][NFC] Use mnemonic tables in validateInstruction 4/4
Group switch cases by opcode:
- VGATHERDPD
- VGATHERDPS
- VGATHERQPD
- VGATHERQPS
- VPGATHERDD
- VPGATHERDQ
- VPGATHERQD
- VPGATHERQQ

Distinguish masked vs non-masked forms by EVEX encoding.

Reviewed By: skan, craig.topper

Differential Revision: https://reviews.llvm.org/D127719
2022-06-14 19:53:44 -07:00
jacquesguan 701a282af4 [mlir][Vector] Fold consecutive bitcast.
This patch supports to fold consecutive bitcast into one bitcast.

Differential Revision: https://reviews.llvm.org/D127723
2022-06-15 10:45:05 +08:00
lewuathe 95bdbb9747 [mlir][affine] Make loop tiling default options explicit
Make default loop tiling options explicit from CLI options. We can also set default value for separate option which is declared implicitly.

Reviewed By: ayzhuang

Differential Revision: https://reviews.llvm.org/D127711
2022-06-15 11:28:21 +09:00
Craig Topper 5ae3f65cfa [RISCV] Replace uses of VLOpFrag in VLMax patterns with srcvalue.
These are on inner nodes and we're dropping the captured $vl anyway.
2022-06-14 19:19:35 -07:00
Joseph Huber d87ca519c9 [Libomptarget] Use binutils archive executable to address failing tests
Summary:
The static linking test ensures that we can statically link offloading
programs. To create the test we used `llvm-ar`. However, this may not
exist in the user's environment. This patch changes it to use the
binutils `ar` which should exist on every system running these tests
currently. In the future we should set up the dependencies properly.
2022-06-14 22:14:17 -04:00
Yaxun (Sam) Liu af9ee3357c [HIP] fix long double size
For amdgpu target long double type is the same as double type.
The width and align of long double type was incorrectly
overridden when copying aux target properties, which
caused assertion in codegen when emitting global
variables with long double type.

This patch fix that by saving and restoring width
and align of long double type.

Reviewed by: Artem Belevich

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

Fixes: SWDEV-335515
2022-06-14 21:57:56 -04:00
Zi Xuan Wu (Zeson) 587573b9f9 [CSKY] Fix the assert in eliminateFrameIndex when the offset is negative
After the frameindex is resolved, the offset can be negative. It would
be materialized as unsigned integer and can still calculated by add instruction.
2022-06-15 09:54:21 +08:00
Luo, Yuanke 54ec8e25fc [X86][AMX] Fix klockwork issue. 2022-06-15 09:26:59 +08:00
Phoebe Wang 6e02e27536 Reland "[X86][RFC] Enable `_Float16` type support on X86 following the psABI"
Disabled 2 mlir tests due to the runtime doesn't support `_Float16`, see
the issue here https://github.com/llvm/llvm-project/issues/55992
2022-06-15 09:15:31 +08:00
Haowei Wu 7fae15f925 Revert "[Driver] Improve linking options for target AVR"
This reverts commit 3b6e166999 which
causes Clang Driver test failures on Fuchsia builders.
2022-06-14 17:53:46 -07:00
LLVM GN Syncbot 1ca2730ca1 [gn build] Port 435897b41d 2022-06-15 00:32:13 +00:00
python3kgae 435897b41d [TableGen][DirectX] Add tableGen backend to generate DXIL operation for DirectX backend.
A new tableGen backend gen-dxil-enum is added to generate enum for DXIL operation and operation class.

A new file "DXILConstants.inc" will be generated when build DirectX target which include the enums.

More tableGen backends will be added to replace manually written table in DirectX backend.
The unused fields in dxil_inst will be used in future PR.

Reviewed By: bogner

Differential Revision: https://reviews.llvm.org/D125435
2022-06-14 17:31:58 -07:00
Lei Zhang b4dff404f3 [mlir][spirv] Fix math.ctlz for full zero bit cases
If the integer has all zero bits, GLSL FindUMsb would return -1.
So theoretically (31 - FindUMsb) should still give use the correct
result.  However, Adreno GPUshave issues with this:
https://buildkite.com/iree/iree-test-android/builds/6482#01815f05-3926-466f-822a-1e20299e5461
This looks like a driver bug. So handle the corner case explicity
to workaround it.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D127747
2022-06-14 19:39:27 -04:00
Philip Reames facb96584e [RISCV] Minor code/comment improvement in prepass of InsertVSETVLI [nfc] 2022-06-14 16:18:11 -07:00