Commit Graph

412065 Commits

Author SHA1 Message Date
Nikita Popov 67346b43e0 [Attributor] Use MemoryLocation to get pointer operand and accessed type (NFCI)
This relies on existing APIs and avoids accessing the pointer
element type. The alternative would be to extend getPointerOperand()
to also return the accessed type, but I figured going through
MemoryLocation would be cleaner.

Differential Revision: https://reviews.llvm.org/D117868
2022-01-24 10:10:13 +01:00
Nikita Popov d29e319263 [OpaquePtrs] Add getNonOpaquePointerElementType() method (NFC)
This method is intended for use in places that cannot be reached
with opaque pointers, or part of deprecated methods. This makes
it easier to see that some uses of getPointerElementType() don't
need further action.

Differential Revision: https://reviews.llvm.org/D117870
2022-01-24 10:03:49 +01:00
Timm Bäder 3ad6de31c0 [clang][tests] Fix a c++/libc++ -stdlib value typo
"c++" is not usually a valid value for -stdlib.

Differential Revision: https://reviews.llvm.org/D117862
2022-01-24 09:59:20 +01:00
Timm Bäder ba845787b3 [clang][sema] Add missing diagnostic parameter
The test case otherwise fails an assertion in Diagnostic::getArgKind().

Differential Revision: https://reviews.llvm.org/D116595
2022-01-24 09:59:20 +01:00
Chenbing.Zheng 9aaa74aeef [RISCV] Add patterns of SET[U]LT_VI for STECC forms
This patch optmizes "li a0, 5
                     vmsgt[u].vx v10, v8, a0"
                 -> "vmsgt[u].vi v10, v8, 5"

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D118014
2022-01-24 08:50:49 +00:00
Marek Kurdej 81793bd276 [clang-format] Assert Line->First and State.NextToken->Previous. NFC.
Cf. scan-build reports:
* https://llvm.org/reports/scan-build/report-FormatToken.cpp-precomputeFormattingInfos-35-93e1e1.html#EndPath
* https://llvm.org/reports/scan-build/report-ContinuationIndenter.cpp-addTokenOnCurrentLine-15-dfdc6d.html#EndPath
2022-01-24 09:36:46 +01:00
Lorenzo Chelini d6f8f56da0 [MLIR][Presburger] Silence -Wdangling-else warning (NFC)
gcc suggests explicit braces to avoid ambiguous ‘else’.
2022-01-24 09:16:05 +01:00
Jim Lin f533011252 [Hexagon] Use llvm::Register instead of unsigned in HexagonConstExtenders.cpp. NFC.
Reviewed By: kparzysz

Differential Revision: https://reviews.llvm.org/D117851
2022-01-24 16:06:25 +08:00
Marek Kurdej 670a721de2 [clang-format] Assert Line->First. NFC.
Cf. scan-build reports:
* https://llvm.org/reports/scan-build/report-AffectedRangeManager.cpp-nonPPLineAffected-34-16c04b.html#EndPath
* https://llvm.org/reports/scan-build/report-SortJavaScriptImports.cpp-parseModuleReferences-34-96a7f8.html#EndPath
* https://llvm.org/reports/scan-build/report-TokenAnnotator.cpp-setCommentLineLevels-26-77bdba.html#EndPath
* https://llvm.org/reports/scan-build/report-AffectedRangeManager.cpp-nonPPLineAffected-31-714434.html#EndPath
* https://llvm.org/reports/scan-build/report-TokenAnnotator.cpp-setCommentLineLevels-16-bd39d0.html#EndPath
* https://llvm.org/reports/scan-build/report-UnwrappedLineFormatter.cpp-format-90-668b2d.html#EndPath
2022-01-24 08:54:55 +01:00
Nimish Mishra 3519dcfec2 Added OpenMP 5.0 specification based semantic checks for atomic update construct 2022-01-24 13:24:00 +05:30
Marek Kurdej ea2112ea15 [clang-format] Remove unused assignment. NFC.
Fixes scan-build reported warning: https://llvm.org/reports/scan-build/report-QualifierAlignmentFixer.cpp-analyzeRight-55-191910.html#EndPath.
2022-01-24 08:34:24 +01:00
Qiu Chaofan c5590396d0 [PowerPC] Emit warning for ieeelongdouble on older GNU toolchain
GCC 12 should have proper support for IEEE-754 compliant 128-bit
floating point in libstdc++. So warning is needed when linking against
older libstdc++ versions or LLVM libc++.

Glibc starts supporting float128 in both header and libraries since
2.32.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D112906
2022-01-24 15:23:28 +08:00
jacquesguan ba16e3c31f [RISCV] Decouple Zve* extensions and the V extension.
According to the spec, there are some difference between V and Zve64d. For example, the vmulh integer multiply variants that return the high word of the product (vmulh.vv, vmulh.vx, vmulhu.vv, vmulhu.vx, vmulhsu.vv, vmulhsu.vx) are not included for EEW=64 in Zve64*, but V extension does support these instructions. So we should decouple Zve* extensions and the V extension.

Differential Revision: https://reviews.llvm.org/D117854
2022-01-24 14:55:21 +08:00
Kazu Hirata bf039a8620 [Target] Use range-based for loops (NFC) 2022-01-23 22:53:15 -08:00
Wu Xinlong e29d8fb169 [RISCV] Initially support the K-extension instructions on the LLVM MC layer
This commit is currently implementing supports for scalar cryptography extension for LLVM according to version v1.0.0 of [K Ext specification](https://github.com/riscv/riscv-crypto/releases)(scala crypto has been ratified already). Currently, we are implementing the MC (Machine Code) layer of his extension and the majority of work is done under `llvm/lib/Target/RISCV` directory. There are also some test files in `llvm/test/MC/RISCV` directory.

Remove the subfeature of Zbk* which conflict with b extensions to reduce the size of the patch.
(Zbk* will be resubmit after this patch has been merged)

**Co-author:**@ksyx & @VincentWu & @lihongliang & @achieveartificialintelligence

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D98136
2022-01-24 14:45:35 +08:00
Julian Lettner 1f4a0531b3 [TSan] Mark test unsupported on Darwin 2022-01-23 22:01:48 -08:00
David Blaikie 8b280df504 Rough guess at fixing lldb tests to handle Clang defaulting to DWARFv5 2022-01-23 21:24:25 -08:00
Abinav Puthan Purayil 68b70d17d8 [GlobalISel] Fold or of shifts with constant amount to funnel shift.
This change folds (or (shl x, C0), (lshr y, C1)) to funnel shift iff C0
and C1 are constants where C0 + C1 is the bit-width of the shift
instructions.

Differential Revision: https://reviews.llvm.org/D116529
2022-01-24 10:43:32 +05:30
David Blaikie 90abe181da Add missing function implementation from DWARF default change
Fix for d3b26dea16
2022-01-23 21:10:16 -08:00
David Blaikie d3b26dea16 Clang: Change the default DWARF version to 5
(except on platforms that already opt in to specific versions - SCE,
Android, and Darwin using DWARFv4 explicitly, for instance)
2022-01-23 20:49:57 -08:00
Kazu Hirata b752eb887f [Analysis] Use default member initialization (NFC)
Identified with modernize-use-default-member-init.
2022-01-23 20:32:56 -08:00
Kazu Hirata f63a9cd99d [Vectorize] Remove unused variables (NFC) 2022-01-23 20:32:54 -08:00
Kazu Hirata 943aa1bfac Add modernize-use-default-member-init.UseAssignment to .clang-tidy 2022-01-23 20:32:52 -08:00
Chuanqi Xu b574048239 [NFC] [Coroutines] Rename tests in coro-align
This is required by ychen. See https://reviews.llvm.org/D117542
2022-01-24 11:04:13 +08:00
Jim Lin 3f24cdec25 [RISCV][NFC] Remove tailing whitespaces in RISCVInstrInfoVSDPatterns.td and RISCVInstrInfoVVLPatterns.td 2022-01-24 10:49:43 +08:00
Chuanqi Xu 3a3af2bbc9 [C++20] [Module] fix bug 47716 and implement [module.interface]/p6
This fixes bug 47716.

According to [module.interface]p2, it is meaningless to export an entity
which is not in namespace scope.
The reason why the compiler crashes is that the compiler missed
ExportDecl when the compiler traverse the subclass of DeclContext. So
here is the crash.

Also, the patch implements [module.interface]p6 in
Sema::CheckRedeclaration* functions.

Reviewed By: aaron.ballman, urnathan

Differential Revision: https://reviews.llvm.org/D112903
2022-01-24 10:25:25 +08:00
David Blaikie 2e58a18910 DebugInfo: Include template parameters for simplified template decls in type units
LLVM DebugInfo CodeGen synthesizes type declarations in type units when
referencing types that are not in type units. When those synthesized
types are templates and simplified template names (or mangled simplified
template names) are in use, the template arguments must be attached to
those declarations.

A deeper fix (with a CU or DICompositeType flag) that would also support
other uses of clang's -debug-forward-template-args (such as Sony's
platform) could/should be implemented to fix this more broadly.
2022-01-23 16:10:14 -08:00
Simon Pilgrim 7c77df1528 [X86] Add some basic tests for PR46809 2022-01-23 22:57:44 +00:00
David Blaikie ab4756338c DebugInfo: Don't put types in type units if they reference internal linkage types
Doing this causes a declaration of the internal linkage (anonymous
namespace) type to be emitted in the type unit, which would then be
ambiguous as to which internal linkage definition it refers to (since
the name is only valid internally).

It's possible these internal linkage types could be resolved relative to
the unit the TU is referred to from - but that doesn't seem ideal, and
there's no reason to put the type in a type unit since it can only be
defined in one CU anyway (since otherwise it'd be an ODR violation) & so
avoiding the type unit should be a smaller DWARF encoding anyway.

This also addresses an issue with Simplified Template Names where the
template parameter could not be rebuilt from the declaration emitted
into the TU (specifically for an enum non-type template parameter, where
looking up the enumerators is necessary to rebuild the full template
name)
2022-01-23 14:07:31 -08:00
Kazu Hirata 448d0dfab7 [Analysis] Remove a redundant const from a return type (NFC)
Identified with readability-const-return-type.
2022-01-23 14:00:03 -08:00
Kazu Hirata fa90fc6e05 [Sema] Fix a bugprone argument comment (NFC)
Identified with bugprone-argument-comment.
2022-01-23 14:00:01 -08:00
Kazu Hirata 47d7e922d8 [mlir] Ensure a newline at the end of a file (NFC) 2022-01-23 13:59:59 -08:00
Craig Topper 3575700b28 [RISCV] Add tests that do a bitreverse before or after a bswap. NFC
We don't optimize this as well as we could. Bitreverse is always
expanded to bswap and a shift/and/or sequence to swap bits within a
byte. The newly created bswap will either becomes a shift/and/or
sequence or rev8 instruction. We don't always realize the bswap is
redundant with another bswap before or after the bitreverse.

Found while thinking about the brev8 instruction from the
Cryptography extension. It's equivalent to bswap(bitreverse(x)) or
bitreverse(bswap(x)).
2022-01-23 13:44:31 -08:00
Craig Topper 88f33cff4b [RISCV] Add bitreverse tests to bswap-ctlz-cttz-ctpop.ll. Add Zbb command lines. NFC
Rename to include bitreverse. Add additional tests and Zbb command lines.

There's some overlapping tests with rv32zbb.ll and rv64zbb.ll. Maybe
I'll clean that up in a future patch.
2022-01-23 13:41:58 -08:00
Simon Pilgrim 4762c077e7 [X86] LowerFunnelShift - always lower vXi8 fshl by constant amounts as unpack(y,x) << zext(z)
This can always be lowered as PMULLW+PSRLWI+PACKUSWB
2022-01-23 21:35:05 +00:00
Kazu Hirata e59964b67e [clang] Remove unused forward declarations (NFC) 2022-01-23 13:28:06 -08:00
Kazu Hirata ee591a64a7 [clang] Forward-declare DynTypedNode (NFC)
This patch adds a forward declaraiton of DynTypedNode.

DumpAST.h is relying on the forward declaration of DynTypedNode in
ASTContext.h, which is undesirable.
2022-01-23 13:28:04 -08:00
Kazu Hirata ab1add6adc [clang] Move the definition of ASTDiff (NFC)
This patch moves the definition of ASTDiff later within the header
file.

Without this patch, the header depends on the forward decalrations of
SyntaxTree and ComparisonOptions from another header file, which is
not desirable.  Since SyntaxTree and ComparisonOptions are defined in
ASTDiff.h, we can move the definition of ASTDiff later and stop
relying on the forward declarations from another header file.
2022-01-23 13:28:02 -08:00
Simon Pilgrim 32dc14f876 [X86] LowerFunnelShift - use supportedVectorShiftWithBaseAmnt to check for supported scalar shifts
Allows us to reuse the ISD shift opcode instead of a mixture of ISD/X86ISD variants
2022-01-23 21:13:58 +00:00
Craig Topper 413684313d [RISCV] Adjust the header comment in RISCVInstrInfoZb.td to better integrate Zbk* extensions.
The Zbk* extensions have some overlap with Zb so have been placed in this file.

Reviewed By: VincentWu

Differential Revision: https://reviews.llvm.org/D117958
2022-01-23 11:42:52 -08:00
Groverkss ad36f37ce2 [MLIR][Presburger] Clean PresburgerSet identifier interface to match IntegerPolyhedron's interface
This patch changes names of identifiers and their corresponding getters in
PresburgerSet to match those of IntegerPolyhedron.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D117998
2022-01-24 01:09:07 +05:30
Kazu Hirata f8ddcb4131 [Object] Remove a redundant return statement (NFC)
Identified with readability-redundant-control-flow.
2022-01-23 11:07:16 -08:00
Kazu Hirata abb0ed4495 [Commands] Remove redundant member initialization (NFC)
Identified with readability-redundant-member-init.
2022-01-23 11:07:14 -08:00
Kazu Hirata 7a29b0b583 [llvm] Fix header guards (NFC)
Identified with llvm-header-guard.
2022-01-23 11:07:12 -08:00
Nuno Lopes 1a5dea9e2b [NewGVN][NFC] precommit tests for PR53277 2022-01-23 19:06:21 +00:00
Fangrui Song 8e382ae91b [Support] Simplify parallelForEach{,N}
* Merge parallel_for_each into parallelForEach (this removes 1 `Fn(...)` call)
* Change parallelForEach to use parallelForEachN
* Move parallelForEachN into Parallel.cpp

My x86-64 `lld` executable is 100KiB smaller.
No noticeable difference in performance.

Reviewed By: lattner

Differential Revision: https://reviews.llvm.org/D117510
2022-01-23 10:35:44 -08:00
Casey Carter 818cfb10c5 [libcxx][test] Make MSVC `<charconv>` test compile when testing MSVC
<meme>How many layers of irony are you on?</meme>

Differential Revision: https://reviews.llvm.org/D117967
2022-01-23 10:12:53 -08:00
Simon Pilgrim f69379d0a4 [InstCombine] Add test coverage for PR48683
D108992 added self-multiply handling to KnownBits::mul but we don't use it yet..
2022-01-23 18:03:17 +00:00
Craig Topper 0b79979180 [RISCV] Merge some rvv intrinsic test cases that only differ by XLen type.
Instead of having a test for i32 XLen and i64 XLen, use sed to
replace iXLen with i32/i64 before running llc.

This change covers all of the floating point tests.
2022-01-23 09:36:14 -08:00
Simon Pilgrim accc07e654 [DAG] Fold (X & Y) != 0 --> zextOrTrunc(X & Y) iff everything but LSB is known zero (PR51312)
Fixes parity codegen issue where we know all but the lowest bit is zero, we can replace the ICMPNE with 0 comparison with a ext/trunc

Differential Revision: https://reviews.llvm.org/D117983
2022-01-23 16:36:25 +00:00