413918 Commits

Author SHA1 Message Date
River Riddle
330838eb90 [mlir] Fix GpuToLLVM conversion pass after ControlFlow operations were split from Standard 2022-02-06 15:10:03 -08:00
Stella Laurenzo
fe23a6fb75 [mlir] Fixup python bindings after splitting cf ops from std. 2022-02-06 14:51:17 -08:00
River Riddle
ace01605e0 [mlir] Split out a new ControlFlow dialect from Standard
This dialect is intended to model lower level/branch based control-flow constructs. The initial set
of operations are: AssertOp, BranchOp, CondBranchOp, SwitchOp; all split out from the current
standard dialect.

See https://discourse.llvm.org/t/standard-dialect-the-final-chapter/6061

Differential Revision: https://reviews.llvm.org/D118966
2022-02-06 14:51:16 -08:00
Eugene Zhulenev
edca177cbe [mlir] Add canonicalizer to remove redundant shape.cstr_broadcastable ops
Depends On D119025

Reviewed By: frgossen

Differential Revision: https://reviews.llvm.org/D119043
2022-02-06 14:46:42 -08:00
Congzhe Cao
1ef04326ec [LoopInterchange] Support loop interchange with floating point reductions
Enabled loop interchange support for floating point reductions
if it is allowed to reorder floating point operations.

Previously when we encouter a floating point PHI node in the
outer loop exit block, we bailed out since we could not detect
floating point reductions in the early days. Now we remove this
limiation since we are able to detect floating point reductions.

Reviewed By: #loopoptwg, Meinersbur

Differential Revision: https://reviews.llvm.org/D117450
2022-02-06 17:04:47 -05:00
Mehdi Amini
0d8850ae2c Remove dead forward declaration (NFC) 2022-02-06 19:48:46 +00:00
Simon Pilgrim
94453952fc [KnownBits] Add support for X*X self-multiplication (update)
Rename the SelfMultiply argument to make it clearer that the argument must not be undef

Differential Revision: https://reviews.llvm.org/D108992
2022-02-06 19:40:08 +00:00
Simon Pilgrim
b93287754b [InstCombine] Add mul(x,x) tests showing miscompile
As raised by @efriedma on D117995 - the source must not be undef to demand any bits in mul(x,x) other than bit[1]

https://alive2.llvm.org/ce/z/Cxkjen
2022-02-06 19:13:16 +00:00
Craig Topper
c35ccd2ac8 [DAGCombiner][RISCV] Allow rotates by non-constant to be matched for i32 on riscv64 with Zbb.
rv64izbb has a RORW/ROLW instructions that operate on the lower
32-bits of a 64-bit value and sign extend bit 31 of the result.

DAGCombiner won't match rotate idioms because the i32 type isn't Legal
on riscv64.

This patch teaches DAGCombiner to allow it if the type is going to
be promoted and the target has Custom type legalization for ISD::ROTL
or ISD::ROTR. I've restricted this to scalar types. It doesn't appear
any in tree targets other than riscv64 have custom type legalization
for rotates.

If this patch isn't acceptable, I guess I can match SRLW, SLLW, and OR
after type legalization, but I'd like to avoid that if possible.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D119062
2022-02-06 10:58:12 -08:00
Kazu Hirata
eb65f971f2 [llvm] Fix header guards (NFC)
Identified with llvm-header-guard.
2022-02-06 10:54:48 -08:00
Kazu Hirata
ee4b6cf538 [Breakpoint] Remove redundant member initialization (NFC)
Identified with readability-redundant-member-init.
2022-02-06 10:54:46 -08:00
Kazu Hirata
3a8c51480f [CodeGen] Use = default (NFC)
Identified with modernize-use-equals-default
2022-02-06 10:54:44 -08:00
Kazu Hirata
631b94cc22 [Driver] Remove redundant string initialization (NFC)
Identified with readability-redundant-string-init.
2022-02-06 10:54:42 -08:00
Jared Irwin
31626cc111 [lld-macho] Add -pagezero_size
Adds `-pagezero_size`. `-pagezero_size` commonly used for kernel development.
`-pagezero_size` changes the `__PAGEZERO` size, removing that segment if it is set to zero.

One of the four flags from {D118570}
Now with error messages and tests.

Differential Revision: https://reviews.llvm.org/D118724
2022-02-06 13:15:16 -05:00
Bjorn Pettersson
cecf11c315 [DAGCombiner] Fold SSHLSAT/USHLSAT to SHL when no saturation will occur
When the shift amount is known and a known sign bit analysis of
the shiftee indicates that no saturation will occur, then we can
replace SSHLSAT/USHLSAT by SHL.

Differential Revision: https://reviews.llvm.org/D118765
2022-02-06 18:59:06 +01:00
Bjorn Pettersson
0f68597605 Pre-commit test cases for DAG combine folds of SSHLSAT/USHLSAT -> SHL
It should be possible to replace SSHLSAT and USHLSAT with SHL when
it is known that no saturation will take place (e.g. by analysing
known sign bits in the first shift operand).

Differential Revision: https://reviews.llvm.org/D118764
2022-02-06 18:59:06 +01:00
Simon Pilgrim
1b27940a11 Revert rG7275de7fb2f087871611d037d1b529b226dd0521 "[AArch64] translateLocChar - silence dead code warning"
Seems to cause some buildbot misbehaviour (+ there's a dumb copy+paste typo in the commit message....)
2022-02-06 17:19:23 +00:00
Simon Pilgrim
1ab7d43bf9 [clang][CodeGen] Add _BitInt test coverage to builtins-elementwise-math.c
As suggested on D117898, we should be testing irregular _BitInt types with the __builtin_elementwise_* intrinsics
2022-02-06 17:17:28 +00:00
Simon Pilgrim
784c78f20f Fix Wdocumentation unknown parameter warning 2022-02-06 16:52:32 +00:00
Florian Hahn
541ca12dcd
[LV] Use VPReplicateRecipe::isUniform instead isUniformAfterVec (NFCI).
In scalarizeInstruction(), isUniformAfterVectorization is used to detect
cases where it is sufficient to always access the first lane. This
should map directly checking whether the operand is a uniform replicate
recipe.

Differential Revision: https://reviews.llvm.org/D116654
2022-02-06 16:37:20 +00:00
Simon Pilgrim
7275de7fb2 [AArch64] translateLocChar - silence dead code warning
Remove default case from switch and return None after the switch()
2022-02-06 16:32:16 +00:00
Simon Pilgrim
d3f966c6f0 [AArch64] LowerVectorSRA_SRL_SHL - silence dead code warning
Remove default case from switch and move llvm_unreachable to after the switch()
2022-02-06 16:29:38 +00:00
Simon Pilgrim
20e212197a [Support] Use llvm_unreachable instead of LLVM_BUILTIN_UNREACHABLE internal define 2022-02-06 16:26:00 +00:00
David Green
b7d3a2b62f [ARM] Mark i64 and f64 shuffles as Custom for MVE
This way they get lowered through the ARMISD::BUILD_VECTOR, which can
produce more efficient D register moves.

Also helps D115653 not get stuck in a loop.
2022-02-06 16:17:06 +00:00
David Green
3dff4f5cfb [ARM] Add extra vabd, vhadd and vmulh tests. NFC
This is some extra testing for vabd, vhadd and vmulh. Some of the tests
have also be reordered.
2022-02-06 14:12:28 +00:00
Simon Pilgrim
74b98ab1db [X86] Fold ZERO_EXTEND_VECTOR_INREG(BUILD_VECTOR(X,Y,?,?)) -> BUILD_VECTOR(X,0,Y,0)
Helps avoid some unnecessary shift by splat amount extensions before shuffle combining gets limited by with one use checks
2022-02-06 12:53:11 +00:00
Fangrui Song
bad1b7fbb0 [ELF] Fix crash when an input is incompatible with a lazy object file
The diagnostic is concise. It is ok because the case is rare.
2022-02-05 23:34:14 -08:00
Stella Laurenzo
b4626f22de [mlir] Do not use an empty source file when building aggregate libraries.
See discussion: https://discourse.llvm.org/t/check-mlir-times-examples-standalone-testing-time/6073/7

It turns out that it has been legal since CMake 3.11 to omit sources at library creation time if they are added later via target_sources, as is done here. This side-steps the issue of having a file that changes and invalidates the build of leaves.

Differential Revision: https://reviews.llvm.org/D119069
2022-02-05 23:06:28 -08:00
Rong Xu
52d981a4c1 [SampleFDO] Enable FSAFDO loading passes if --enable-fs-discriminator is enabled
FSAFDO profile loader is currently disabled even --enable-fs-discriminator is enabled.
They need to be turned on by options which makes it cumbersome for experiments.

This patch changes the FSAFDO profile loader enabled by default.  Since they are
guarded by EnableFSDiscriminator, they will only be turned on if
--enable-fs-discriminator is enabled. Note that --enable-fs-discriminator is
still disabled by default.

Differential Revision: https://reviews.llvm.org/D119033
2022-02-05 22:37:09 -08:00
Kazu Hirata
2d650ee03e [Transforms] Use default member initialization in SCEVFindUnsafe (NFC) 2022-02-05 21:39:27 -08:00
Kazu Hirata
cb13ebbf46 [Transforms] Use default member initialization in AAIsDeadCallSiteReturned (NFC) 2022-02-05 21:39:25 -08:00
Kazu Hirata
31d72f0e45 [Transforms] Use default member initialization in TruncInstCombine (NFC) 2022-02-05 21:39:23 -08:00
Kazu Hirata
9ed6800ef9 [Transforms] Use default member initialization in MaskOps (NFC) 2022-02-05 21:39:21 -08:00
Kazu Hirata
a867f32c5f [Transforms] Use default member initialization in EscapeEnumerator (NFC) 2022-02-05 21:39:19 -08:00
Kazu Hirata
bd5b279af0 [IR] Use default member initialization in PMDataManager (NFC) 2022-02-05 21:39:17 -08:00
Craig Topper
f3a725af43 [RISCV] Add signext test for llvm.abs.i32 for rv64 Zbb.
This shows that we don't preserve sign bits across the
abs expansion, but I think we could if we used negw+max.
2022-02-05 21:26:47 -08:00
Fangrui Song
5ad2aae244 [ELF] SharedFile::parse: move verdefIndex assignment outside of ctor. NFC
SharedSymbol::SharedSymbol initializes verdefIndex and Symbol::replace
copies verdefIndex.

By move verdefIndex assignment outside of ctor, Symbol::replace can be changed
to not copy verdefIndex. This can be used to decrease work for for
ObjKind/BitcodeKind.
2022-02-05 20:43:51 -08:00
Ruiling Song
0719c43735 AMDGPU: Don't clobber source register for V_SET_INACTIVE_*
The WWM register has unmodeled register liveness, For v_set_inactive_*,
clobberring source register is dangerous because it will overwrite the
inactive lanes. When the source vgpr is dead at v_set_inactive_lane,
the inactive lanes may be not really dead. This may make common
optimizations doing wrong.

For example in a simple if-then cfg in Machine IR:
bb.if:
  %src =

bb.then:
  %src1 = COPY %src
  %dst = V_SET_INACTIVE %src1(tied-def 0), %inactive

bb.end
  ... = PHI [0, %bb.then] [%src, %bb.if]

The register coalescer will think it is safe to optimize "%src1 = COPY %src"
in bb.then. And at the same time, there is no interference for the PHI in
bb.end. The source and destination values of the PHI will be assigned
the same register. The single PHI register will be overwritten by the
v_set_inactive, then we would get wrong value in bb.end.

With this change, we will copy the content of the source register before
setting inactive lanes after register allocation. Yes, this will sacrifice
the WWM code generation a little, but I don't have any better idea to do things
correctly.

Differential Revision: https://reviews.llvm.org/D117482
2022-02-06 12:38:26 +08:00
Ruiling Song
2f4d44bcd4 AMDGPU: add test to show wwm register overwrite issue
Pre-commit the test to make the diff easy to read later.

Differential Revision: https://reviews.llvm.org/D117527
2022-02-06 12:38:26 +08:00
Krystian Kuzniarek
6cd0015e78 [clang-format][docs] Fix incorrect 'clang-format 14' option markers
Introduced by 23a5090c6, some style option markers indicated 'clang-format 14',
though their respective options were available in earlier releases.

Note: Even though the value type of 'SpacesInAngles' option changed,
this option has been already present since version 3.4.

Differential Revision: https://reviews.llvm.org/D118991
2022-02-05 20:04:39 -08:00
Fangrui Song
977a1a523c [ELF] Symbol::replace: use the old nameData/nameSize. NFC
Currently `this->getName() == newSym.getName()`.
By keeping the old nameData/nameSize, newSym's nameData/nameSize will be
ignored. The call sites can avoid calling getName().

printTraceSymbol needs to take the symbol name since `other`'s name is empty.
2022-02-05 16:34:02 -08:00
Adrian Prantl
c5699c6eb7 fix module build failure 2022-02-05 16:30:39 -08:00
Adrian Prantl
511fa14ce3 fix module build failure 2022-02-05 16:30:38 -08:00
Adrian Prantl
607c589048 fix module build failure 2022-02-05 16:30:38 -08:00
Kazu Hirata
7ae64e598a [Support] Use default member initialization in ScopedPrinter (NFC) 2022-02-05 16:29:28 -08:00
Kazu Hirata
1569252774 [IR] Use default member initialization in GlobalObject (NFC) 2022-02-05 16:29:26 -08:00
Kazu Hirata
f072603685 [ADT] Use default member initialization in OptionalStorage (NFC) 2022-02-05 16:29:24 -08:00
Kazu Hirata
e24384b506 [Transforms] Use default member initialization in SimplifyIndvar (NFC) 2022-02-05 16:29:22 -08:00
Kazu Hirata
d0f52ff12a [ADT] Use default member initialization in DebugEpochBase (NFC) 2022-02-05 16:29:20 -08:00
Kazu Hirata
70fc36d8ed [MC] Use default member initialization in WasmCustomSection (NFC) 2022-02-05 16:29:19 -08:00