platform/upstream/llvm.git
2 years ago[ASan] Not linking asan_static library for DSO.
Kirill Stoimenov [Tue, 25 Jan 2022 21:33:55 +0000 (21:33 +0000)]
[ASan] Not linking asan_static library for DSO.

Without this change DSOs fail to link because of missing asan_report_(load|store)n functions.

Reviewed By: kda

Differential Revision: https://reviews.llvm.org/D118184

2 years agoReland "[AlwaysInliner] Enable call site inlining to make flatten attribute working...
Dávid Bolvanský [Tue, 25 Jan 2022 22:21:15 +0000 (23:21 +0100)]
Reland "[AlwaysInliner] Enable call site inlining to make flatten attribute working again (#53360)"

2 years ago[mlir] Fold tensor.reshape operations into tensor.from_elements.
Rob Suderman [Tue, 25 Jan 2022 23:54:49 +0000 (15:54 -0800)]
[mlir] Fold tensor.reshape operations into tensor.from_elements.

There is not much of a benefit to reshape a from element vs reloading it.
Updated to progagate shape manipulations into the output type of
tensor.from_elements.

Reviewed By: NatashaKnk

Differential Revision: https://reviews.llvm.org/D118201

2 years ago[clangd] Add designator inlay hints for initializer lists.
Sam McCall [Fri, 7 Jan 2022 03:15:07 +0000 (04:15 +0100)]
[clangd] Add designator inlay hints for initializer lists.

These make the init lists appear as if designated initialization was used.

Example:
  ExpectedHint{"param: ", "arg"}
becomes
  ExpectedHint{.Label="param: ", .RangeName="arg"}

Differential Revision: https://reviews.llvm.org/D116786

2 years ago[IRSim][IROutliner] Allowing Intrinsic Calls to be Used in Similarity Matching and...
Andrew Litteken [Thu, 23 Dec 2021 00:07:43 +0000 (18:07 -0600)]
[IRSim][IROutliner] Allowing Intrinsic Calls to be Used in Similarity Matching and Outlined Regions

Due to some complications with lifetime, and assume-like intrinsics, intrinsics were not included as outlinable instructions. This patch opens up most intrinsics, excluding lifetime and assume-like intrinsics, to be outlined. For similarity, it is required that the intrinsic IDs, and the intrinsics names match exactly, as well as the function type. This puts intrinsics in a different class than normal call instructions (https://reviews.llvm.org/D109448), where the name will no longer have to match.

This also adds an additional command line flag debug option to disable outlining intrinsics.

Reviewers: paquette, jroelofs

Differential Revision: https://reviews.llvm.org/D109450

2 years ago[NFC] DeclCXX: Fix -Wreorder-ctor
Jordan Rupprecht [Tue, 25 Jan 2022 22:27:25 +0000 (14:27 -0800)]
[NFC] DeclCXX: Fix -Wreorder-ctor

From 8ba9c794feb30cd969b9776c39873def10c51bff

2 years agoAdd support for sycl_special_class attribute.
Zahira Ammarguellat [Tue, 23 Nov 2021 22:58:03 +0000 (14:58 -0800)]
Add support for sycl_special_class attribute.

Special classes such as accessor, sampler, and stream need additional
implementation when they are passed from host to device.

This patch is adding a new attribute “sycl_special_class” used to mark
SYCL classes/struct that need the additional compiler handling.

2 years agoRevert "[AlwaysInliner] Enable call site inlining to make flatten attribute working...
Dávid Bolvanský [Tue, 25 Jan 2022 22:13:46 +0000 (23:13 +0100)]
Revert "[AlwaysInliner] Enable call site inlining to make flatten attribute working again (#53360)"

This reverts commit ceec4383681c42bfd3d06a6913ce7554bea160b0. Clang tests fail.

2 years ago[AlwaysInliner] Enable call site inlining to make flatten attribute working again...
Dávid Bolvanský [Tue, 25 Jan 2022 21:47:16 +0000 (22:47 +0100)]
[AlwaysInliner] Enable call site inlining to make flatten attribute working again (#53360)

Problem: Migration to new PM broke flatten attribute.

This is one use case why LLVM should support inlining call-site with alwaysinline.  The flatten attribute is nowdays broken, so we should either land patch like this one or remove everything related to  flatten attribute from Clang.

Second use case is something like "per call site inlining intrinsics" to control inlining even more; mentioned in
https://lists.llvm.org/pipermail/cfe-dev/2018-September/059232.html

Fixes https://github.com/llvm/llvm-project/issues/53360

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D117965

2 years agoRevert accidentally pushed commit. It was not yet reviewed.
Adrian Prantl [Tue, 25 Jan 2022 21:53:14 +0000 (13:53 -0800)]
Revert accidentally pushed commit. It was not yet reviewed.

"Fix UB in DwarfExpression::emitLegacyZExt()"

This reverts commit e37de5d36e3190283916604342b029859129e2a4.

2 years agoAdd missing include diagnosed by the modules build.
Adrian Prantl [Tue, 25 Jan 2022 21:52:44 +0000 (13:52 -0800)]
Add missing include diagnosed by the modules build.

2 years agoFix UB in DwarfExpression::emitLegacyZExt()
Adrian Prantl [Tue, 25 Jan 2022 21:29:22 +0000 (13:29 -0800)]
Fix UB in DwarfExpression::emitLegacyZExt()

A shift-left > 63 triggers a UBSAN failure. This patch kicks the can
down the road (to the consumer) by emitting a more compact
representation of the shift computation in DWARF expressions.

Differential Revision: https://reviews.llvm.org/D118183

2 years agoRevert "[NFC] Use an llvm::DenseMap instead of std::map in CategorizedHelpPrinter...
Nico Weber [Tue, 25 Jan 2022 21:36:38 +0000 (16:36 -0500)]
Revert "[NFC] Use an llvm::DenseMap instead of std::map in CategorizedHelpPrinter::printOptions"

This reverts commit 6427f4c52c31cc36004b14825e6598cd4a43f385.
Breaks a bunch of tests, see e.g. http://45.33.8.238/linux/66340/step_7.txt
or https://lab.llvm.org/buildbot/#/builders/139/builds/16807

2 years agoRevert "Fix build issue in assert mode introduced by 6427f4c52c31cc36004"
Nico Weber [Tue, 25 Jan 2022 21:31:57 +0000 (16:31 -0500)]
Revert "Fix build issue in assert mode introduced by 6427f4c52c31cc36004"

This reverts commit d65a3b3265d058ce1f0ac82fa4d0826bf1b2bbaf.
Breaks build everywhere, see e.g. http://45.33.8.238/linux/66344/step_4.txt
or https://lab.llvm.org/buildbot/#/builders/139/builds/16811

2 years agoFix build issue in assert mode introduced by 6427f4c52c31cc36004
serge-sans-paille [Tue, 25 Jan 2022 21:25:57 +0000 (22:25 +0100)]
Fix build issue in assert mode introduced by 6427f4c52c31cc36004

After 6427f4c52c31cc36004, one should use SortedCategories to check category
validity.

2 years ago[IRSim][IROutliner] Adding support for recognizing and outlining indirect function...
Andrew Litteken [Sun, 2 Jan 2022 20:31:47 +0000 (14:31 -0600)]
[IRSim][IROutliner] Adding support for recognizing and outlining indirect function calls, and function calls with different names, but the same type

The outliner currently requires that function calls not be indirect calls, and have that the function name, and function type must match, as well as other attributes such as calling conventions. This patch treats called functions as values, and just another operand, and named function calls as constants. This allows functions to be treated like any other constant, or input and output into the outlined functions.

There are also debugging flags added to enforce the old behaviors where indirect calls not be allowed, and to enforce the old rule that function calls names must also match.

Reviewers: paquette, jroelofs

Differential Revision: https://reviews.llvm.org/D109448

2 years ago[test][DAGCombine] Add tests for cmp+add -> addcarry
Paweł Bylica [Sun, 23 Jan 2022 17:24:17 +0000 (18:24 +0100)]
[test][DAGCombine] Add tests for cmp+add -> addcarry

Tests for https://reviews.llvm.org/D118037.

2 years ago[InstrProf][Correlator] Do not compress names when reading debug info
Ellis Hoag [Tue, 25 Jan 2022 20:29:11 +0000 (12:29 -0800)]
[InstrProf][Correlator] Do not compress names when reading debug info

There is no need to compress the names string when correlating with
debug info since InstrProfReader will immediately uncompress it anyway.
This also removes the dependency on zlib in this case.

Reviewed By: kyulee

Differential Revision: https://reviews.llvm.org/D118176

2 years ago[NFC] Use an llvm::DenseMap instead of std::map in CategorizedHelpPrinter::printOptions
serge-sans-paille [Tue, 25 Jan 2022 20:48:51 +0000 (15:48 -0500)]
[NFC] Use an llvm::DenseMap instead of std::map in CategorizedHelpPrinter::printOptions

2 years agoRemove unused <algorithm> include
serge-sans-paille [Tue, 25 Jan 2022 09:32:33 +0000 (04:32 -0500)]
Remove unused <algorithm> include

2 years ago[docs] HowToCrossCompileLLVM.rst: prefer --target= over legacy -target
Fangrui Song [Tue, 25 Jan 2022 20:39:32 +0000 (12:39 -0800)]
[docs] HowToCrossCompileLLVM.rst: prefer --target= over legacy -target

2 years ago[libc++][NFC] Fix typo
Louis Dionne [Tue, 25 Jan 2022 20:26:32 +0000 (15:26 -0500)]
[libc++][NFC] Fix typo

2 years ago[NFC] Added test with select with unpredictable metadata; regenerate x86-cmov-convert...
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

2 years ago[libc] Make logf function correctly rounded for all rounding modes.
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

2 years ago[analyzer] Don't specify PLUGIN_TOOL for analyzer plugins
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

2 years ago[lldb] Fix ProcessKDPLog for the logging refactor
Pavel Labath [Tue, 25 Jan 2022 19:49:55 +0000 (20:49 +0100)]
[lldb] Fix ProcessKDPLog for the logging refactor

2 years ago[cmake] Some NFC changes in preparation for accomodating `Ninja Multi-Config`
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

2 years ago[mlir][Linalg] Add couple of convenience methods to `LinalgInterface`.
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

2 years ago[libTooling] Adds more support for constructing object access expressions.
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

2 years ago[mlir][Linalg] Fix incorrect fusion with reshape ops by linearization.
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

2 years ago[CUDA,NVPTX] Corrected fragment size for tf32 LD B matrix.
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

2 years ago[CMake] Set sanitizer test C++ library on Linux
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

2 years ago[IROutliner] Disallow outlining calls that return twice.
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

2 years ago[InstrProf][correlation] Read DWARFv5 `OP_addrx` location
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

2 years ago[libc++][nfc] Update formatting of some tests.
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.

2 years ago[compiler-rt][profile][AIX] pass extra link opts for test
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

2 years ago[Support] #include <new> for std::align_val_t
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.

2 years ago[mlir][Linalg] Disallow ops with index semantics in `PushExpandingReshape`.
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

2 years ago[libcxx][test] Use bool allocators for vector<bool>::get_allocator test
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.

2 years ago[ELF] Parallelize --compress-debug-sections=zlib
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

2 years agoCleanup header dependencies of llvm/Support/Compiler.h
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 (?)

2 years ago[libc++][doc] Update format implementation status.
Mark de Wever [Tue, 25 Jan 2022 18:23:48 +0000 (19:23 +0100)]
[libc++][doc] Update format implementation status.

2 years ago[Clang][RISCV] Guard vmulh, vsmul correctly
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

2 years ago[AArch64] Add extra vecreduce.add tests, including extending reductions. NFC
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.

2 years ago[clang-tidy] [bugprone-assert-side-effect] Ignore list for functions/methods
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

2 years ago[lldb] Only include mach headers on Darwin
Jonas Devlieghere [Tue, 25 Jan 2022 17:58:36 +0000 (09:58 -0800)]
[lldb] Only include mach headers on Darwin

2 years agoImprove relnotes for the DWARFv5 default change
David Blaikie [Tue, 25 Jan 2022 17:55:48 +0000 (09:55 -0800)]
Improve relnotes for the DWARFv5 default change

2 years ago[RISCV] Don't allow i64 vector div by constant to use mulh with Zve64x
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

2 years agoDisable Go binding test on AIX
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

2 years ago[lldb] Use new dyld SPIs to query the shared cache local symbols
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

2 years ago[IROutliner] Allowing Phi Nodes in exit blocks
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

2 years agoAdd assert on End iteration distance to Rewriter::getRewrittenText.
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

2 years ago[lld-macho] Move order file and call graph sorting into SectionPriorities
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.

2 years ago[lld-macho] Rename CallGraphSort.{h,cpp} to SectionPriorities
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.

2 years agoAdd missing include diagnosed by moduels build.
Adrian Prantl [Tue, 25 Jan 2022 17:08:13 +0000 (09:08 -0800)]
Add missing include diagnosed by moduels build.

2 years ago[libc][NFC] Workaround clang assertion in inline asm
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

2 years ago[clang][dataflow] Add a transfer function for InitListExpr
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

2 years agoFix running orc-rt tests with LLVM_BUILD_EXTERNAL_COMPILER_RT
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

2 years ago[X86] Regenerate avx-vbroadcast.ll
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

2 years ago[SanitizerCoverage] Avoid pointer element type access
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.

2 years agoAlways use df_iterator_default_set as default set type for [i]df_ext_iterator
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.

2 years ago[NFC] Refine header dependencies of llvm/ADT/Any.h
serge-sans-paille [Tue, 25 Jan 2022 14:52:15 +0000 (09:52 -0500)]
[NFC] Refine header dependencies of llvm/ADT/Any.h

2 years ago[libc] Implement log10f correctly rounded for all rounding modes.
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

2 years ago[PowerPC][AIX] Override markFunctionEnd()
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

2 years ago[X86][AVX] Add PR47194 shuffle test case
Simon Pilgrim [Tue, 25 Jan 2022 14:58:20 +0000 (14:58 +0000)]
[X86][AVX] Add PR47194 shuffle test case

2 years ago[clang-tidy] Change code of SignalHandlerCheck (NFC).
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

2 years ago[GVN] Add tests for loop load PRE through select.
Florian Hahn [Tue, 25 Jan 2022 14:49:17 +0000 (14:49 +0000)]
[GVN] Add tests for loop load PRE through select.

2 years ago[clang-tidy] Pop Files only if FileChangeReason is ExitFile
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.

2 years ago[SLC] Fix pointer diff type in sprintf() optimization
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.

2 years ago[mlir] Move duplicated BufferizableOpInterface::kBufferLayoutAttrName defs to a singl...
Benjamin Kramer [Tue, 25 Jan 2022 14:17:07 +0000 (15:17 +0100)]
[mlir] Move duplicated BufferizableOpInterface::kBufferLayoutAttrName defs to a single place

2 years ago[AMDGPU] Only match correct type for a16
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

2 years ago[MemProf] Avoid pointer element type access
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.

2 years ago[OpenMPIRBuilderTest] Avoid some pointer element type accesses (NFC)
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.

2 years agoAdd llvm-dwp to LLVM_TOOLCHAIN_TOOLS
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

2 years ago[AsmParserTest] Avoid pointer element type accesses (NFC)
Nikita Popov [Tue, 25 Jan 2022 13:31:51 +0000 (14:31 +0100)]
[AsmParserTest] Avoid pointer element type accesses (NFC)

Use isOpaqueOrPointeeTypeEquals() instead.

2 years ago[GlobalISel] Avoid pointer element type access during InlineAsm lowering
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.

2 years ago[NFC][clangd] cleaning up llvm-qualified-auto
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

2 years ago[mlir][linalg][bufferize] Support tensor.from_elements
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

2 years ago[mlir][linalg][bufferize] Support tensor.generate
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

2 years ago[Evaluator] Simplify handling of bitcasted calls
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.

2 years ago[Visualizers] Fix Optional visualizer.
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

2 years ago[mlir][linalg][bufferize] Fix build
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

2 years ago[lldb] Fix windows build for D117490
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.

2 years ago[lldb] Fix mac build for D117490
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.

2 years ago[X86] Add folded load tests to PR46809 tests
Simon Pilgrim [Tue, 25 Jan 2022 12:35:00 +0000 (12:35 +0000)]
[X86] Add folded load tests to PR46809 tests

2 years ago[AArch64] Add patterns for relaxed atomic ld/st into fp registers
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

2 years ago[SVE] Enable ISD::ABDS/U ISel for scalable vectors.
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

2 years ago[ObjCARCOpts] Use standard non-terminator unreachable pattern
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.

2 years ago[ObjCArcOpts] Regenerate test checks (NFC)
Nikita Popov [Tue, 25 Jan 2022 12:07:36 +0000 (13:07 +0100)]
[ObjCArcOpts] Regenerate test checks (NFC)

2 years ago[SCEV] Remove an unnecessary GEP type check
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.

2 years ago[DAG] visitMULHS/MULHU/AND - remove some redundant LHS constant checks
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

2 years ago[X86] combineVectorSignBitsTruncation - fix indentation. NFC.
Simon Pilgrim [Tue, 25 Jan 2022 11:41:15 +0000 (11:41 +0000)]
[X86] combineVectorSignBitsTruncation - fix indentation. NFC.

2 years ago[llvm-c] Deprecate LLVMBuildPtrDiff()
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.

2 years ago[IRBuilder] Require explicit element type in CreatePtrDiff()
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.

2 years ago[OpenCL] Make read_write images optional for -fdeclare-opencl-builtins
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

2 years ago[OpenMP] Simplify pointer comparison
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.

2 years ago[mlir][Bazel] Update BUILD.bazel file
Adrian Kuegel [Tue, 25 Jan 2022 11:33:42 +0000 (12:33 +0100)]
[mlir][Bazel] Update BUILD.bazel file

2 years ago[MLIR] [AsyncToLLVM] Use llvm.coro.align intrinsic
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

2 years ago[DAGCombine] Fold SRA of a load into a narrower sign-extending load
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

2 years ago[lldb/test] Use abspath when searching for lldb.exe
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.