Commit Graph

425060 Commits

Author SHA1 Message Date
Gabor Marton 88abc50398 [analyzer][solver] Handle UnarySymExpr in RangeConstraintSolver
Fixes https://github.com/llvm/llvm-project/issues/55241

Differential Revision: https://reviews.llvm.org/D125395
2022-05-26 14:09:46 +02:00
Gabor Marton b5b2aec1ff [analyzer] Add UnarySymExpr
This patch adds a new descendant to the SymExpr hierarchy. This way, now
we can assign constraints to symbolic unary expressions. Only the unary
minus and bitwise negation are handled.

Differential Revision: https://reviews.llvm.org/D125318
2022-05-26 14:00:27 +02:00
Gabor Marton ca3d962548 [analyzer] Return from reAssume if State is posteriorly overconstrained
Depends on D124758. That patch introduced serious regression in the run-time in
some special cases. This fixes that.

Differential Revision: https://reviews.llvm.org/D126406
2022-05-26 13:50:40 +02:00
Ivan Kosarev b0ccf38b01 [AMDGPU][GFX9] Support base+soffset+offset SMEM loads.
Resolves part of
https://github.com/llvm/llvm-project/issues/38652

Reviewed By: dp

Differential Revision: https://reviews.llvm.org/D125700
2022-05-26 12:42:33 +01:00
Aaron Ballman 85750de685 Use the canonical type when matching a generic selection association
This ensures that a deduced type like __auto_type matches the correct
association instead of matching all associations.

This addresses a regression from e4a42c5b64

Fixes #55702
2022-05-26 07:42:13 -04:00
Simon Pilgrim 7b617eef80 [DAG] Cleanup "and/or of cmp with single bit diff" fold to use ISD::matchBinaryPredicate
Prep work as I'm investigating some cases where TLI::convertSetCCLogicToBitwiseLogic should accept vectors.
2022-05-26 12:34:09 +01:00
Ivan Kosarev 8894c05b0d [FileCheck] GetCheckTypeAbbreviation() to handle the misspelled case.
Also fix directives not covered by D125604.
2022-05-26 12:20:15 +01:00
Chen Zheng d79275238f [MachineSink] replace MachineLoop with MachineCycle
reapply 62a9b36fcf and fix module build
failue:
1: remove MachineCycleInfoWrapperPass in MachinePassRegistry.def
   MachineCycleInfoWrapperPass is a anylysis pass, should not be there.
2: move the definition for MachineCycleInfoPrinterPass to cpp file.

Otherwise, there are module conflicit for MachineCycleInfoWrapperPass
in MachinePassRegistry.def and MachineCycleAnalysis.h after
62a9b36fcf.

MachineCycle can handle irreducible loop. Natural loop
analysis (MachineLoop) can not return correct loop depth if
the loop is irreducible loop. And MachineSink is sensitive
to the loop depth, see MachineSinking::isProfitableToSinkTo().

This patch tries to use MachineCycle so that we can handle
irreducible loop better.

Reviewed By: sameerds, MatzeB

Differential Revision: https://reviews.llvm.org/D123995
2022-05-26 06:45:23 -04:00
Ivan Kosarev ad1d60c3be [FileCheck] Catch missspelled directives.
Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D125604
2022-05-26 11:37:19 +01:00
Alex Zinenko 73c3dff1b3 [mlir] Use-after-free checker for the Transform dialect
The Transform dialect uses the side effect modeling mechanism to record the
effects of the transform ops on the mapping between Transform IR values and
Payload IR ops. Introduce a checker pass that warns if a Transform IR value is
used after it has been freed (consumed). This pass is mostly intended as a
debugging aid in addition to the verification/assertion mechanisms in the
transform interpreter. It reports all potential use-after-free situations.
The implementation makes a series of simplifying assumptions to be simple and
conservative. A more advanced implementation would rely on the data flow-like
analysis associated with a side-effect resource rather than a value, which is
currently not supported by the analysis infrastructure.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D126381
2022-05-26 12:28:41 +02:00
Simon Pilgrim b45e046858 [X86] Add non-uniform vector tests for 'one bit diff' comparison fold 2022-05-26 11:13:20 +01:00
Florian Hahn a9a012086a
[AArch64] Add additional tests for sinking free shuffles for FMAs. 2022-05-26 10:35:38 +01:00
David Spickett 38eb4fe74b [llvm][DWARF] Move test using X86 triple into X86 tests
Fixes failure seen when building without X86 backend:
https://lab.llvm.org/buildbot/#/builders/171/builds/15124
2022-05-26 09:27:23 +00:00
David Green 75631438e3 [AArch64] Costmodel tests for llvm.vscale intrinsics. NFC
These shows that the cost of a @llvm.vscale is indeed 1, not 10.
2022-05-26 10:16:21 +01:00
Fraser Cormack 2c9983f530 [RISCV][NFC] Add braces to 'else' to match braced 'if' 2022-05-26 10:00:33 +01:00
LLVM GN Syncbot 51f63589ae [gn build] Port 569d663020 2022-05-26 08:51:13 +00:00
Nikolas Klauser 569d663020 [libc++] Implement ranges::equal
Reviewed By: var-const, #libc

Spies: libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D123681
2022-05-26 10:46:54 +02:00
Florian Hahn f96aa493f0
[SimpleLoopUnswitch] Always skip trivial select and set condition.
When updating the branch instruction outside the loopduring non-trivial
 unswitching, always skip trivial selects and update the condition.

Otherwise we might create invalid IR, because the trivial select is
inside the loop, while the condition is outside the loop.

Fixes #55697.
2022-05-26 09:46:24 +01:00
Kito Cheng e45087fd53 [RISCV] Fix state persistence bugs (PR55548)
We didn't implement RISCVELFStreamer::reset and cause some very strange
section output for attribute section...just reference D15950 to see how
ARM implement that.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D125905
2022-05-26 16:09:00 +08:00
Florian Hahn 390c0ac28d
[LV] Fix indentation in tryToCreateWidenRecipe (NFC). 2022-05-26 08:53:34 +01:00
Jason Molenda 56ac85a20f Revert "Defer source path remap tilde expansion until source file use"
This reverts commit c274b6e583.

The x86_64 debian bot got a failure with this patch,
https://lab.llvm.org/buildbot#builders/68/builds/33078
where
SymbolFile/DWARF/x86/DW_TAG_variable-DW_AT_decl_file-DW_AT_abstract_origin-crosscu1.s
is crashing here -

 #2 0x0000000000425a9f SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f57160e9140 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14140)
 #4 0x00007f570d911e43 lldb_private::SourceManager::GetFile(lldb_private::FileSpec const&) crtstuff.c:0:0
 #5 0x00007f570d914270 lldb_private::SourceManager::DisplaySourceLinesWithLineNumbers(lldb_private::FileSpec const&, unsigned int, unsigned int, unsigned int, unsigned int, char const*, lldb_private::Stream*, lldb_private::SymbolContextList const*) crtstuff.c:0:0
 #6 0x00007f570da662c8 lldb_private::StackFrame::GetStatus(lldb_private::Stream&, bool, bool, bool, char const*) crtstuff.c:0:0

I don't get a failure here my mac, I'll review this method more
closely tomorrow.
2022-05-26 00:46:54 -07:00
Jason Molenda c274b6e583 Defer source path remap tilde expansion until source file use
When reading source path remappings out of a dSYM, lldb currently
does tilde expansion -- expanding the tilde-username and checking
that the destination pathname exists, for each dSYM with the path
remappings.  This cost happens during lldb's initial process launch
/ load, an especially perf-sensitive time.  Inside Apple, we have
dSYMs with source path remappings pointing to NFS directories where
these extra stats for every dSYM can be very expensive if the network
is slow.

This patch instead keeps the source path mapping in the original
tilde-username terms and does the tilde expansion when we need
to read a specific source file from one of the modules.  We'll
be stat'ing all of those inodes to load the source file anyway,
so the fact that we do the tilde expansion on every source file
we load, it doesn't cost us significantly.

Differential Revision: https://reviews.llvm.org/D126435
rdar://77091379
2022-05-26 00:30:12 -07:00
Jason Molenda 8ee35c5558 Update three tests to realpath paths that we compare to dyld paths
I get to my work directory through a symlink, so the pathnames the
tests get for their build artifacts etc are via that symlink.  There
are three tests which compare those symlink paths to a directory
received from dyld on macOS, which is the actual real pathname.

These tests have always failed for me on my dekstop but I finally
sat down to figure out why. Easy quick fix.
2022-05-26 00:21:44 -07:00
Fangrui Song 9ee15bba47 [MC] Lower case the first letter of EmitCOFF* EmitWin* EmitCV*. NFC 2022-05-26 00:14:08 -07:00
John Paul Adrian Glaubitz a1ec3c5a88 [scudo] Link against libatomic on all MIPS targets
Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D126418
2022-05-26 00:00:16 -07:00
Owen Anderson 1e91149844 Replace the custom linked list in LeaderTableEntry with TinyPtrVector.
The purpose of the custom linked list was to optimize for the case
of a single-element list. It turns out that TinyPtrVector handles
the same basic scenario even better, reducing the size of
LeaderTableEntry by 33%, and requiring only log2(N) allocations
as the size of the list grows. The only downside is that we have
to store the Value's and BasicBlock's in separate vectors, which
is slightly awkward in a few cases. Fortunately that ends up being
entirely encapsulated inside helper functions.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D125205
2022-05-25 23:52:44 -07:00
Serguei Katkov c2eccc67ce [GuardWidening] Remove nuw/nsw flags for hoisted instructions
When we hoist instructions over guard we must clear flags due to these flags
might be implied using this guard, so they make sense only after the guard.

As an example of the bug due to current behavior.
L is known to be in range say [0, 100)
c1 = x u< L
guard (c1)
x1 = add x, 1
c2 = x1 u< L
guard(c2)

basing on guard(c1) we can say that x1 = add nuw nsw x, 1
after guard widening we get
c1 = x u< L
x1 = add nuw nsw x, 1
c2 = x1 u< L
c = and c1, c2
guard(c)

now, basing on fact that x + 1 < L and x >= 0 due to x + 1 is nuw
we can prove that x + 1 u< L implies that x u< L, so we can just remove c1
x1 = add nuw nsw x, 1
c2 = x1 u< L
guard(c2)

But that is not correct due to we will pass x == -1 value.

Reviewed By: mkazantsev
Subscribers: llvm-commits, nikic
Differential Revision: https://reviews.llvm.org/D126354
2022-05-26 13:20:55 +07:00
serge-sans-paille fb67d683db [iwyu] Handle regressions in libLLVM header include
Running iwyu-diff on LLVM codebase since 7030654296 detected a few
regressions, fixing them.

Differential Revision: https://reviews.llvm.org/D126417
2022-05-26 08:12:34 +02:00
Serguei Katkov 0a838ad517 [GuardWidening] Add test showing incorrect behavior with nuw/nsw flags
when we move instruction over the guard we must clear nuw/nsw flags
but we do not.
2022-05-26 12:54:42 +07:00
Serguei Katkov 6f3f8b669b [GuardWidening] Update test with update_test_checks.py 2022-05-26 12:17:16 +07:00
River Riddle b2cc40fd67 [mlir:Printer][NFC] Add utility methods for printing escaped/hex strings
This simplifies quite a few cases where we manually duplicate the
escaping logic.
2022-05-25 20:54:27 -07:00
River Riddle ebc77f012f [mlir:LSP] Link the test dialect into mlir-lsp-server
This allows for more easily interacting with lit files that utilize
the test dialect.
2022-05-25 20:54:27 -07:00
Matthias Springer 52698a33d0 [mlir][bufferization] Clean up imports and code comments
Differential Revision: https://reviews.llvm.org/D126427
2022-05-26 05:48:52 +02:00
Congzhe Cao 80ab16d0ed [NFC][LoopCacheAnalysis] Update test cases to make sure the outputs follow the right order
In this patch we change test cases from using "CHECK" to using
"CHECK-NEXT", which is to ensure the order of loops output by
loop cache analysis is correct. After D124725 we fixed the
non-deterministic output order hence we did not use "CHECK-DAG"
anymore, and now we should really use "CHECK-NEXT" to make sure
the loops in the output loop vector follow the right order.

Reviewed By: bmahjour, #loopoptwg

Differential Revision: https://reviews.llvm.org/D124984
2022-05-25 23:32:00 -04:00
Chenbing Zheng 1486a9c9fe [InstCombine] [NFC] refector foldXorOfICmps
Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D126268
2022-05-26 11:07:18 +08:00
Chenbing Zheng 41aab93afc [InstCombine] bitcast(logic(bitcast(X), bitcast(Y))) -> bitcast'(logic(bitcast'(X), Y))
This patch break foldBitCastBitwiseLogic limite the destination
must have an integer element type, and eliminate one bitcast by
doing the logic op in the type of the input that has an integer
element type.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D126184
2022-05-26 10:23:44 +08:00
jacquesguan b271488e8b [RISCV] Replace ISD::FP_EXTEND and ISD::FP_ROUND with RVV VL op.
This patch tries to solve the incoordination between the direct and intermediate  cast caused by D123975.
This patch replaces ISD::FP_EXTEND and ISD::FP_ROUND with RVV VL op in the lowering of FP scalable vector direct cast to unify with the intermediate cast.
And it also changes the FP widenning pattern with the VL op.

Differential Revision: https://reviews.llvm.org/D125364
2022-05-26 02:17:31 +00:00
Alan Zhao 65fd1e91b0 [llvm-ml] Add support for the .S extension
Even though MASM files typically have the .asm extension, there are some
use cases [0] where they have the .S extension. MSVC ml assembles such
files with no problems, so llvm-ml should as well.

Additionally, fix the implementation of the /Ta flag and add a test for
it.

[0]: https://crrev.com/c/3668287

Reviewed By: epastor

Differential Revision: https://reviews.llvm.org/D126425
2022-05-25 22:10:05 -04:00
Lian Wang 8aa6b05deb [LegalizeTypes][VP] Add widen and split support for VP_TRUNCATE
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D125950
2022-05-26 02:03:27 +00:00
Haocong.Lu 085acede57 [RISCV][NFC] Remove solved TODO for combining constant shifts
Reviewed By: benshi001, asb

Differential Revision: https://reviews.llvm.org/D126185
2022-05-26 09:55:19 +08:00
Peter Klausler ddd692e9d5 [flang] Allow forward reference to ENTRY from generic interface
The CreateEntry() function in name resolution needs to allow for the name
of an alternate entry point already having been declared in the outer scope
as the homonymous specific procedure of a generic interface; e.g.,

  interface foo
    module procedure foo
  end interface
  subroutine bar
    entry foo
  end subroutine

Differential Revision: https://reviews.llvm.org/D126436
2022-05-25 17:14:59 -07:00
V Donaldson 949c39efb1 [flang] Update intrinsic module source files
The f18 standard defines several intrinsic modules containing definitions
and declarations for various constants, types, and procedures.  This PR adds
declarations for missing procedures in these modules.
2022-05-25 16:56:30 -07:00
bixia1 a14057d4bd [mlir][sparse] Add more complex operations.
Support complex operations sqrt, expm1, and tanh.

Add tests.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D126393
2022-05-25 16:38:09 -07:00
bixia1 338e76f8ee Lower complex.expm1 to standard dialect.
Add a test.

Reviewed By: pifon2a

Differential Revision: https://reviews.llvm.org/D126409
2022-05-25 16:11:28 -07:00
Jason Molenda bef4da4a6a Skip testing of watchpoint hit-count/ignore-count on multithreaded
Skip all watchpoint hit-count/ignore-count tests for multithreaded
API tests for now on arm64 Darwin.

On AArch64, insns that trigger a WP are rolled back and we are
notified.  lldb needs to disable the WP, insn step, re-enable it,
then report it to the user.  lldb only does this full step action
for the "selected thread", and so when a program stops with
multiple threads hitting a stop reason, some of them watchpoints,
any non-selected-thread will not be completed in this way.  But
all threads with the initial watchpoint exception will have their
hit-count/ignore-counts updated.  When we resume execution, the
other threads sitting at the instruction will again execute &
trigger the WP exceptoin again, repeating until we've gone through
all of the threads.

This bug is being tracked in llvm.org/pr49433 and inside apple
in rdar://93863107
2022-05-25 16:05:51 -07:00
Alan Zhao c8e7c0e5dc [NFC][llvm-ml] Rename rip-relative-addressing.asm to rip_relative_addressing.asm
All the other tests here use underscores, so we should rename this file
to be consistent.
2022-05-25 18:16:01 -04:00
Arthur Eubanks 3d546191ad [gn build] Fix D126415 to only set `llvm_have_mallinfo2 = true` on linux
Otherwise mac builds are broken, e.g. http://45.33.8.238/macm1/36056/step_4.txt

../../llvm/lib/Support/Unix/Process.inc:35:10: fatal error: 'malloc.h' file not found
 #include <malloc.h>
2022-05-25 14:48:56 -07:00
Peter Klausler 6b99dc29c6 [flang] Fix crash from a blank BIND(C,NAME="") on subprogram
A recent change fixed the processing of BIND(C,NAME=expr) character
expressions so that they are evaluated as constants in the scope of
the subprogram.  However, when the character name expression results
in an empty value after trimming, the compiler emits a warning message,
and this message is now causing a crash due to a lack of statement
context.  To fix, extend the deferred processing of the BIND(C,NAME="")
so that a basic statement context exists.

Differential Revision: https://reviews.llvm.org/D126416
2022-05-25 14:47:50 -07:00
Arthur Eubanks 534b19fbaa [gn build] Manually port bed9efed71 2022-05-25 14:36:42 -07:00
Alexey Bataev 3bf5c2c8ec [SLP]Do not try to generate ScatterVectorize if it will be scalarized.
SLP should build ScatterVectorize nodes only if they actually end up
with masked gather rather than with scalarization. In the second
scenario better to build a gather node.

Differential Revision: https://reviews.llvm.org/D126379
2022-05-25 14:25:07 -07:00