Louis Dionne [Tue, 25 Jan 2022 20:26:32 +0000 (15:26 -0500)]
[libc++][NFC] Fix typo
Dávid Bolvanský [Tue, 25 Jan 2022 20:24:05 +0000 (21:24 +0100)]
[NFC] Added test with select with unpredictable metadata; regenerate x86-cmov-converter.ll
Tue Ly [Tue, 25 Jan 2022 14:54:01 +0000 (09:54 -0500)]
[libc] Make logf function correctly rounded for all rounding modes.
Make logf function correctly rounded for all rounding modes.
Reviewed By: sivachandra, zimmermann6, santoshn, jpl169
Differential Revision: https://reviews.llvm.org/D118149
Aleksandr Platonov [Tue, 25 Jan 2022 19:46:25 +0000 (22:46 +0300)]
[analyzer] Don't specify PLUGIN_TOOL for analyzer plugins
Analyzer plugins explicitly export clang_registerCheckers and clang_analyzerAPIVersionString symbols, so we don't need to specify a tool to link agains.
Also, without this patch MSVC build fails with cmake flags -DLLVM_ENABLE_PLUGINS=On -DCLANG_PLUGINS_SUPPORT=On -DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=On
```
[936/936] Linking CXX shared module bin\SampleAnalyzerPlugin.dll
FAILED: bin/SampleAnalyzerPlugin.dll
cmd.exe /C "cd . && "D:\Program Files\CMake\bin\cmake.exe" -E vs_link_dll --intdir=tools\clang\lib\Analysis\plugins\SampleAnalyzer\CMakeFiles\SampleAnalyzerPlugin.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\mt.exe --manifests -- C:\PROGRA~2\MICROS~4\2019\COMMUN~1\VC\Tools\MSVC\1428~1.299\bin\Hostx64\x64\link.exe /nologo tools\clang\lib\Analysis\plugins\SampleAnalyzer\CMakeFiles\SampleAnalyzerPlugin.dir\MainCallChecker.cpp.obj /out:bin\SampleAnalyzerPlugin.dll /implib:lib\SampleAnalyzerPlugin.lib /pdb:bin\SampleAnalyzerPlugin.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO /DEF:"D:/work/llvm-project-original/build-plugins/tools/clang/lib/Analysis/plugins/SampleAnalyzer/SampleAnalyzerPlugin.def" lib\clang.lib lib\clangAnalysis.lib lib\clangAST.lib lib\clangStaticAnalyzerCore.lib lib\clangStaticAnalyzerFrontend.lib lib\clangStaticAnalyzerCheckers.lib lib\clangStaticAnalyzerCore.lib lib\clangCrossTU.lib lib\clangIndex.lib lib\clangFormat.lib lib\clangToolingInclusions.lib lib\clangFrontend.lib lib\clangDriver.lib version.lib lib\clangParse.lib lib\clangSerialization.lib lib\clangSema.lib lib\clangAnalysis.lib lib\clangEdit.lib lib\LLVMOption.lib lib\clangToolingCore.lib lib\clangRewrite.lib lib\clangASTMatchers.lib lib\clangAST.lib lib\clangLex.lib lib\clangBasic.lib lib\LLVMFrontendOpenMP.lib lib\LLVMScalarOpts.lib lib\LLVMAggressiveInstCombine.lib lib\LLVMInstCombine.lib lib\LLVMTransformUtils.lib lib\LLVMAnalysis.lib lib\LLVMProfileData.lib lib\LLVMDebugInfoDWARF.lib lib\LLVMObject.lib lib\LLVMBitReader.lib lib\LLVMCore.lib lib\LLVMRemarks.lib lib\LLVMBitstreamReader.lib lib\LLVMMCParser.lib lib\LLVMMC.lib lib\LLVMDebugInfoCodeView.lib lib\LLVMTextAPI.lib lib\LLVMBinaryFormat.lib lib\LLVMSupport.lib psapi.lib shell32.lib ole32.lib uuid.lib advapi32.lib delayimp.lib -delayload:shell32.dll -delayload:ole32.dll lib\LLVMDemangle.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK: command "C:\PROGRA~2\MICROS~4\2019\COMMUN~1\VC\Tools\MSVC\1428~1.299\bin\Hostx64\x64\link.exe /nologo tools\clang\lib\Analysis\plugins\SampleAnalyzer\CMakeFiles\SampleAnalyzerPlugin.dir\MainCallChecker.cpp.obj /out:bin\SampleAnalyzerPlugin.dll /implib:lib\SampleAnalyzerPlugin.lib /pdb:bin\SampleAnalyzerPlugin.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO /DEF:D:/work/llvm-project-original/build-plugins/tools/clang/lib/Analysis/plugins/SampleAnalyzer/SampleAnalyzerPlugin.def lib\clang.lib lib\clangAnalysis.lib lib\clangAST.lib lib\clangStaticAnalyzerCore.lib lib\clangStaticAnalyzerFrontend.lib lib\clangStaticAnalyzerCheckers.lib lib\clangStaticAnalyzerCore.lib lib\clangCrossTU.lib lib\clangIndex.lib lib\clangFormat.lib lib\clangToolingInclusions.lib lib\clangFrontend.lib lib\clangDriver.lib version.lib lib\clangParse.lib lib\clangSerialization.lib lib\clangSema.lib lib\clangAnalysis.lib lib\clangEdit.lib lib\LLVMOption.lib lib\clangToolingCore.lib lib\clangRewrite.lib lib\clangASTMatchers.lib lib\clangAST.lib lib\clangLex.lib lib\clangBasic.lib lib\LLVMFrontendOpenMP.lib lib\LLVMScalarOpts.lib lib\LLVMAggressiveInstCombine.lib lib\LLVMInstCombine.lib lib\LLVMTransformUtils.lib lib\LLVMAnalysis.lib lib\LLVMProfileData.lib lib\LLVMDebugInfoDWARF.lib lib\LLVMObject.lib lib\LLVMBitReader.lib lib\LLVMCore.lib lib\LLVMRemarks.lib lib\LLVMBitstreamReader.lib lib\LLVMMCParser.lib lib\LLVMMC.lib lib\LLVMDebugInfoCodeView.lib lib\LLVMTextAPI.lib lib\LLVMBinaryFormat.lib lib\LLVMSupport.lib psapi.lib shell32.lib ole32.lib uuid.lib advapi32.lib delayimp.lib -delayload:shell32.dll -delayload:ole32.dll lib\LLVMDemangle.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:bin\SampleAnalyzerPlugin.dll.manifest" failed (exit code 1169) with the following output:
clangStaticAnalyzerCore.lib(BugReporter.cpp.obj) : error LNK2005: "public: __cdecl clang::ento::PathSensitiveBugReport::PathSensitiveBugReport(class clang::ento::BugType const &,class llvm::StringRef,class llvm::StringRef,class clang::ento::ExplodedNode const *,class clang::ento::PathDiagnosticLocation,class clang::Decl const *)" (??0PathSensitiveBugReport@ento@clang@@QEAA@AEBVBugType@12@VStringRef@llvm@@1PEBVExplodedNode@12@VPathDiagnosticLocation@12@PEBVDecl@2@@Z) already defined in clang.lib(clang.exe)
clangStaticAnalyzerCore.lib(BugReporter.cpp.obj) : error LNK2005: "private: virtual void __cdecl clang::ento::BugType::anchor(void)" (?anchor@BugType@ento@clang@@EEAAXXZ) already defined in clang.lib(clang.exe)
clangStaticAnalyzerCore.lib(SVals.cpp.obj) : error LNK2005: "public: class clang::FunctionDecl const * __cdecl clang::ento::SVal::getAsFunctionDecl(void)const " (?getAsFunctionDecl@SVal@ento@clang@@QEBAPEBVFunctionDecl@3@XZ) already defined in clang.lib(clang.exe)
clangStaticAnalyzerCore.lib(ProgramState.cpp.obj) : error LNK2005: "void __cdecl clang::ento::ProgramStateRelease(class clang::ento::ProgramState const *)" (?ProgramStateRelease@ento@clang@@YAXPEBVProgramState@12@@Z) already defined in clang.lib(clang.exe)
clangStaticAnalyzerCore.lib(ProgramState.cpp.obj) : error LNK2005: "void __cdecl clang::ento::ProgramStateRetain(class clang::ento::ProgramState const *)" (?ProgramStateRetain@ento@clang@@YAXPEBVProgramState@12@@Z) already defined in clang.lib(clang.exe)
clangStaticAnalyzerCore.lib(Environment.cpp.obj) : error LNK2005: "public: __cdecl clang::ento::EnvironmentEntry::EnvironmentEntry(class clang::Stmt const *,class clang::LocationContext const *)" (??0EnvironmentEntry@ento@clang@@QEAA@PEBVStmt@2@PEBVLocationContext@2@@Z) already defined in clang.lib(clang.exe)
clangStaticAnalyzerCore.lib(Environment.cpp.obj) : error LNK2005: "public: class clang::ento::SVal __cdecl clang::ento::Environment::getSVal(class clang::ento::EnvironmentEntry const &,class clang::ento::SValBuilder &)const " (?getSVal@Environment@ento@clang@@QEBA?AVSVal@23@AEBVEnvironmentEntry@23@AEAVSValBuilder@23@@Z) already defined in clang.lib(clang.exe)
clangStaticAnalyzerCore.lib(CheckerManager.cpp.obj) : error LNK2005: "public: void __cdecl clang::ento::CheckerManager::_registerForPreStmt(class clang::ento::CheckerFn<void __cdecl(class clang::Stmt const *,class clang::ento::CheckerContext &)>,bool (__cdecl*)(class clang::Stmt const *))" (?_registerForPreStmt@CheckerManager@ento@clang@@QEAAXV?$CheckerFn@$$A6AXPEBVStmt@clang@@AEAVCheckerContext@ento@2@@Z@23@P6A_NPEBVStmt@3@@Z@Z) already defined in clang.lib(clang.exe)
clangStaticAnalyzerCore.lib(CoreEngine.cpp.obj) : error LNK2005: "protected: class clang::ento::ExplodedNode * __cdecl clang::ento::NodeBuilder::generateNodeImpl(class clang::ProgramPoint const &,class llvm::IntrusiveRefCntPtr<class clang::ento::ProgramState const >,class clang::ento::ExplodedNode *,bool)" (?generateNodeImpl@NodeBuilder@ento@clang@@IEAAPEAVExplodedNode@23@AEBVProgramPoint@3@V?$IntrusiveRefCntPtr@$$CBVProgramState@ento@clang@@@llvm@@PEAV423@_N@Z) already defined in clang.lib(clang.exe)
LLVMSupport.lib(SmallVector.cpp.obj) : error LNK2005: "protected: void __cdecl llvm::SmallVectorBase<unsigned int>::grow_pod(void *,unsigned __int64,unsigned __int64)" (?grow_pod@?$SmallVectorBase@I@llvm@@IEAAXPEAX_K1@Z) already defined in clang.lib(clang.exe)
LLVMSupport.lib(FoldingSet.cpp.obj) : error LNK2005: "protected: __cdecl llvm::FoldingSetBase::~FoldingSetBase(void)" (??1FoldingSetBase@llvm@@IEAA@XZ) already defined in clang.lib(clang.exe)
clangAST.lib(ASTImporter.cpp.obj) : error LNK2005: "public: __cdecl clang::ASTImporter::ASTImporter(class clang::ASTContext &,class clang::FileManager &,class clang::ASTContext &,class clang::FileManager &,bool,class std::shared_ptr<class clang::ASTImporterSharedState>)" (??0ASTImporter@clang@@QEAA@AEAVASTContext@1@AEAVFileManager@1@01_NV?$shared_ptr@VASTImporterSharedState@clang@@@std@@@Z) already defined in clang.lib(clang.exe)
clangAST.lib(ASTImporter.cpp.obj) : error LNK2005: "public: class llvm::Expected<class clang::Decl *> __cdecl clang::ASTImporter::Import(class clang::Decl *)" (?Import@ASTImporter@clang@@QEAA?AV?$Expected@PEAVDecl@clang@@@llvm@@PEAVDecl@2@@Z) already defined in clang.lib(clang.exe)
clangAST.lib(ExternalASTSource.cpp.obj) : error LNK2005: "public: virtual __cdecl clang::ExternalASTSource::~ExternalASTSource(void)" (??1ExternalASTSource@clang@@UEAA@XZ) already defined in clang.lib(clang.exe)
clangAST.lib(ExternalASTSource.cpp.obj) : error LNK2005: "public: virtual void __cdecl clang::ExternalASTSource::CompleteRedeclChain(class clang::Decl const *)" (?CompleteRedeclChain@ExternalASTSource@clang@@UEAAXPEBVDecl@2@@Z) already defined in clang.lib(clang.exe)
clangAST.lib(ExternalASTSource.cpp.obj) : error LNK2005: "public: virtual void __cdecl clang::ExternalASTSource::CompleteType(class clang::ObjCInterfaceDecl *)" (?CompleteType@ExternalASTSource@clang@@UEAAXPEAVObjCInterfaceDecl@2@@Z) already defined in clang.lib(clang.exe)
...
```
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D116966
Pavel Labath [Tue, 25 Jan 2022 19:49:55 +0000 (20:49 +0100)]
[lldb] Fix ProcessKDPLog for the logging refactor
Argyrios Kyrtzidis [Tue, 25 Jan 2022 01:49:37 +0000 (17:49 -0800)]
[cmake] Some NFC changes in preparation for accomodating `Ninja Multi-Config`
* Use `MATCHES` so that `Ninja Multi-Config` generator also satisfies the Ninja check
* Pull out a couple of values into variables, inside `function(tablegen project ofn)`, NFC
Differential Revision: https://reviews.llvm.org/D118100
MaheshRavishankar [Tue, 25 Jan 2022 19:44:54 +0000 (11:44 -0800)]
[mlir][Linalg] Add couple of convenience methods to `LinalgInterface`.
Add methods to
- Get block argument that is tied with an opOperand
- Get the yield value that is tied with a output opOperand.
Differential Revision: https://reviews.llvm.org/D118085
Yitzhak Mandelbaum [Wed, 29 Dec 2021 15:46:43 +0000 (15:46 +0000)]
[libTooling] Adds more support for constructing object access expressions.
This patch adds a `buildAccess` function, which constructs a string with the
proper operator to use based on the expression's form and type. It also adds two
predicates related to smart pointers, which are needed by `buildAccess` but are
also of general value.
We deprecate `buildDot` and `buildArrow` in favor of the more general
`buildAccess`. These will be removed in a future patch.
Differential Revision: https://reviews.llvm.org/D116377
MaheshRavishankar [Tue, 25 Jan 2022 18:58:53 +0000 (10:58 -0800)]
[mlir][Linalg] Fix incorrect fusion with reshape ops by linearization.
Fusion of reshape ops by linearization incorrectly inverted the
indexing map before linearizing dimensions. This leads to incorrect
indexing maps used in the fused operation.
Differential Revision: https://reviews.llvm.org/D117908
JackAKirk [Mon, 24 Jan 2022 20:32:36 +0000 (12:32 -0800)]
[CUDA,NVPTX] Corrected fragment size for tf32 LD B matrix.
Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D118023
Petr Hosek [Tue, 25 Jan 2022 17:37:14 +0000 (09:37 -0800)]
[CMake] Set sanitizer test C++ library on Linux
We always want to use the in-tree libc++ for tests.
Differential Revision: https://reviews.llvm.org/D118161
Andrew Litteken [Wed, 22 Dec 2021 23:42:10 +0000 (17:42 -0600)]
[IROutliner] Disallow outlining calls that return twice.
Functions that return twice can cause the IR Outliner to miscompile the given program. These function rely on information about the stack to be the same, and this may not necessarily be the case if called from an outlined function. So, we simply call these instructions illegal for the outliner to remove.
Reviewers: paquette
Differential Revision: https://reviews.llvm.org/D110007
Ellis Hoag [Tue, 25 Jan 2022 04:08:35 +0000 (20:08 -0800)]
[InstrProf][correlation] Read DWARFv5 `OP_addrx` location
Correctly read `OP_addrx` type encodings for DWARFv5 locations.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D118098
Mark de Wever [Tue, 25 Jan 2022 18:59:24 +0000 (19:59 +0100)]
[libc++][nfc] Update formatting of some tests.
These tests were formatted with older clang-format settings, this
updates them to the current settings.
In order to implement P2216 a lot of changes to these tests are
required. This makes it easier to review those patches.
David Tenty [Tue, 25 Jan 2022 04:20:18 +0000 (23:20 -0500)]
[compiler-rt][profile][AIX] pass extra link opts for test
The AIX linker doesn't export any symbols by default, so an export list is usually used. Since clang doesn't have the tools to auto-generate an export list yet, just pass the linker an extra opt to tell it to export everything. This is generally not recommended for real shared libs, but is fine for the purpose of this test.
Differential Revision: https://reviews.llvm.org/D118101
Benjamin Kramer [Tue, 25 Jan 2022 18:36:52 +0000 (19:36 +0100)]
[Support] #include <new> for std::align_val_t
This is only used when aligned new is enabled.
MaheshRavishankar [Tue, 25 Jan 2022 18:36:34 +0000 (10:36 -0800)]
[mlir][Linalg] Disallow ops with index semantics in `PushExpandingReshape`.
This pattern is not written to handle operations with `linalg.index`
operations in its body, i.e. operations that have index semantics.
Differential Revision: https://reviews.llvm.org/D117856
Casey Carter [Sun, 2 Jan 2022 05:53:37 +0000 (21:53 -0800)]
[libcxx][test] Use bool allocators for vector<bool>::get_allocator test
... to be consistent with other `get_allocator` tests, and to avoid requiring `vector<T, allocator<U>>` to be valid.
Fangrui Song [Tue, 25 Jan 2022 18:29:04 +0000 (10:29 -0800)]
[ELF] Parallelize --compress-debug-sections=zlib
When linking a Debug build clang (265MiB SHF_ALLOC sections, 920MiB uncompressed
debug info), in a --threads=1 link "Compress debug sections" takes 2/3 time and
in a --threads=8 link "Compress debug sections" takes ~70% time.
This patch splits a section into 1MiB shards and calls zlib `deflake` parallelly.
DEFLATE blocks are a bit sequence. We need to ensure every shard starts
at a byte boundary for concatenation. We use Z_SYNC_FLUSH for all shards
but the last to flush the output to a byte boundary. (Z_FULL_FLUSH can
be used as well, but Z_FULL_FLUSH clears the hash table which just
wastes time.)
The last block requires the BFINAL flag. We call deflate with Z_FINISH
to set the flag as well as flush the output to a byte boundary. Under
the hood, all of Z_SYNC_FLUSH, Z_FULL_FLUSH, and Z_FINISH emit a
non-compressed block (called stored block in zlib). RFC1951 says "Any
bits of input up to the next byte boundary are ignored."
In a --threads=8 link, "Compress debug sections" is 5.7x as fast and the total
speed is 2.54x. Because the hash table for one shard is not shared with the next
shard, the output is slightly larger. Better compression ratio can be achieved
by preloading the window size from the previous shard as dictionary
(`deflateSetDictionary`), but that is overkill.
```
# 1MiB shards
% bloaty clang.new -- clang.old
FILE SIZE VM SIZE
-------------- --------------
+0.3% +129Ki [ = ] 0 .debug_str
+0.1% +105Ki [ = ] 0 .debug_info
+0.3% +101Ki [ = ] 0 .debug_line
+0.2% +2.66Ki [ = ] 0 .debug_abbrev
+0.0% +1.19Ki [ = ] 0 .debug_ranges
+0.1% +341Ki [ = ] 0 TOTAL
# 2MiB shards
% bloaty clang.new -- clang.old
FILE SIZE VM SIZE
-------------- --------------
+0.2% +74.2Ki [ = ] 0 .debug_line
+0.1% +72.3Ki [ = ] 0 .debug_str
+0.0% +69.9Ki [ = ] 0 .debug_info
+0.1% +976 [ = ] 0 .debug_abbrev
+0.0% +882 [ = ] 0 .debug_ranges
+0.0% +218Ki [ = ] 0 TOTAL
```
Bonus in not using zlib::compress
* we can compress a debug section larger than 4GiB
* peak memory usage is lower because for most shards the output size is less
than 50% input size (all less than 55% for a large binary I tested, but
decreasing the initial output size does not decrease memory usage)
Reviewed By: ikudrin
Differential Revision: https://reviews.llvm.org/D117853
serge-sans-paille [Tue, 25 Jan 2022 14:53:40 +0000 (09:53 -0500)]
Cleanup header dependencies of llvm/Support/Compiler.h
<new> and <cstdef> were introduced in
aa60b3fd875c3 but the dependency
is now dead.
As a consequence you may need to include <new> where you use it while it
was auto-included as an implicit dependency before.
The impact on the codebase is small, as <new> is a very small header
(<100 SLOC) but it gets included everywhere, so that somehow counts (?)
Mark de Wever [Tue, 25 Jan 2022 18:23:48 +0000 (19:23 +0100)]
[libc++][doc] Update format implementation status.
eopXD [Fri, 21 Jan 2022 19:29:10 +0000 (11:29 -0800)]
[Clang][RISCV] Guard vmulh, vsmul correctly
According to v-spec 1.0, `vmulh`, `vmulhu`, `vmulhsu` and `vsmul` are
NOT supported for EEW=64 in Zve64*.
This patch tries to guard it correctly.
Authored by: Craig Topper <craig.topper@sifive.com> @craig.topper
Co-Authored by: Eop Chen <eop.chen@sifive.com> @eopXD
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D117913
David Green [Tue, 25 Jan 2022 18:10:09 +0000 (18:10 +0000)]
[AArch64] Add extra vecreduce.add tests, including extending reductions. NFC
This is all the reductions from i8 -> i64 with either sign or zero
extensions.
Zinovy Nis [Sat, 15 Jan 2022 13:07:51 +0000 (16:07 +0300)]
[clang-tidy] [bugprone-assert-side-effect] Ignore list for functions/methods
A semicolon-separated list of the names of functions or methods to be considered as not having side-effects was added for bugprone-assert-side-effect. It can be used to exclude methods like iterator::begin/end from being considered as having side-effects.
Differential Revision: https://reviews.llvm.org/D116478
Jonas Devlieghere [Tue, 25 Jan 2022 17:58:36 +0000 (09:58 -0800)]
[lldb] Only include mach headers on Darwin
David Blaikie [Tue, 25 Jan 2022 17:55:48 +0000 (09:55 -0800)]
Improve relnotes for the DWARFv5 default change
eopXD [Sat, 22 Jan 2022 08:46:36 +0000 (00:46 -0800)]
[RISCV] Don't allow i64 vector div by constant to use mulh with Zve64x
EEW=64 of mulh and its vairants requires V extension.
Authored by: Craig Topper <craig.topper@sifive.com> @craig.topper
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D117947
Steven Wan [Tue, 25 Jan 2022 17:38:42 +0000 (12:38 -0500)]
Disable Go binding test on AIX
Disable the Go binding test on AIX because building the binding on AIX with Clang is currently unsupported.
Reviewed By: ZarkoCA
Differential Revision: https://reviews.llvm.org/D117505
Jonas Devlieghere [Thu, 18 Nov 2021 22:25:23 +0000 (14:25 -0800)]
[lldb] Use new dyld SPIs to query the shared cache local symbols
rdar://
85492172
Andrew Litteken [Wed, 22 Dec 2021 21:37:48 +0000 (15:37 -0600)]
[IROutliner] Allowing Phi Nodes in exit blocks
In addition to having multiple exit locations, there can be multiple blocks leading to the same exit location, which results in a potential phi node. If we find that multiple blocks within the region branch to the same block outside the region, resulting in a phi node, the code extractor pulls this phi node into the function and uses it as an output.
We make sure that this phi node is given an output slot, and that the two values are removed from the outputs if they are not used anywhere else outside of the region. Across the extracted regions, the phi nodes are combined into a single block for each potential output block, similar to the previous patch.
Reviewers: paquette
Differential Revision: https://reviews.llvm.org/D106995
Ashley Hedberg [Tue, 25 Jan 2022 15:42:49 +0000 (15:42 +0000)]
Add assert on End iteration distance to Rewriter::getRewrittenText.
I currently have code that is crashing in the second std::advance call,
and it was not straightforward to identify the problem, as the first line
of the stacktrace is in RopePieceBTreeIterator::operator++:
```
*** SIGILL; stack trace: ***
PC: clang/include/clang/Rewrite/Core/RewriteRope.h:119 clang::RopePieceBTreeIterator::operator++()
../include/c++/v1/__iterator/advance.h:35 std::__u::__advance<>()
../include/c++/v1/__iterator/advance.h:65 std::__u::advance<>()
clang/lib/Rewrite/Rewriter.cpp:228 clang::Rewriter::getRewrittenText()
clang/include/clang/Rewrite/Core/Rewriter.h:106 clang::Rewriter::getRewrittenText()
```
Adding an assertion produces a friendlier error message for the caller.
Reviewed By: gribozavr2
Differential Revision: https://reviews.llvm.org/D117579
Leonard Grey [Mon, 24 Jan 2022 22:27:56 +0000 (17:27 -0500)]
[lld-macho] Move order file and call graph sorting into SectionPriorities
See https://reviews.llvm.org/D117354 for context and discussion.
Leonard Grey [Mon, 24 Jan 2022 21:51:51 +0000 (16:51 -0500)]
[lld-macho] Rename CallGraphSort.{h,cpp} to SectionPriorities
This is in preparation for moving the code that parses and processes
order files into this file.
See https://reviews.llvm.org/D117354 for context and discussion.
Adrian Prantl [Tue, 25 Jan 2022 17:08:13 +0000 (09:08 -0800)]
Add missing include diagnosed by moduels build.
Alex Brachet [Tue, 25 Jan 2022 16:37:43 +0000 (16:37 +0000)]
[libc][NFC] Workaround clang assertion in inline asm
The clobber list "cc" is added to inline assembly to workaround a clang assertion that triggers when building with a clang built with assertions enabled. See bug [53391](https://github.com/llvm/llvm-project/issues/53391).
See https://godbolt.org/z/z3bc6a9PM showing functionally same output assembly.
Reviewed By: sivachandra, lntue
Differential Revision: https://reviews.llvm.org/D118099
Stanislav Gatev [Mon, 24 Jan 2022 16:17:22 +0000 (16:17 +0000)]
[clang][dataflow] Add a transfer function for InitListExpr
This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.
Reviewed-by: xazax.hun
Differential Revision: https://reviews.llvm.org/D118119
Ben Langmuir [Tue, 25 Jan 2022 00:05:49 +0000 (16:05 -0800)]
Fix running orc-rt tests with LLVM_BUILD_EXTERNAL_COMPILER_RT
Add missing dependency on llvm-jitlink when building compiler-rt with
LLVM_BUILD_EXTERNAL_COMPILER_RT. Previously we would
non-deterministically fail the tests due to the missing binary.
rdar://
87247681
Differential Revision: https://reviews.llvm.org/D118087
Simon Pilgrim [Tue, 25 Jan 2022 16:23:10 +0000 (16:23 +0000)]
[X86] Regenerate avx-vbroadcast.ll
Remove '' around mattr to stop update script crash and use X86 prefixes instead of X32
Nikita Popov [Tue, 25 Jan 2022 16:20:26 +0000 (17:20 +0100)]
[SanitizerCoverage] Avoid pointer element type access
Use the load/store type instead.
serge-sans-paille [Tue, 25 Jan 2022 14:53:09 +0000 (09:53 -0500)]
Always use df_iterator_default_set as default set type for [i]df_ext_iterator
This is consistent with other default values in this file.
serge-sans-paille [Tue, 25 Jan 2022 14:52:15 +0000 (09:52 -0500)]
[NFC] Refine header dependencies of llvm/ADT/Any.h
Tue Ly [Tue, 25 Jan 2022 02:35:25 +0000 (21:35 -0500)]
[libc] Implement log10f correctly rounded for all rounding modes.
Based on RLIBM implementation similar to logf and log2f. Most of the exceptional inputs are the exact powers of 10.
Reviewed By: sivachandra, zimmermann6, santoshn, jpl169
Differential Revision: https://reviews.llvm.org/D118093
Sean Fertile [Thu, 20 Jan 2022 18:30:42 +0000 (13:30 -0500)]
[PowerPC][AIX] Override markFunctionEnd()
During fast-isel calling 'markFunctionEnd' in the base class will call
tidyLandingPads. This can cause an issue where we have determined that
we need ehinfo and emitted a traceback table with the bits set to
indicate that we will be emitting the ehinfo, but the tidying deletes
all landing pads. In this case we end up emitting a reference to
__ehinfo.N symbol, but not emitting a definition to said symbol and the
resulting file fails to assemble.
Differential Revision: https://reviews.llvm.org/D117040
Simon Pilgrim [Tue, 25 Jan 2022 14:58:20 +0000 (14:58 +0000)]
[X86][AVX] Add PR47194 shuffle test case
Balázs Kéri [Tue, 25 Jan 2022 14:09:31 +0000 (15:09 +0100)]
[clang-tidy] Change code of SignalHandlerCheck (NFC).
Using clang::CallGraph to get the called functions.
This makes a better foundation to improve support for
C++ and print the call chain.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D118016
Florian Hahn [Tue, 25 Jan 2022 14:49:17 +0000 (14:49 +0000)]
[GVN] Add tests for loop load PRE through select.
Jim Lin [Tue, 25 Jan 2022 07:05:43 +0000 (15:05 +0800)]
[clang-tidy] Pop Files only if FileChangeReason is ExitFile
enum FileChangeReason has four possible type EnterFile, ExitFile,
SystemHeaderPragma and RenameFile,
It should pop the back element of Files only if FileChangeReason is ExitFile.
Nikita Popov [Tue, 25 Jan 2022 14:20:32 +0000 (15:20 +0100)]
[SLC] Fix pointer diff type in sprintf() optimization
We should always be calculating a byte-wise difference here.
Previously this calculated the pointer difference while taking
the pointer element type into account, which is incorrect.
Benjamin Kramer [Tue, 25 Jan 2022 14:17:07 +0000 (15:17 +0100)]
[mlir] Move duplicated BufferizableOpInterface::kBufferLayoutAttrName defs to a single place
Sebastian Neubauer [Mon, 24 Jan 2022 17:46:33 +0000 (18:46 +0100)]
[AMDGPU] Only match correct type for a16
Addresses are floats when a sampler is present and unsigned integers
when no sampler is present.
Therefore, only zext instructions, not sext instructions should match.
Also match integer constants that can be truncated.
Differential Revision: https://reviews.llvm.org/D118043
Nikita Popov [Tue, 25 Jan 2022 13:52:01 +0000 (14:52 +0100)]
[MemProf] Avoid pointer element type access
Determine the masked load/store access type from the value type
of the intrinsics, rather than the pointer element type. For
cleanliness, include the access type in InterestingMemoryAccess.
Nikita Popov [Tue, 25 Jan 2022 13:39:22 +0000 (14:39 +0100)]
[OpenMPIRBuilderTest] Avoid some pointer element type accesses (NFC)
Use isOpaqueOrPointeeTypeMatches() instead, where possible.
Hans Wennborg [Mon, 24 Jan 2022 14:25:17 +0000 (15:25 +0100)]
Add llvm-dwp to LLVM_TOOLCHAIN_TOOLS
since it qualifies as a toolchain tool rather than "internal llvm tool".
This will make it part of builds which set the
LLVM_INSTALL_TOOLCHAIN_ONLY cmake option, such as the Windows installer.
Differential revision: https://reviews.llvm.org/D118042
Nikita Popov [Tue, 25 Jan 2022 13:31:51 +0000 (14:31 +0100)]
[AsmParserTest] Avoid pointer element type accesses (NFC)
Use isOpaqueOrPointeeTypeEquals() instead.
Nikita Popov [Tue, 25 Jan 2022 13:25:48 +0000 (14:25 +0100)]
[GlobalISel] Avoid pointer element type access during InlineAsm lowering
Same change as has been made for the SDAG lowering.
Christian Kühnel [Mon, 13 Dec 2021 15:14:31 +0000 (15:14 +0000)]
[NFC][clangd] cleaning up llvm-qualified-auto
This is a cleanup of all llvm-qualified-auto findings.
This patch was created by automatically applying the fixes from
clang-tidy.
Differential Revision: https://reviews.llvm.org/D113898
Matthias Springer [Tue, 25 Jan 2022 13:05:35 +0000 (22:05 +0900)]
[mlir][linalg][bufferize] Support tensor.from_elements
This is mostly a copy of the existing tensor.from_elements bufferization. Once TensorInterfaceImpl.cpp is moved to the tensor dialect, the existing rewrite pattern can be deleted.
Differential Revision: https://reviews.llvm.org/D117775
Matthias Springer [Tue, 25 Jan 2022 13:05:10 +0000 (22:05 +0900)]
[mlir][linalg][bufferize] Support tensor.generate
This is mostly a copy of the existing tensor.generate bufferization. Once TensorInterfaceImpl.cpp is moved to the tensor dialect, the existing rewrite pattern can be deleted.
Differential Revision: https://reviews.llvm.org/D117770
Nikita Popov [Tue, 25 Jan 2022 13:18:05 +0000 (14:18 +0100)]
[Evaluator] Simplify handling of bitcasted calls
When fetching the function, strip casts. When casting the result,
use the call result type. Don't actually inspect the bitcast.
Marek Kurdej [Tue, 25 Jan 2022 13:12:30 +0000 (14:12 +0100)]
[Visualizers] Fix Optional visualizer.
As discussed in https://reviews.llvm.org/D118105#3268773, OptionalStorage has been changed in commit https://github.com/llvm/llvm-project/commit/
fb9730575086b3c2ba38a1aabf3106b01339888b, but the visualizer still tries to use old members.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D118117
Matthias Springer [Tue, 25 Jan 2022 12:50:02 +0000 (21:50 +0900)]
[mlir][linalg][bufferize] Fix build
This fixes a linker error related to ModuleBufferization.cpp.
Differential Revision: https://reviews.llvm.org/D118127
Pavel Labath [Tue, 25 Jan 2022 12:51:53 +0000 (13:51 +0100)]
[lldb] Fix windows build for D117490
I forgot to update ProcessWindowsLog to the new API.
Pavel Labath [Tue, 25 Jan 2022 12:41:09 +0000 (13:41 +0100)]
[lldb] Fix mac build for D117490
This is exactly that kind of a API misuse that the patch was meant to
detect.
Simon Pilgrim [Tue, 25 Jan 2022 12:35:00 +0000 (12:35 +0000)]
[X86] Add folded load tests to PR46809 tests
Danila Malyutin [Tue, 18 Jan 2022 17:17:22 +0000 (20:17 +0300)]
[AArch64] Add patterns for relaxed atomic ld/st into fp registers
Adds patterns to match integer loads/stores bitcasted to fp values
Fixes https://github.com/llvm/llvm-project/issues/52927
Differential Revision: https://reviews.llvm.org/D117573
Paul Walker [Fri, 10 Dec 2021 18:05:38 +0000 (18:05 +0000)]
[SVE] Enable ISD::ABDS/U ISel for scalable vectors.
NOTE: This patch also includes tests that highlight those cases
where the existing DAG combine doesn't yet work well for SVE.
Differential Revision: https://reviews.llvm.org/D117873
Nikita Popov [Tue, 25 Jan 2022 12:05:14 +0000 (13:05 +0100)]
[ObjCARCOpts] Use standard non-terminator unreachable pattern
This is what CreateNonTerminatorUnreachable() in InstCombine uses.
Specific choice here doesn't really matter, but we should pick
one that is pointer element type independent.
Nikita Popov [Tue, 25 Jan 2022 12:07:36 +0000 (13:07 +0100)]
[ObjCArcOpts] Regenerate test checks (NFC)
Nikita Popov [Tue, 25 Jan 2022 11:55:02 +0000 (12:55 +0100)]
[SCEV] Remove an unnecessary GEP type check
The code already checked that the addrec step size and type alloc
size are the same. The actual pointer element type is irrelevant
here.
Simon Pilgrim [Tue, 25 Jan 2022 11:54:11 +0000 (11:54 +0000)]
[DAG] visitMULHS/MULHU/AND - remove some redundant LHS constant checks
Now that we constant fold and canonicalize constants to the RHS, we don't need to check both LHS and RHS for specific constants
Simon Pilgrim [Tue, 25 Jan 2022 11:41:15 +0000 (11:41 +0000)]
[X86] combineVectorSignBitsTruncation - fix indentation. NFC.
Nikita Popov [Tue, 25 Jan 2022 11:47:50 +0000 (12:47 +0100)]
[llvm-c] Deprecate LLVMBuildPtrDiff()
In favor of LLVMBuildPtrDiff2(), which accepts an explicit element
type and is compatible with opaque pointers.
Nikita Popov [Tue, 25 Jan 2022 11:23:28 +0000 (12:23 +0100)]
[IRBuilder] Require explicit element type in CreatePtrDiff()
For opaque pointer compatibility, we cannot derive the element
type from the pointer type.
Sven van Haastregt [Tue, 25 Jan 2022 11:40:31 +0000 (11:40 +0000)]
[OpenCL] Make read_write images optional for -fdeclare-opencl-builtins
Ensure any use of a `read_write` image is guarded behind the
`__opencl_c_read_write_images` feature macro.
Differential Revision: https://reviews.llvm.org/D117899
Nikita Popov [Tue, 25 Jan 2022 11:36:04 +0000 (12:36 +0100)]
[OpenMP] Simplify pointer comparison
Rather than checking ptrdiff(a, b) != 0, directly check a != b.
Adrian Kuegel [Tue, 25 Jan 2022 11:33:42 +0000 (12:33 +0100)]
[mlir][Bazel] Update BUILD.bazel file
Chuanqi Xu [Tue, 25 Jan 2022 11:24:49 +0000 (19:24 +0800)]
[MLIR] [AsyncToLLVM] Use llvm.coro.align intrinsic
Use llvm.coro.align to align coroutine frame properly.
Reviewed By: bkramer
Differential Revision: https://reviews.llvm.org/D117978
Bjorn Pettersson [Tue, 11 Jan 2022 23:34:11 +0000 (00:34 +0100)]
[DAGCombine] Fold SRA of a load into a narrower sign-extending load
An sra is basically sign-extending a narrower value. Fold away the
shift by doing a sextload of a narrower value, when it is legal to
reduce the load width accordingly.
Differential Revision: https://reviews.llvm.org/D116930
Pavel Labath [Tue, 25 Jan 2022 11:10:28 +0000 (12:10 +0100)]
[lldb/test] Use abspath when searching for lldb.exe
realpath is too aggressive and does not produce the desired effect if
ones build folder is a symlink farm.
Pavel Labath [Mon, 17 Jan 2022 14:56:11 +0000 (15:56 +0100)]
[lldb] Make logging machinery type-safe
This patch makes use of c++ type checking and scoped enums to make
logging statements shorter and harder to misuse.
Defines like LIBLLDB_LOG_PROCESS are replaces with LLDBLog::Process.
Because it now carries type information we do not need to worry about
matching a specific enum value with the right getter function -- the
compiler will now do that for us.
The main entry point for the logging machinery becomes the GetLog
(template) function, which will obtain the correct Log object based on
the enum type. It achieves this through another template function
(LogChannelFor<T>), which must be specialized for each type, and should
return the appropriate channel object.
This patch also removes the ability to log a message if multiple
categories are enabled simultaneously as it was unused and confusing.
This patch does not actually remove any of the existing interfaces. The
defines and log retrieval functions are left around as wrappers around
the new interfaces. They will be removed in follow-up patch.
Differential Revision: https://reviews.llvm.org/D117490
Fraser Cormack [Mon, 24 Jan 2022 11:43:20 +0000 (11:43 +0000)]
[SelectionDAG][VP] Add widening support for VP_MERGE
This patch adds widening support for ISD::VP_MERGE, which widens
identically to VP_SELECT and similarly to other select-like nodes.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D118030
Nikita Popov [Tue, 25 Jan 2022 11:04:06 +0000 (12:04 +0100)]
[clang] Remove some getPointerElementType() uses
Same cases where the call can be removed in a straightforward way.
Simon Tatham [Tue, 25 Jan 2022 10:37:19 +0000 (10:37 +0000)]
[AArch64] Exclude optional features from HasV8_0rOps.
The following SubtargetFeatures are removed from the definition of
HasV8_0rOps, on the grounds that they are optional in Armv8.4-A, and
therefore (by the definition of Armv8.0-R) also optional in v8.0-R:
* performance monitoring: FeaturePerfMon
* cryptography: FeatureSM4 and FeatureSHA3
* half-precision FP: FeatureFullFP16, FeatureFP16FML
* speculation control: FeatureSSBS, FeaturePredRes, FeatureSB,
FeatureSpecRestrict
This isn't the full set of features that are listed as optional in the
spec. FeatureCCIDX and FeatureTRACEV8_4 are also optional. But LLVM
includes those in HasV8_3aOps and HasV8_4aOps respectively (I think on
the grounds that the system registers they enable are useful to be
able to access after a runtime check), and so for consistency, I've
left those in HasV8_0rOps too.
After this commit, HasV8_0rOps is a strict subset of HasV8_4aOps (but
missing features that are not in Armv8.0-R at all).
The definition of Cortex-R82 is correspondingly updated to add most of
the features that I've removed from base Armv8.0-R (with the exception
of the cryptography ones), since that particular implementation of
v8.0-R does have them.
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D118045
Benjamin Kramer [Tue, 25 Jan 2022 10:46:02 +0000 (11:46 +0100)]
[bazel] Adjust dependencies after
a70aa7bb
These are all picked up transitively, but fail with
--features=layering_check, which enforces header dependencies.
Victor Perez [Tue, 25 Jan 2022 10:34:58 +0000 (10:34 +0000)]
[VP] Update CodeGen/RISCV/rvv/vpgather-sdnode.ll test
Fraser Cormack [Mon, 24 Jan 2022 11:53:29 +0000 (11:53 +0000)]
[SelectionDAG][VP] Add splitting support for VP_MERGE
This patch adds splitting support for ISD::VP_MERGE, which splits
identically to VP_SELECT and similarly to other select-like nodes.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D118032
Dávid Bolvanský [Tue, 25 Jan 2022 10:28:26 +0000 (11:28 +0100)]
Revert "[NFC] Added test with select with unpredictable metadata; regenerate x86-cmov-converter.ll"
This reverts commit
e2f8d28afba0a6545284ad3b54a4b7532c3253b6.
Dávid Bolvanský [Tue, 25 Jan 2022 10:11:14 +0000 (11:11 +0100)]
[NFC] Added test with select with unpredictable metadata; regenerate x86-cmov-converter.ll
Hsiangkai Wang [Fri, 21 Jan 2022 01:46:34 +0000 (01:46 +0000)]
[docs] There are more than three bit storage containers.
To avoid listing all the bit containers in the title and do not use the
specific number for the number of bit containers.
Differential Revision: https://reviews.llvm.org/D117849
Hsiangkai Wang [Fri, 21 Jan 2022 07:56:08 +0000 (07:56 +0000)]
[docs] Refine the description in Set-Like and Map-Like container options.
In "Other Set-Like Container Options":
* Drops the references to C++ TR1 and SGI and hash_set.
* Drops the worry about portability (this was a problem with hash_set, but
std::unordered_set has worked portably since LLVM started depending
on C++11).
It is similar in "Other Map-Like Container Options" section.
Differential Revision: https://reviews.llvm.org/D117858
Victor Perez [Tue, 25 Jan 2022 10:05:50 +0000 (10:05 +0000)]
[LegalizeTypes][VP] Add splitting support for vp.gather and vp.scatter
Split these nodes in a similar way as their masked versions.
Reviewed By: frasercrmck, craig.topper
Differential Revision: https://reviews.llvm.org/D117760
David Sherwood [Fri, 21 Jan 2022 09:56:49 +0000 (09:56 +0000)]
[NFC] Move useSVEForFixedLengthVectors into AArch64Subtarget.h
Given how small the function is and how often it gets used it
makes more sense to live in the header file.
Differential Revision: https://reviews.llvm.org/D117883
Nikita Popov [Tue, 25 Jan 2022 08:57:26 +0000 (09:57 +0100)]
[OpaquePtrs] Deprecate PointerType::getElementType()
This deprecates PointerType::getElementType() in favor of
Type::getPointerElementType(). The motivation is to make it more
apparent when code accesses the pointer element type, because
getElementType() may also also refer to at least
ArrayType::getElementType() and VectorType::getElementType().
Differential Revision: https://reviews.llvm.org/D117885
Nikita Popov [Tue, 25 Jan 2022 09:07:45 +0000 (10:07 +0100)]
[NFC] Remove more uses of PointerType::getElementType() (NFC)
Replace more uses which I missed in the first pass with
Type::getPointerElementType().
Nikita Popov [Fri, 21 Jan 2022 12:03:15 +0000 (13:03 +0100)]
[NFC] Remove uses of PointerType::getElementType()
Instead use either Type::getPointerElementType() or
Type::getNonOpaquePointerElementType().
This is part of D117885, in preparation for deprecating the API.
Chuanqi Xu [Tue, 25 Jan 2022 08:39:15 +0000 (16:39 +0800)]
[NFC] [C++20] [Modules] Update comments for handling friend
There is a comment contains a FIXME for the Module TS. And now the
Module TS is merged so we should update the comment. I've checked the
implementation.
Nikita Popov [Mon, 24 Jan 2022 13:29:05 +0000 (14:29 +0100)]
[Dwarf] Optimize getOrCreateSourceID() for repeated calls on same file (NFCI)
DwarfCompileUnit::getOrCreateSourceID() is often called many times
in sequence with the same DIFile. This is currently very expensive,
because it involves creating a string from directory and file name
and looking it up in a string map. This patch remembers the last
DIFile and its ID and directly returns that.
This gives a geomean -1.3% compile-time improvement on CTMark O0-g.
Differential Revision: https://reviews.llvm.org/D118041
Martin Storsjö [Fri, 21 Jan 2022 23:38:07 +0000 (01:38 +0200)]
[X86] [CodeView] Add codeview mappings for registers ST0-ST7
These can end up needed after https://reviews.llvm.org/D116821.
Suggested by Alexandre Ganea.
Differential Revision: https://reviews.llvm.org/D118072
Lorenzo Chelini [Tue, 25 Jan 2022 07:50:52 +0000 (08:50 +0100)]
[MLIR][Interfaces] Silence -Wparentheses warning (NFC)
warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
River Riddle [Tue, 25 Jan 2022 06:59:01 +0000 (22:59 -0800)]
[mlir] Remove unnecessary dependency on Tensor from MemRef