Commit Graph

376076 Commits

Author SHA1 Message Date
Kazu Hirata 530c5af6a4 [Transforms] Construct SmallVector with iterator ranges (NFC) 2021-01-02 09:24:17 -08:00
Kazu Hirata 171c5fd43e [llvm] Use llvm::erase_value and llvm::erase_if (NFC) 2021-01-02 09:24:15 -08:00
Kazu Hirata f7f42e64df [TableGen] Use llvm::append_range (NFC) 2021-01-02 09:24:13 -08:00
Florian Hahn c50f9b2351
[LV] Clean up trailing whitespace (NFC).
Clean up some stray whitespace that sneaked in recently.
2021-01-02 16:43:13 +00:00
Gil Rapaport d8af310063 [LV] Add missed optimization fold-tail test
The loop vectorizer avoids folding the tail for loop's whose trip-count is
known to SCEV to be divisible by VF. In this case the assumption providing this
information is not taken into account, so the tail is needlessly folded.
2021-01-02 14:00:15 +02:00
Roman Lebedev b9da488ad7
[SimplifyCFG] Don't actually take DomTreeUpdater unless we intend to maintain DomTree validity
This guards against unintentional mistakes
like the one i just fixed in previous commit.
2021-01-02 14:40:55 +03:00
Roman Lebedev f4ea21947d
[NFCI][CodeGen] DwarfEHPrepare: don't actually pass DTU into simplifyCFG by default
also, don't verify DomTree unless we intend to maintain it.
This is a very dumb think-o, i guess i was even warned about it
by subconsciousness in 4b80647367950ba3da6a08260487fd0dbc50a9c5's
commit message..

Fixes a compile-time regression reported by Martin Storsjö
in post-commit review of 2461cdb417.
2021-01-02 14:38:52 +03:00
Nico Weber b4c5e19da7 Temporarily disable to clang-tidy tests on Windows
They fail at least on my Win bot after switching it to Py3.
See PR48646 for details.
2021-01-01 23:19:48 -05:00
Nico Weber c8dedfe269 fix typos to cycle bots 2021-01-01 22:58:40 -05:00
Nico Weber 568824798f fix typo to cycle bots 2021-01-01 22:28:11 -05:00
Nico Weber fc3f53fcda [gn build] (manually) port 5e31e226b5: Use Py3 for the build
Made necessary by 20670ba440, the first Py3-only change.
2021-01-01 22:14:03 -05:00
Yang Fan 471dec3801
[CodeGen][NFC] Fix a build warning due to an extra semicolon 2021-01-02 10:42:58 +08:00
Chengji Yao 3bcca6b12d [MLIR] Fix affine_map compose with multi-symbols
Fix bug: https://bugs.llvm.org/show_bug.cgi?id=46845

Differential Revision: https://reviews.llvm.org/D93831
2021-01-02 06:57:16 +05:30
Hsiangkai Wang e4337159e3 [NFC][RISCV] Move vmsge{u}.vx processing to RISCVAsmParser.
We could expand vmsge{u}.vx pseudo instructions in RISCVAsmParser.
It is more appropriate to expand it before encoding.

Differential Revision: https://reviews.llvm.org/D93968
2021-01-02 08:42:53 +08:00
Fangrui Song 34489da81b [sanitizer] Enable mallopt and mallinfo interceptors on Android after D93848
Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D93970
2021-01-01 14:43:08 -08:00
Fangrui Song 20670ba440 [compiler-rt][test] Suppress stderr of ldd output 2021-01-01 14:09:13 -08:00
Roman Lebedev 4b80647367
[AMDGPU][SimplifyCFG] Teach AMDGPUUnifyDivergentExitNodes to preserve {,Post}DomTree
This is a (last big?) part of the patch series to make SimplifyCFG
preserve DomTree. Currently, it still does not actually preserve it,
even thought it is pretty much fully updated to preserve it.

Once the default is flipped, a valid DomTree must be passed into
simplifyCFG, which means that whatever pass calls simplifyCFG,
should also be smart about DomTree's.

As far as i can see from `check-llvm` with default flipped,
this is the last LLVM test batch (other than bugpoint tests)
that needed fixes to not break with default flipped.

The changes here are boringly identical to the ones i did
over 42+ times/commits recently already,
so while AMDGPU is outside of my normal ecosystem,
i'm going to go for post-commit review here,
like in all the other 42+ changes.

Note that while the pass is taught to preserve {,Post}DomTree,
it still doesn't do that by default, because simplifycfg
still doesn't do that by default, and flipping default
in this pass will implicitly flip the default for simplifycfg.
That will happen, but not right now.
2021-01-02 01:01:20 +03:00
Roman Lebedev b4429f3cdd
[SimplifyCFG] Teach removeUndefIntroducingPredecessor to preserve DomTree 2021-01-02 01:01:20 +03:00
Roman Lebedev 2461cdb417
[CodeGen][SimplifyCFG] Teach DwarfEHPrepare to preserve DomTree
Once the default for SimplifyCFG flips, we can no longer pass nullptr
instead of DomTree to SimplifyCFG, so we need to propagate it here.

We don't strictly need to actually preserve DomTree in DwarfEHPrepare,
but we might as well do it, since it's trivial.
2021-01-02 01:01:19 +03:00
Roman Lebedev b23b1bcc26
[NFC][CodeGen][Tests] Mark all tests that fail to preserve DomTree for SimplifyCFG as such
These tests start to fail when the SimplifyCFG's default regarding DomTree
updating is switched on, so mark them as needing changes.
2021-01-02 01:01:19 +03:00
Roman Lebedev e6b1a27fb9
[NFC][CodeGen] Split DwarfEHPrepare pass into an actual transform and an legacy-PM wrapper
This is consistent with the layout of other passes,
and simplifies further refinements regarding DomTree handling.

This is indended to be a NFC commit.
2021-01-02 01:01:19 +03:00
Roman Lebedev c38739ad8f
[NFC] clang-format the entire DwarfEHPrepare.cpp 2021-01-02 01:01:19 +03:00
Roman Lebedev 5fe0798dee
[Utils] LocalTest: fix SimplifyCFGWithNullAC test to work with `-simplifycfg-require-and-preserve-domtree=1` 2021-01-02 01:01:18 +03:00
Roman Lebedev db753269d9
[IR] PassManagerTest: Register DominatorTreeAnalysis before running SimplifyCFGPass
Otherwise these particular tests fail when SimplifyCFG requires DomTree
2021-01-02 01:01:18 +03:00
Roman Lebedev 657c1e09da
[SimplifyCFG] Teach eliminateDeadSwitchCases() to preserve DomTree, part 2 2021-01-02 01:01:18 +03:00
Roman Lebedev f1ce696056
[SimplifyCFG] Teach tryWidenCondBranchToCondBranch() to preserve DomTree 2021-01-02 01:01:17 +03:00
Roman Lebedev e08fea3b24
[SimplifyCFGPass] Ensure that DominatorTreeWrapperPass is init'd before SimplifyCFG
It's probably better than hoping that it will happen to be
already initialized.
2021-01-02 01:01:17 +03:00
Kazu Hirata 9a90c4ea8a [llvm] Use isa instead of dyn_cast (NFC) 2021-01-01 12:44:56 -08:00
Kazu Hirata bea8d021a3 [llvm] Use *Map::lookup (NFC) 2021-01-01 12:44:54 -08:00
Kazu Hirata f43daf1b62 [SSAUpdater] Remove unused code InstrIsPHI (NFC)
The last use of this function was removed on Jan 4, 2018 in commit
commit 90ecac01e9.
2021-01-01 12:44:52 -08:00
Fangrui Song ec9f2c3be0 test/OpenMP/parallel_codegen.cpp: Allow multiple result attributes
On many targets the matched line is `define dso_local i32 @main` while
on ppc64 it is `define dso_local signext i32 @main`.
2021-01-01 10:46:34 -08:00
Sanjay Patel c74e8539ff [Analysis] flatten enums for recurrence types
This is almost all mechanical search-and-replace and
no-functional-change-intended (NFC). Having a single
enum makes it easier to match/reason about the
reduction cases.

The goal is to remove `Opcode` from reduction matching
code in the vectorizers because that makes it harder to
adapt the code to handle intrinsics.

The code in RecurrenceDescriptor::AddReductionVar() is
the only place that required closer inspection. It uses
a RecurrenceDescriptor and a second InstDesc to sometimes
overwrite part of the struct. It seem like we should be
able to simplify that logic, but it's not clear exactly
which cmp+sel patterns that we are trying to handle/avoid.
2021-01-01 12:20:16 -05:00
Sanjay Patel c182a00095 [Analysis] fix typo in code comment; NFC 2021-01-01 12:20:16 -05:00
Alexey Bataev bf2a78fd4a [SLP]Add a test for correct use of the reordered loads, NFC. 2021-01-01 08:27:59 -08:00
Nikita Popov 26680269e0 [InstSimplify] Add tests for gep p, -p without inbounds (NFC)
This is additional test coverage for D93820.
2021-01-01 17:00:02 +01:00
Nikita Popov 14e540febc [LVI] Handle unions of conditions
LVI previously handled "if (L && R)" conditions, but not
"if (L || R)" conditions. The latter case can still produce
useful information if L and R both constrain the same variable.

This adds support for handling the "if (L || R)" case as well.
The only difference is that we take the union instead of the
intersection of the lattice values.
2021-01-01 16:46:21 +01:00
Nikita Popov 13b1c9abaf [CVP] Add tests for union of conditions (NFC)
We currently handle intersected conditions, but not unioned
conditions.
2021-01-01 16:46:21 +01:00
Paul C. Anagnostopoulos f4c39ccd22 [TableGen] Continue cleaning up .td files
This pass includes LLVM and MLIR files.

Differential Revision: https://reviews.llvm.org/D93864
2021-01-01 10:21:02 -05:00
Florian Hahn 068a23f05f
[LoopDistribute] Add tests with uncomputable BTCs. 2021-01-01 13:57:03 +00:00
Florian Hahn 890079ef18
[LoopLoadElim] Add tests with uncomputable BTCs. 2021-01-01 13:57:02 +00:00
Florian Hahn 4a17b9a39b
[LAA] Add tests with uncomputable BTCs. 2021-01-01 13:57:02 +00:00
Florian Hahn d9f306aa52
[LV] Fix crash when generating remarks with multi-exit loops.
If DoExtraAnalysis is true (e.g. because remarks are enabled), we
continue with the analysis rather than exiting. Update code to
conditionally check if the ExitBB has phis or not a single predecessor.
Otherwise a nullptr is dereferenced with DoExtraAnalysis.
2021-01-01 13:54:41 +00:00
Juneyoung Lee da1bd953fa Precommit a test for D92015 (NFC) 2021-01-01 22:35:57 +09:00
Yang Fan d5324c052b [clang-tidy][NFC] Fix a build warning due to an extra semicolon
Differential Revision: https://reviews.llvm.org/D93961
2021-01-01 16:00:20 +08:00
Yang Fan 89b0972aa2 [Sema] Fix deleted function problem in implicitly movable test
In implicitly movable test, a two-stage overload resolution is performed.
If the first overload resolution selects a deleted function, Clang directly
performs the second overload resolution, without checking whether the
deleted function matches the additional criteria.

This patch fixes the above problem.

Reviewed By: Quuxplusone

Differential Revision: https://reviews.llvm.org/D92936
2021-01-01 15:47:49 +08:00
Andrew Litteken 57a46914f5 [IRSim][IROutliner] Allowing call instructions to be outlined.
We add an extra check to make sure that we do not outline calls to
indirect functions, but outline whatever the IRSimilarityIdentifier
finds with respect to calls.

Tests:
Removing test/Transforms/IROutliner/illegal-calls.ll
Adding test/Transforms/IROutliner/outlining-calls.ll
Adding test/Transforms/IROutliner/illegal-indirect-calls.ll

Excluding DebugInfo this is the last patch for the initial
implementation of the IROutliner!

Reviewers: jroelofs, paquette

Differential Revision: https://reviews.llvm.org/D87314
2020-12-31 23:01:29 -06:00
Andrew Litteken 0d21e66014 [IRSim] Letting call instructions be legal for similarity identification.
Here we let non-intrinsic calls be considered legal and valid for
similarity only if the call is not indirect, and has a name.

For two calls to be considered similar, they must have the same name,
the same function types, and the same set of parameters, including tail
calls and calling conventions.

Tests are found in unittests/Analysis/IRSimilarityIdentifierTest.cpp.

Reviewers: jroelofs, paquette

Differential Revision: https://reviews.llvm.org/D87312
2020-12-31 20:52:45 -06:00
Roman Lebedev 831636b0e6
[SimplifyCFG] SUCCESS! Teach createUnreachableSwitchDefault() to preserve DomTree
This pretty much concludes patch series for updating SimplifyCFG
to preserve DomTree. All 318 dedicated `-simplifycfg` tests now pass
with `-simplifycfg-require-and-preserve-domtree=1`.

There are a few leftovers that apparently don't have good test coverage.
I do not yet know what gaps in test coverage will the wider-scale testing
reveal, but the default flip might be close.
2021-01-01 03:25:25 +03:00
Roman Lebedev e1440d43bc
[SimplifyCFG] Teach tryToSimplifyUncondBranchWithICmpInIt() to preserve DomTree 2021-01-01 03:25:25 +03:00
Roman Lebedev 8866583953
[SimplifyCFG] Teach FoldValueComparisonIntoPredecessors() to preserve DomTree, part 2 2021-01-01 03:25:24 +03:00