Sam Powell [Thu, 18 Feb 2021 19:27:54 +0000 (11:27 -0800)]
[llvm][TextAPI] add equality operator for InterfaceFile
This patch adds functionality to compare for the equality between `InterfaceFile`s based on attributes specific to linking.
Reviewed By: cishida, steven_wu
Differential Revision: https://reviews.llvm.org/D96629
Wouter van Oortmerssen [Thu, 11 Feb 2021 01:34:05 +0000 (17:34 -0800)]
[WebAssembly] Fix assert in lookup of section symbols
Fixes assert in: https://bugs.llvm.org/show_bug.cgi?id=49036
getWasmSection creates sections if they don't exist, but doesn't add them to the Symbols table. This may cause problems in subsequent calls to getOrCreateSymbol which checks this table, the calls createSymbol assuming it doesn't exist, which then checks UsedNames and finds out it does exist, causing an assert on trying to rename a non-temp symbol.
I tried also fixing the somewhat unintuitive forced suffixing (adding `0`), but it turns out that WasmObjectWriter currently assumes these section symbols are unique, so that may have to be a separate fix: https://bugs.llvm.org/show_bug.cgi?id=49252
Also worth noting is that getWasmSection calling createSymbol may not be correct to start with, given that createSymbol seems to assume it is creating non-section symbols. But again, for a future fix.
Related: where some of this was introduced: https://github.com/llvm/llvm-project/commit/
8d396acac3bc21f688ac707bb42e4698dbdcab7e
Differential Revision: https://reviews.llvm.org/D96473
Craig Topper [Thu, 18 Feb 2021 19:24:04 +0000 (11:24 -0800)]
[RISCV] Add Zbb command lines to uadd/usub/sadd/ssub tests.
The expansions of the saturating intrinsics can make use of
the min(u)/max(u) instructions in Zbb.
Zequan Wu [Thu, 18 Feb 2021 02:16:40 +0000 (18:16 -0800)]
[Coverage] Emit gap region after conditions when macro is present.
Nico Weber [Thu, 18 Feb 2021 19:40:14 +0000 (14:40 -0500)]
[gn build] try to fix libxml2 include path on mac after
0ec448194e29
Jessica Clarke [Sat, 13 Feb 2021 16:26:08 +0000 (16:26 +0000)]
[RISCV] Use XLenRI alias for RegInfoByHwMode instances
This avoids tedious repetition and matches what we do for the
ValueTypeByHwMode uses.
Reviewed By: craig.topper, luismarques
Differential Revision: https://reviews.llvm.org/D96649
Pengxuan Zheng [Thu, 18 Feb 2021 19:32:35 +0000 (11:32 -0800)]
[AArch64] Adding Neon Polynomial vadd Intrinsics
This patch adds the following intrinsics:
vadd_p8
vadd_p16
vadd_p64
vaddq_p8
vaddq_p16
vaddq_p64
vaddq_p128
Reviewed By: t.p.northover, DavidSpickett
Differential Revision: https://reviews.llvm.org/D96825
Nico Weber [Thu, 18 Feb 2021 19:24:56 +0000 (14:24 -0500)]
fix comment typos to cycle bots
Guozhi Wei [Thu, 18 Feb 2021 19:05:29 +0000 (11:05 -0800)]
Pre-commit test case
Pre-commit test case for https://reviews.llvm.org/D95086, so that patch
can show the actual diff.
Ta-Wei Tu [Thu, 18 Feb 2021 18:50:21 +0000 (02:50 +0800)]
[NPM] Properly reset parent loop after loop passes
This fixes https://bugs.llvm.org/show_bug.cgi?id=49185
When `NDEBUG` is not set, `LPMUpdater` checks if the added loops have the same parent loop as the current one in `addSiblingLoops`.
If multiple loop passes are executed through `LoopPassManager`, `U.ParentL` will be the same across all passes.
However, the parent loop might change after running a loop pass, resulting in assertion failures in subsequent passes.
This patch resets `U.ParentL` after running individual loop passes in `LoopPassManager`.
Reviewed By: asbirlea, ychen
Differential Revision: https://reviews.llvm.org/D96727
Joerg Sonnenberger [Wed, 17 Feb 2021 21:13:01 +0000 (22:13 +0100)]
libcxx: use early returns
Differential Revision: https://reviews.llvm.org/D96955
Jonas Devlieghere [Thu, 18 Feb 2021 18:37:30 +0000 (10:37 -0800)]
[lldb] Remove unused code in ScriptInterpreterPython
Remove the unused code I noticed when working on
d6e80578fc5e and do
some other minor cleanups in the vicinity.
Jonas Paulsson [Fri, 12 Feb 2021 01:57:26 +0000 (02:57 +0100)]
[CFE, SystemZ] New target hook testFPKind() for checks of FP values.
The recent commit 00a6254 "Stop traping on sNaN in builtin_isnan" changed the
lowering in constrained FP mode of builtin_isnan from an FP comparison to
integer operations to avoid trapping.
SystemZ has a special instruction "Test Data Class" which is the preferred
way to do this check. This patch adds a new target hook "testFPKind()" that
lets SystemZ emit the s390_tdc intrinsic instead.
testFPKind() takes the BuiltinID as an argument and is expected to soon
handle more opcodes than just 'builtin_isnan'.
Review: Thomas Preud'homme, Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D96568
Sean Fertile [Thu, 18 Feb 2021 18:31:30 +0000 (13:31 -0500)]
[PowerPC][AIX] Add support for vector arg passing on the stack.
Enable passing more vector arguments then available vector
argument passing registers.
Differential Revision: https://reviews.llvm.org/D96415
Heejin Ahn [Thu, 18 Feb 2021 17:21:33 +0000 (09:21 -0800)]
[WebAssembly] Handle multiple EH_LABELs in EH pad
Usually `EH_LABEL`s are placed in
- Before an `invoke` (which becomes calls in the backend)
- After an `invoke`
- At the start of an EH pad
I don't know exactly why, but I noticed there are cases of multiple, not
a single, `EH_LABEL` instructions in the beginning of an EH pad. In that
case `global.set` instruction placed to restore `__stack_pointer` ended
up between two `EH_LABEL` instructions before `CATCH`. It should follow
after the `EH_LABEL`s and `CATCH`. This CL fixes that case.
Reviewed By: dschuff
Differential Revision: https://reviews.llvm.org/D96970
Jianzhou Zhao [Thu, 18 Feb 2021 08:14:13 +0000 (08:14 +0000)]
[dfsan] Refactor defining TLS variables
This is a part of https://reviews.llvm.org/D95835.
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D96941
Jianzhou Zhao [Thu, 18 Feb 2021 08:04:30 +0000 (08:04 +0000)]
[dfsan] Refactor runtime functions checking
This is a part of https://reviews.llvm.org/D95835.
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D96940
Jianzhou Zhao [Fri, 12 Feb 2021 00:29:58 +0000 (00:29 +0000)]
[dfsan] Add origin tls/move/read APIs
This is a part of https://reviews.llvm.org/D95835.
Added
1) TLS storage
2) a weak global used to set by instrumented code
3) move origins
These APIs are similar to MSan's APIs
https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/msan/msan_poisoning.cpp
We first improved MSan's by https://reviews.llvm.org/D94572 and https://reviews.llvm.org/D94552.
So the correctness has been verified by MSan.
After the DFSan instrument code is ready, we wil be adding more test
cases
4) read
To reduce origin tracking cost, some of the read APIs return only
the origin from the first taint data.
Note that we did not add origin set APIs here because they are related
to code instrumentation, will be added later with IR transformation
code.
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D96564
Pavel Labath [Thu, 18 Feb 2021 15:27:47 +0000 (16:27 +0100)]
[lldb] Un-XFAIL TestFormatters on windows
The test passes after D96779.
Akira Hatanaka [Thu, 18 Feb 2021 17:38:26 +0000 (09:38 -0800)]
[ObjC] Encode pointers to C++ classes as "^v" if the encoded string
would otherwise include template specialization types
This helps reduce the size of the encoded C++ type strings in the binary.
This is enabled by default only on Darwin, but can be enabled/disabled
via command line options.
rdar://
63288571
Differential Revision: https://reviews.llvm.org/D96816
Philip Reames [Thu, 18 Feb 2021 17:37:38 +0000 (09:37 -0800)]
Fix a buildbot warning triggered by 1dfb06d
Craig Topper [Thu, 18 Feb 2021 17:24:52 +0000 (09:24 -0800)]
[RISCV] Pre-commit test file changes from D96661. NFC
This includes i32 SHFLI tests for RV64 which we currently don't optimize.
And tests for associativity of OR.
Andrzej Warzynski [Thu, 18 Feb 2021 17:02:23 +0000 (17:02 +0000)]
[flang][driver] Add missing dependency (nfc)
These dependencies were introduced via the `ParseTreeDumper` API in:
* https://reviews.llvm.org/D96716
They manifested themselves in buildbot builders that set
`BUILD_SHARED_LIBS` to `On`.
Craig Topper [Thu, 18 Feb 2021 17:09:33 +0000 (09:09 -0800)]
[RISCV] Add support for fixed vector MULHU/MULHS.
This uses to division by constant optimization to use MULHU/MULHS.
Reviewed By: frasercrmck, arcbbb
Differential Revision: https://reviews.llvm.org/D96934
Philip Reames [Thu, 18 Feb 2021 17:08:56 +0000 (09:08 -0800)]
[verify-regalloc] Verify after allocation and before postOptimization
I've now hit several cases where a mistake in the regalloc main loop caused corrupt live intervals that didn't get caught until either the next verify or during post-optimization. The later case is rather confusing and tends to lead one down false trails, so let's catch corruption before that.
Joe Ellis [Thu, 18 Feb 2021 17:08:12 +0000 (17:08 +0000)]
[clang][SVE] Use __inline__ instead of inline in arm_sve.h
The inline keyword is not defined in the C89 standard, so source files
that include arm_sve.h will fail compilation if -std=c89 is specified.
For consistency with arm_neon.h, we should use __inline__ instead.
Reviewed By: paulwalker-arm
Differential Revision: https://reviews.llvm.org/D96852
Craig Topper [Thu, 18 Feb 2021 17:01:51 +0000 (09:01 -0800)]
[RISCV] Add support for fixed vector sign/zero extend from mask types.
Due to vXi64 on RV32, I've directly emitted this using _VL ISD
opcodes. If it wasn't for that we could just use fixed vector
BUILD_VECTOR and VSELECT and let those each be legalized.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D96910
Craig Topper [Thu, 18 Feb 2021 16:54:03 +0000 (08:54 -0800)]
[RISCV] Support isel of scalable vector bitcasts
These should be NOPs so we can just replace with the input. This
matches what SVE does with isel patterns for all permutations.
Custom isel saves us from having to list all permurations for
all LMULs.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D96921
Philip Reames [Thu, 18 Feb 2021 16:59:38 +0000 (08:59 -0800)]
[splitkit] Add a minor wrapper function for readability [NFC]
Nico Weber [Thu, 18 Feb 2021 16:58:48 +0000 (11:58 -0500)]
libcxx: fix a documentation typo
See `grep 'option.LIBCXX_INCLUDE_TESTS' libcxx/CMakeLists.txt`.
Nico Weber [Thu, 18 Feb 2021 16:57:38 +0000 (11:57 -0500)]
[gn build] fix mistake in
0ec448194e29
Konstantin Zhuravlyov [Thu, 18 Feb 2021 16:55:25 +0000 (11:55 -0500)]
AMDGPU: Fix checks in llvm.amdgcn.workitem.id.ll
Differential Revision: https://reviews.llvm.org/D96967
Bradley Smith [Mon, 8 Feb 2021 16:52:19 +0000 (16:52 +0000)]
[AArch64][SVE] Add patterns to generate FMLA/FMLS/FNMLA/FNMLS/FMAD
Adjust generateFMAsInMachineCombiner to return false if SVE is present
in order to combine fmul+fadd into fma. Also add new pseudo instructions
so as to select the most appropriate of FMLA/FMAD depending on register
allocation.
Depends on D96599
Differential Revision: https://reviews.llvm.org/D96424
Craig Topper [Thu, 18 Feb 2021 16:45:08 +0000 (08:45 -0800)]
[TableGen][SelectionDAG] Improve efficiency of encoding negative immediates for isel's CheckInteger opcode.
CheckInteger uses an int64_t encoded using a variable width encoding
that is optimized for encoding a number with a lot of leading zeros.
Negative numbers have no leading zeros so use the largest encoding
requiring 9 bytes.
I believe its most like we want to check for positive and negative
numbers near 0. -1 is quite common due to its use in the 'not'
idiom.
To optimize for this, we can borrow an idea from the bitcode format
and move the sign bit to bit 0 with the magnitude stored in the
upper bits. This will drastically increase the number of leading
zeros for small magnitudes. Then we can run this value through
VBR encoding.
This gives a small reduction in the table size on all in tree
targets except VE where size increased by about 300 bytes due
to intrinsic ids now requiring 3 bytes instead of 2. Since the
intrinsic enum space is shared by all targets this an unfortunate
consquence of where VE is currently located in the range.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D96317
Bradley Smith [Fri, 12 Feb 2021 12:51:10 +0000 (12:51 +0000)]
[AArch64] Allow folding FMUL/FADD into FMA for FP16 types
isFMAFasterThanFMulAndFAdd should return true for FP16 types when
HasFullFP16 is present, since we have the instructions to handle it for
both SVE and NEON. (SVE patterns and tests will follow).
Differential Revision: https://reviews.llvm.org/D96599
Philip Reames [Thu, 18 Feb 2021 16:50:00 +0000 (08:50 -0800)]
[regalloc] Add a couple of dump routines for ease of debugging [NFC]
Philip Reames [Thu, 18 Feb 2021 16:33:12 +0000 (08:33 -0800)]
[instcombine] Exploit UB implied by nofree attributes
This patch simply implements the documented UB of the current nofree attributes as specified. It doesn't try to be fancy about inference (yet), it just implements the cases already specified and inferred.
Note: When this lands, it may expose miscompiles. If so, please revert and provide a test case. It's likely the bug is in the existing inference code and without a relatively complete test case, it will be hard to debug.
Differential Revision: https://reviews.llvm.org/D96349
Jeroen Dobbelaere [Thu, 18 Feb 2021 16:29:46 +0000 (17:29 +0100)]
[clang] functions with the 'const' or 'pure' attribute must always return.
As described in
* https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-pure-function-attribute
* https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-const-function-attribute
An `__attribute__((pure))` function must always return, as well as an `__attribute__((const))` function.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D96960
lightmelodies [Thu, 18 Feb 2021 15:34:06 +0000 (16:34 +0100)]
[clangd] Populate detail field in document symbols
This commit fix https://github.com/clangd/clangd/issues/520 and https://github.com/clangd/clangd/issues/601.
{
F15544293}
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D96751
Nico Weber [Thu, 18 Feb 2021 14:30:47 +0000 (09:30 -0500)]
sysroot.py: add support for darwin
This is a tiny bit messy because compiler-rt needs different sysroots for
macOS, iOS, etc. We want sysroot.py to create something that is a hermetic
representation of all build deps, so it needs to create a directory that
contains all needed SDKs, and these subdirectories are then passed to
cmake which passes each of these _subdirectories_ as different -isysroot
flags while building the runtime libraries.
Differential Revision: https://reviews.llvm.org/D96958
Ties Stuij [Tue, 16 Feb 2021 13:56:15 +0000 (13:56 +0000)]
Pass the cmdline aapcs bitfield options to cc1
The following commits added commandline arguments to control following the Arm
Procedure Call Standard for certain volatile bitfield operations:
- https://reviews.llvm.org/D67399
- https://reviews.llvm.org/D72932
This commit fixes the oversight that these args weren't passed from the driver
to cc1 if appropriate.
Where *appropriate* means:
- `-faapcs-bitfield-width`: is the default, so won't be passed
- `-fno-aapcs-bitfield-width`: should be passed
- `-faapcs-bitfield-load`: should be passed
Differential Revision: https://reviews.llvm.org/D96784
Sanjay Patel [Thu, 18 Feb 2021 15:34:13 +0000 (10:34 -0500)]
[Verifier] add tests for vector reductions; NFC
Checking existing functionality before D96904.
Hsiangkai Wang [Thu, 18 Feb 2021 14:45:32 +0000 (22:45 +0800)]
[RISCV] Fix typo. Use ValueType instead of LLVMType.
Stephen Kelly [Thu, 4 Feb 2021 20:49:58 +0000 (20:49 +0000)]
[ASTMatchers] Fix hasParent while ignoring unwritten nodes
For example, before this patch we can use has() to get from a
cxxRewrittenBinaryOperator to its operand, but hasParent doesn't get
back to the cxxRewrittenBinaryOperator. This patch fixes that.
Differential Revision: https://reviews.llvm.org/D96113
Zbigniew Sarbinowski [Thu, 18 Feb 2021 14:49:46 +0000 (14:49 +0000)]
[SystemZ][ZOS] Guard using declaration for ::fchmodat
The use of fchmodat() is beeing guarded but its using declaration is not. Let's use the same guard in both places to avoid compiler errors on platforms where `fchmodat` does not exist.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D96303
David Green [Thu, 18 Feb 2021 14:59:02 +0000 (14:59 +0000)]
[ARM] Expand the range of allowed post-incs in load/store optimizer
Currently the load/store optimizer will only fold in increments of the
same size as the load/store. This patch expands that to any legal
immediate for the post-inc instruction.
Differential Revision: https://reviews.llvm.org/D95885
Pavel Labath [Mon, 15 Feb 2021 20:51:32 +0000 (21:51 +0100)]
[lldb] Fix shared library directory computation on windows
Our code for locating the shared library directory works via dladdr (or
the windows equivalent) to locate the path of an address known to reside
in liblldb. This works great for C++ programs, but there's a catch.
When (lib)lldb is used from python (like in our test suite), this dladdr
call will return a path to the _lldb.so (or such) file in the python
directory. To compensate for this, we have code which attempts to
resolve this symlink, to ensure we get the canonical location. However,
here's the second catch.
On windows, this file is not a symlink (but a copy), so this logic
fails. Since most of our other paths are derived from the liblldb
location, all of these paths will be wrong, when running the test suite.
One effect of this was the failure to find lldb-server in D96202.
To fix this issue, I add some windows-specific code to locate the
liblldb directory. Since it cannot rely on symlinks, it works by
manually walking the directory tree -- essentially doing the opposite of
what we do when computing the python directory.
To avoid python leaking back into the host code, I implement this with
the help of a callback which can be passed to HostInfo::Initialize in
order to assist with the directory location. The callback lives inside
the python plugin.
I also strenghten the existing path test to ensure the returned path is
the right one.
Differential Revision: https://reviews.llvm.org/D96779
Jay Foad [Thu, 18 Feb 2021 14:16:28 +0000 (14:16 +0000)]
[AMDGPU] Tidy up a FIXME fixed by D34973
Paul C. Anagnostopoulos [Thu, 18 Feb 2021 14:25:30 +0000 (09:25 -0500)]
Revert "[TableGen] Improve algorithms for processing template arguments"
This reverts commit
e589207d5aaee6cbf1d7c7de8867a17727d14aca.
Baptiste Saleil [Wed, 17 Feb 2021 23:02:30 +0000 (23:02 +0000)]
[PowerPC] Exploit the vinsw, vinsd, and vins[wd][lr]x instructions on P10
This patch generates the vinsw, vinsd, vinsblx, vinshlx, vinswlx, vinsdlx,
vinsbrx, vinshrx, vinswrx and vinsdrx instructions for vector insertion on P10.
Differential Revision: https://reviews.llvm.org/D94454
Hsiangkai Wang [Thu, 18 Feb 2021 06:52:19 +0000 (14:52 +0800)]
[RISCV] Fix bugs in pseudo instructions for masked segment load.
For masked segment load, the destination register should not overlap
with mask register. It could not be V0.
In the original implementation, there is no segment load/store register
class without V0. In this patch, I added these register classes and
modify `GetVRegNoV0` to get the correct one.
Differential Revision: https://reviews.llvm.org/D96937
Hsiangkai Wang [Thu, 18 Feb 2021 01:33:25 +0000 (09:33 +0800)]
[NFC][RISCV] Use concise way to describe load/store instructions.
Differential Revision: https://reviews.llvm.org/D96923
Paul C. Anagnostopoulos [Wed, 20 Jan 2021 18:14:43 +0000 (13:14 -0500)]
[TableGen] Improve algorithms for processing template arguments
Rework template argument checking so that all arguments are type-checked
and cast if necessary.
Add a test.
Differential Revision: https://reviews.llvm.org/D96416
Jonas Otto [Thu, 18 Feb 2021 14:12:48 +0000 (09:12 -0500)]
add -use-color option to clang-tidy-diff.py
Clang-tidy seems to output color only when printing directly to
terminal, but an option to force color-output has been added in
https://reviews.llvm.org/D7947
David Green [Thu, 18 Feb 2021 14:00:23 +0000 (14:00 +0000)]
[ARM] Ensure types provided to getIntrinsicCost are valid
It appears that pointer types were causing issues for the min/max cost
code in getIntrinsicInstrCost. This makes sure that when matching
icmp/select to a min/max, we only do that for normal int or float types.
Alexander Belyaev [Thu, 18 Feb 2021 08:41:40 +0000 (09:41 +0100)]
[mlir] Add `linalg.tiled_loop` op.
`subtensor_insert` was used instead of `linalg.subtensor_yield` to make this PR
smaller. Verification will be added in a follow-up PR.
Differential Revision: https://reviews.llvm.org/D96943
Stefan Pintilie [Thu, 18 Feb 2021 12:12:53 +0000 (12:12 +0000)]
[PowerPC] Add option for ROP Protection
Added -mrop-protection for Power PC to turn on codegen that provides some
protection from ROP attacks.
The option is off by default and can be turned on for Power 8, Power 9 and
Power 10.
This patch is for the option only. The feature will be implemented by a later
patch.
Reviewed By: amyk
Differential Revision: https://reviews.llvm.org/D96512
Kirill Bobyrev [Thu, 18 Feb 2021 12:06:01 +0000 (13:06 +0100)]
[clangd] Drop template argument lists from completions followed by <
Now, given `template <typename T> foo() {}` when user types `fo^<int>()` the
completion snippet will not contain `<int>()`.
Also, when the next token is opening parenthesis (`(`) and completion snippet
contains template argument list, it is still emitted.
This patch complements D81380.
Related issue: https://github.com/clangd/clangd/issues/387
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D89870
Alexander Belyaev [Thu, 18 Feb 2021 11:49:52 +0000 (12:49 +0100)]
Revert "[MLIR] Create memref dialect and move several dialect-specific ops from std."
This commit introduced a cyclic dependency:
Memref dialect depends on Standard because it used ConstantIndexOp.
Std depends on the MemRef dialect in its EDSC/Intrinsics.h
Working on a fix.
This reverts commit
8aa6c3765b924d86f623d452777eb76b83bf2787.
David Green [Thu, 18 Feb 2021 11:42:17 +0000 (11:42 +0000)]
[ARM] Add larger than legal ICmp costs
A v8i32 compare will produce a v8i1 predicate, but during codegen the
v8i32 will be split into two v4i32, potentially requiring two v4i1
predicates to be merged into a single v8i1. Because this merging of two
v4i1's into a v8i1 is very expensive, we need to make the cost of the
compare equally high.
This patch adds the cost of that to ARMTTIImpl::getCmpSelInstrCost.
Because we don't know whether the user of the predicate can be split,
and the cost model is mostly pre-instruction, we may be pessimistic but
that should only be for larger and legal types. This also adds min/max
detection to the costmodel where it can be detected, to keep those in
line with the cost of simple min/max instructions. Otherwise for the
most part, costs that were already expensive have become more expensive.
Differential Revision: https://reviews.llvm.org/D96692
Florian Hahn [Thu, 18 Feb 2021 11:13:05 +0000 (11:13 +0000)]
[FuncAttrs] Add tests for willreturn callsite inference.
Simon Pilgrim [Wed, 17 Feb 2021 18:17:50 +0000 (18:17 +0000)]
[X86][SSE] Add uniform vector shift test coverage for (sra (trunc (sr[al] x, c1)), c2) folds
Faris Rehman [Wed, 17 Feb 2021 15:55:56 +0000 (15:55 +0000)]
[flang][driver] Add debug dump options
Add the following options:
* -fdebug-dump-symbols
* -fdebug-dump-parse-tree
* -fdebug-dump-provenance
Summary of changes:
- Add 3 new frontend actions: DebugDumpSymbolsAction, DebugDumpParseTreeAction and DebugDumpProvenanceAction
- Add a unique pointer to the Semantics instance created in PrescanAndSemaAction
- Move fatal semantic error reporting to its own method, FrontendActions#reportFatalSemanticErrors
- Port most tests using `-fdebug-dump-symbols` and `-fdebug-dump-parse-tree` to the new driver if built, otherwise default to f18
Differential Revision: https://reviews.llvm.org/D96716
Sven van Haastregt [Thu, 18 Feb 2021 11:27:19 +0000 (11:27 +0000)]
[OpenCL] Move printf declaration to opencl-c-base.h
Supporting `printf` with `-fdeclare-opencl-builtins` would require
special handling (for e.g. varargs and format attributes) for just
this one function. Instead, move the `printf` declaration to the
shared base header.
Differential Revision: https://reviews.llvm.org/D96789
David Green [Thu, 18 Feb 2021 10:50:34 +0000 (10:50 +0000)]
[ARM] MVE ICmp costing tests. NFC
Benjamin Kramer [Thu, 18 Feb 2021 10:42:36 +0000 (11:42 +0100)]
[RISCV] Rewrite assert to not give unused variable warnings in Release builds
NFCI
Julian Gross [Wed, 10 Feb 2021 12:53:11 +0000 (13:53 +0100)]
[MLIR] Create memref dialect and move several dialect-specific ops from std.
Create the memref dialect and move several dialect-specific ops without
dependencies to other ops from std dialect to this dialect.
Moved ops:
AllocOp -> MemRef_AllocOp
AllocaOp -> MemRef_AllocaOp
DeallocOp -> MemRef_DeallocOp
MemRefCastOp -> MemRef_CastOp
GetGlobalMemRefOp -> MemRef_GetGlobalOp
GlobalMemRefOp -> MemRef_GlobalOp
PrefetchOp -> MemRef_PrefetchOp
ReshapeOp -> MemRef_ReshapeOp
StoreOp -> MemRef_StoreOp
TransposeOp -> MemRef_TransposeOp
ViewOp -> MemRef_ViewOp
The roadmap to split the memref dialect from std is discussed here:
https://llvm.discourse.group/t/rfc-split-the-memref-dialect-from-std/2667
Differential Revision: https://reviews.llvm.org/D96425
Fraser Cormack [Wed, 17 Feb 2021 15:57:59 +0000 (15:57 +0000)]
[RISCV] Begin to support more subvector inserts/extracts
This patch adds support for INSERT_SUBVECTOR and EXTRACT_SUBVECTOR
(nominally where both operands are scalable vector types) where the
vector, subvector, and index align sufficiently to allow decomposition
to subregister manipulation:
* For extracts, the extracted subvector must correctly align with the
lower elements of a vector register.
* For inserts, the inserted subvector must be at least one full vector
register, and correctly align as above.
This approach should work for fixed-length vector insertion/extraction
too, but that will come later.
Reviewed By: craig.topper, khchen, arcbbb
Differential Revision: https://reviews.llvm.org/D96873
Fraser Cormack [Wed, 17 Feb 2021 09:25:58 +0000 (09:25 +0000)]
[SVE][CodeGen] Expand SVE MULH[SU] and [SU]MUL_LOHI nodes
This patch fixes a codegen crash introduced in
fde24661718c, where the
DAGCombiner started generating optimized MULH[SU] or [SU]MUL_LOHI nodes
unless the target opted out. The AArch64 backend cannot currently select
any of these nodes, so ensure that they are not generated in the first
place.
This issue was raised by @huihuiz in D94501.
Reviewed By: paulwalker-arm
Differential Revision: https://reviews.llvm.org/D96849
Djordje Todorovic [Thu, 18 Feb 2021 10:03:18 +0000 (02:03 -0800)]
Revert "[Debugify] Make the debugify aware of the original (-g) Debug Info"
This reverts rG8ee7c7e02953.
One test is failing, I'll reland this as soon as possible.
Alex Hoppen [Thu, 18 Feb 2021 09:50:54 +0000 (10:50 +0100)]
[cmake] Move check for libproc to config-ix.cmake
As suggested by Nico in https://reviews.llvm.org/D96049, move check for libproc
from CMakeLists to config-ix.cmake
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/D96713
Note: Also removes the CMAKE_REQUIRED_LIBRARIES which doesn't appear to
be necessary.
Djordje Todorovic [Wed, 30 Sep 2020 13:06:55 +0000 (06:06 -0700)]
[Debugify] Make the debugify aware of the original (-g) Debug Info
As discussed on the RFC [0], I am sharing the set of patches that
enables checking of original Debug Info metadata preservation in
optimizations. The proof-of-concept/proposal can be found at [1].
The implementation from the [1] was full of duplicated code,
so this set of patches tries to merge this approach into the existing
debugify utility.
For example, the utility pass in the original-debuginfo-check
mode could be invoked as follows:
$ opt -verify-debuginfo-preserve -pass-to-test sample.ll
Since this is very initial stage of the implementation,
there is a space for improvements such as:
- Add support for the new pass manager
- Add support for metadata other than DILocations and DISubprograms
[0] https://groups.google.com/forum/#!msg/llvm-dev/QOyF-38YPlE/G213uiuwCAAJ
[1] https://github.com/djolertrk/llvm-di-checker
Differential Revision: https://reviews.llvm.org/D82545
Chen Zheng [Thu, 18 Feb 2021 09:41:05 +0000 (04:41 -0500)]
[XCOFF][NFC] make StorageMappingClass/SymbolType member optional
This patch makes StorageMappingClass/SymbolType member optional in
class MCSectionXCOFF.
Non-csect sections like debug sections have no such properties.
Reviewed By: hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D96641
Haojian Wu [Thu, 18 Feb 2021 09:09:02 +0000 (10:09 +0100)]
[Syntax] No crash on OpaqueValueExpr.
OpaqueValueExpr doesn't correspond to the concrete syntax, it has
invalid source location, ignore them.
Reviewed By: kbobyrev
Differential Revision: https://reviews.llvm.org/D96112
Yang Fan [Thu, 18 Feb 2021 08:31:40 +0000 (16:31 +0800)]
[CSSPGO][llvm-profgen] Fix gcc Wcast-qual warning (NFC)
GCC warning:
```
[3397/3703] Building CXX object tools/llvm-profgen/CMakeFiles/llvm-profgen.dir/llvm-profgen.cpp.o
In file included from /llvm-project/llvm/include/llvm/ADT/STLExtras.h:19,
from /llvm-project/llvm/include/llvm/ADT/StringRef.h:12,
from /llvm-project/llvm/include/llvm/ADT/Twine.h:13,
from /llvm-project/llvm/tools/llvm-profgen/ErrorHandling.h:12,
from /llvm-project/llvm/tools/llvm-profgen/llvm-profgen.cpp:13:
/llvm-project/llvm/include/llvm/ADT/Optional.h: In instantiation of ‘void llvm::optional_detail::OptionalStorage<T, <anonymous> >::emplace(Args&& ...) [with Args = {const std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::sampleprof::LineLocation>}; T = const std::pair<std::__cxx11::basic_string<char>, llvm::sampleprof::LineLocation>; bool <anonymous> = false]’:
/llvm-project/llvm/include/llvm/ADT/Optional.h:79:7: required from ‘constexpr llvm::optional_detail::OptionalStorage<T, <anonymous> >::OptionalStorage(llvm::optional_detail::OptionalStorage<T, <anonymous> >&&) [with T = const std::pair<std::__cxx11::basic_string<char>, llvm::sampleprof::LineLocation>; bool <anonymous> = false]’
/llvm-project/llvm/include/llvm/ADT/Optional.h:253:13: required from here
/llvm-project/llvm/include/llvm/ADT/Optional.h:113:12: warning: cast from type ‘const std::pair<std::__cxx11::basic_string<char>, llvm::sampleprof::LineLocation>*’ to type ‘void*’ casts away qualifiers [-Wcast-qual]
113 | ::new ((void *)std::addressof(value)) T(std::forward<Args>(args)...);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[3398/3703] Building CXX object tools/llvm-profgen/CMakeFiles/llvm-profgen.dir/PerfReader.cpp.o
In file included from /llvm-project/llvm/include/llvm/ADT/STLExtras.h:19,
from /llvm-project/llvm/include/llvm/ADT/StringRef.h:12,
from /llvm-project/llvm/include/llvm/ADT/Twine.h:13,
from /llvm-project/llvm/tools/llvm-profgen/ErrorHandling.h:12,
from /llvm-project/llvm/tools/llvm-profgen/PerfReader.h:11,
from /llvm-project/llvm/tools/llvm-profgen/PerfReader.cpp:8:
/llvm-project/llvm/include/llvm/ADT/Optional.h: In instantiation of ‘void llvm::optional_detail::OptionalStorage<T, <anonymous> >::emplace(Args&& ...) [with Args = {const std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::sampleprof::LineLocation>}; T = const std::pair<std::__cxx11::basic_string<char>, llvm::sampleprof::LineLocation>; bool <anonymous> = false]’:
/llvm-project/llvm/include/llvm/ADT/Optional.h:79:7: required from ‘constexpr llvm::optional_detail::OptionalStorage<T, <anonymous> >::OptionalStorage(llvm::optional_detail::OptionalStorage<T, <anonymous> >&&) [with T = const std::pair<std::__cxx11::basic_string<char>, llvm::sampleprof::LineLocation>; bool <anonymous> = false]’
/llvm-project/llvm/include/llvm/ADT/Optional.h:253:13: required from here
/llvm-project/llvm/include/llvm/ADT/Optional.h:113:12: warning: cast from type ‘const std::pair<std::__cxx11::basic_string<char>, llvm::sampleprof::LineLocation>*’ to type ‘void*’ casts away qualifiers [-Wcast-qual]
113 | ::new ((void *)std::addressof(value)) T(std::forward<Args>(args)...);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[3399/3703] Building CXX object tools/llvm-profgen/CMakeFiles/llvm-profgen.dir/ProfiledBinary.cpp.o
In file included from /llvm-project/llvm/include/llvm/ADT/STLExtras.h:19,
from /llvm-project/llvm/include/llvm/ADT/ArrayRef.h:15,
from /llvm-project/llvm/include/llvm/ADT/DenseMapInfo.h:18,
from /llvm-project/llvm/include/llvm/ADT/DenseMap.h:16,
from /llvm-project/llvm/include/llvm/ADT/DenseSet.h:16,
from /llvm-project/llvm/include/llvm/ProfileData/SampleProf.h:17,
from /llvm-project/llvm/tools/llvm-profgen/CallContext.h:12,
from /llvm-project/llvm/tools/llvm-profgen/ProfiledBinary.h:12,
from /llvm-project/llvm/tools/llvm-profgen/ProfiledBinary.cpp:9:
/llvm-project/llvm/include/llvm/ADT/Optional.h: In instantiation of ‘void llvm::optional_detail::OptionalStorage<T, <anonymous> >::emplace(Args&& ...) [with Args = {const std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::sampleprof::LineLocation>}; T = const std::pair<std::__cxx11::basic_string<char>, llvm::sampleprof::LineLocation>; bool <anonymous> = false]’:
/llvm-project/llvm/include/llvm/ADT/Optional.h:79:7: required from ‘constexpr llvm::optional_detail::OptionalStorage<T, <anonymous> >::OptionalStorage(llvm::optional_detail::OptionalStorage<T, <anonymous> >&&) [with T = const std::pair<std::__cxx11::basic_string<char>, llvm::sampleprof::LineLocation>; bool <anonymous> = false]’
/llvm-project/llvm/include/llvm/ADT/Optional.h:253:13: required from here
/llvm-project/llvm/include/llvm/ADT/Optional.h:113:12: warning: cast from type ‘const std::pair<std::__cxx11::basic_string<char>, llvm::sampleprof::LineLocation>*’ to type ‘void*’ casts away qualifiers [-Wcast-qual]
113 | ::new ((void *)std::addressof(value)) T(std::forward<Args>(args)...);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[3404/3703] Building CXX object tools/llvm-profgen/CMakeFiles/llvm-profgen.dir/ProfileGenerator.cpp.o
In file included from /llvm-project/llvm/include/llvm/ADT/STLExtras.h:19,
from /llvm-project/llvm/include/llvm/ADT/StringRef.h:12,
from /llvm-project/llvm/include/llvm/ADT/Twine.h:13,
from /llvm-project/llvm/tools/llvm-profgen/ErrorHandling.h:12,
from /llvm-project/llvm/tools/llvm-profgen/ProfileGenerator.h:11,
from /llvm-project/llvm/tools/llvm-profgen/ProfileGenerator.cpp:9:
/llvm-project/llvm/include/llvm/ADT/Optional.h: In instantiation of ‘void llvm::optional_detail::OptionalStorage<T, <anonymous> >::emplace(Args&& ...) [with Args = {const std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::sampleprof::LineLocation>}; T = const std::pair<std::__cxx11::basic_string<char>, llvm::sampleprof::LineLocation>; bool <anonymous> = false]’:
/llvm-project/llvm/include/llvm/ADT/Optional.h:79:7: required from ‘constexpr llvm::optional_detail::OptionalStorage<T, <anonymous> >::OptionalStorage(llvm::optional_detail::OptionalStorage<T, <anonymous> >&&) [with T = const std::pair<std::__cxx11::basic_string<char>, llvm::sampleprof::LineLocation>; bool <anonymous> = false]’
/llvm-project/llvm/include/llvm/ADT/Optional.h:253:13: required from here
/llvm-project/llvm/include/llvm/ADT/Optional.h:113:12: warning: cast from type ‘const std::pair<std::__cxx11::basic_string<char>, llvm::sampleprof::LineLocation>*’ to type ‘void*’ casts away qualifiers [-Wcast-qual]
113 | ::new ((void *)std::addressof(value)) T(std::forward<Args>(args)...);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Alex Zinenko [Wed, 17 Feb 2021 18:36:49 +0000 (19:36 +0100)]
[mlir] generate enum translation functions with unused attribute
The functions translating enums to LLVM IR are generated in a single
file included in many places, not all of which use all translations.
Generate functions with "unused" attribute to silence compiler warnings.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D96880
Juneyoung Lee [Thu, 18 Feb 2021 08:34:24 +0000 (17:34 +0900)]
[InstCombine] add tests for simplification of logical and/ors (NFC)
Andy Wingo [Tue, 16 Feb 2021 12:28:44 +0000 (13:28 +0100)]
[lld][WebAssembly] Fix resolveIndirectFunctionTable for relocatable output
For relocatable output that needs the indirect function table, identify
the well-known function table. This allows us to properly fix the
limits on the imported table, and in a followup will allow the element
section to reference the indirect function table even if it's not
assigned to table number 0. Adapt tests for import reordering.
Differential Revision: https://reviews.llvm.org/D96770
Andy Wingo [Wed, 17 Feb 2021 16:20:28 +0000 (17:20 +0100)]
[WebAssembly][lld] --importTable flag only imports table if needed
Before, --importTable forced the creation of an indirect function table,
whether it was needed or not. Now it only imports a table if needed.
Differential Revision: https://reviews.llvm.org/D96872
Raphael Isemann [Thu, 18 Feb 2021 08:02:52 +0000 (09:02 +0100)]
[lldb][NFC] Silence missing case warnings in TypeSystemClang::GetTypeBitAlign due to new RISC-V V types
Those types were added in D92715. This just silences the warning but doesn't
actually add support for those types to LLDB.
Kazu Hirata [Thu, 18 Feb 2021 07:58:46 +0000 (23:58 -0800)]
[CodeGen] Use range-based for loops (NFC)
Kazu Hirata [Thu, 18 Feb 2021 07:58:44 +0000 (23:58 -0800)]
[llvm] Ensure newlines at the end of files (NFC)
This patch eliminates pesky "No newline at end of file" messages from
git diff.
Kazu Hirata [Thu, 18 Feb 2021 07:58:43 +0000 (23:58 -0800)]
[CodeGen] Use ListSeparator (NFC)
Jason Molenda [Thu, 18 Feb 2021 07:44:03 +0000 (23:44 -0800)]
Add a new Row setting to mark all un-declared regs as Undefined
Add a new state for UnwindPlan::Row which indicates that any
register not listed is not defined, and should not be found in
stack frames newer than this one and passed up the stack. Mostly
intended for use with architectural default unwind plans that are
used for jitted stack frames, where we have no unwind information
or start address. lldb has no way to tell if registers were
spilled in the jitted frame & overwritten, so passing register
values up the stack is not safe to show the user.
Architectural default unwind plans are also used as a fast unwind
plan on x86_64 in particular, and are used as the fallback unwind
plans when lldb thinks it may be able to work around a problem
which causes the unwinder to stop walking the stack early.
For fast unwind plans, when we don't find a register location in
the arch default unwind plan, we fall back to computing & using
the full unwind plan. One small part of this patch is to know that
a register marked as Undefined in the fast unwind plan is a special
case, and we should continue on to the full unwind plan to find what
the real unwind rule is for this register.
Differential Revision: https://reviews.llvm.org/D96829
<rdar://problem/
70398009>
Fangrui Song [Thu, 18 Feb 2021 07:33:13 +0000 (23:33 -0800)]
[profile] Make {__start_,__stop_}__llvm_prf_* symbols undefined weak
To make a kind of metadata section usage work, we want to drop the
`__start_/__stop_ references retain C identifier name sections` rule from LLD (see D96914).
If an application has no `__llvm_prf_data` input section surviving --gc-sections,
LLD will error for undefined hidden `{__start_,__stop_}__llvm_prf_*` from `libclang_rt.profile-*`.
Other `__llvm_prf_*` sections have similar issues.
Making the references weak can address the problem.
This probably enables the opportunity to drop zero size dummy sections in `InstrProfilingPlatformLinux.c`.
Reviewed By: davidxl
Differential Revision: https://reviews.llvm.org/D96936
Fangrui Song [Thu, 18 Feb 2021 07:17:20 +0000 (23:17 -0800)]
[llvm-objdump] Map STT_TLS to ST_Other (previously ST_Data)
ST_Data is used to model BFD `BFD_OBJECT`.
A STT_TLS symbol does not have the `BFD_OBJECT` flag in BFD.
This makes sense because a STT_TLS symbol is like in a different address space,
normal data/object properties do not apply on them.
With this change, a STT_TLS symbol will not be displayed as 'O'.
This new behavior matches objdump.
Differential Revision: https://reviews.llvm.org/D96735
Martin Storsjö [Wed, 4 Nov 2020 13:59:56 +0000 (15:59 +0200)]
[libcxx] Implement append and operator/ properly for windows
The root_path function has to be changed to return the parsed bit
as-is; otherwise a path like "//net" gets a root path of "//net/", as
the root name, "//net", gets the root directory (an empty string) appended,
forming "//net/". (The same doesn't happen for the root dir "c:" though.)
Differential Revision: https://reviews.llvm.org/D91178
Yang Fan [Thu, 18 Feb 2021 06:57:45 +0000 (14:57 +0800)]
[MC][ELF] Fix gcc "enumeral and non-enumeral type in conditional expression" warning (NFC)
GCC warning:
```
/llvm-project/llvm/lib/MC/ELFObjectWriter.cpp: In member function ‘uint64_t {anonymous}::ELFWriter::writeObject(llvm::MCAssembler&, const llvm::MCAsmLayout&)’:
/llvm-project/llvm/lib/MC/ELFObjectWriter.cpp:1137:38: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
1137 | write(uint32_t(Group->isComdat() ? ELF::GRP_COMDAT : 0));
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
```
Stanislav Mekhanoshin [Thu, 18 Feb 2021 06:41:04 +0000 (22:41 -0800)]
[AMDGPU] Temporary remove test
Remove hsa-gfx90a-v3.s until D95638. It unexpectedly passes
on s390x.
Yang Fan [Thu, 18 Feb 2021 06:23:18 +0000 (14:23 +0800)]
[MC][ELF] Fix unused variable warning (NFC)
GCC warning:
```
/llvm-project/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp: In member function ‘virtual llvm::MCSection* llvm::TargetLoweringObjectFileELF::getSectionForLSDA(const llvm::Function&, const llvm::MCSymbol&, const llvm::TargetMachine&) const’:
/llvm-project/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:871:8: warning: variable ‘IsComdat’ set but not used [-Wunused-but-set-variable]
871 | bool IsComdat = false;
| ^~~~~~~~
```
Vitaly Buka [Thu, 18 Feb 2021 06:09:46 +0000 (22:09 -0800)]
[NFC] Simplify msan test
Wang, Pengfei [Thu, 18 Feb 2021 03:35:34 +0000 (11:35 +0800)]
[X86] Zero AMX config buffer for non AVX512 cases.
Zero AMX config buffer for non AVX512 cases.
Differential Revision: https://reviews.llvm.org/D96927
Fangrui Song [Thu, 18 Feb 2021 04:03:16 +0000 (20:03 -0800)]
[GWP-ASan] Change sys/cdefs.h to features.h
sys/cdefs.h is a glibc internal header which is not supposed to be included by applications.
(Some libc implementations provide this file for compatibility.)
Android features.h includes sys/cdefs.h, so we can include features.h instead.
This change makes `ninja gwp_asan` build on musl.
Mehdi Chinoune [Thu, 18 Feb 2021 03:45:29 +0000 (21:45 -0600)]
[Flang] Fix compilation on MinGW-w64
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D94707
Igor Kudrin [Wed, 17 Feb 2021 14:17:46 +0000 (21:17 +0700)]
[Driver] Honor "-gdwarf-N" at any position for assembler sources
This fixes an issue when "-gdwarf-N" switch was ignored if it was given
before another debug option.
Differential Revision: https://reviews.llvm.org/D96865
Wang, Pengfei [Thu, 18 Feb 2021 03:30:12 +0000 (11:30 +0800)]
[X86] Add AVX2/SSE2 checks for AMX config buffer zeroing. NFC
Craig Topper [Thu, 18 Feb 2021 02:56:11 +0000 (18:56 -0800)]
[RISCV] Guard LowerINSERT_VECTOR_ELT against fixed vectors.
The type legalizer can call this code based on the scalar type so
we need to verify the vector type is a scalable vector.
I think due to how type legalization visits nodes, the vector type
will have already been legalized so we don't have an issue with
using MVT here like we did for EXTRACT_VECTOR_ELT.
I've added a test just in case.
Fangrui Song [Thu, 18 Feb 2021 03:22:25 +0000 (19:22 -0800)]
[profile] Add __attribute__((used)) to zero size dummy sections
D14468 added these dummy sections. This patch adds `__attribute__((used))` so
that when compiled by GCC>=11 or (expected, D96838) Clang>=13 on some ELF platforms,
these sections will get SHF_GNU_RETAIN to make sure they will not be discarded
by ld --gc-sections.
We are trying to get rid of LLD's "__start_/__stop_ references retain C identifier name sections" rule.
If LLD drops the rule in the future (we will retain compatibility for `__llvm_prf_*` for a while),
`__llvm_prf_*` will need to have the SHF_GNU_RETAIN flag, otherwise:
```
// __llvm_prf_cnts/__llvm_prf_data usually exist, but {names,vnds} may not exist.
// Such diagnostics will happen with {cnts,data} as well if no input object file is instrumented.
% clang++ -fprofile-generate a.cc -fuse-ld=lld -Wl,--gc-sections
ld.lld: error: undefined hidden symbol: __start___llvm_prf_names
>>> referenced by InstrProfilingPlatformLinux.c
>>> InstrProfilingPlatformLinux.c.o:(__llvm_profile_begin_names) in archive /tmp/RelA/lib/clang/13.0.0/lib/linux/libclang_rt.profile-x86_64.a
...
```
Differential Revision: https://reviews.llvm.org/D96902
Joseph Huber [Wed, 27 Jan 2021 15:34:01 +0000 (10:34 -0500)]
[LV] Add analysis remark for mixed precision conversions
Floating point conversions inside vectorized loops have performance
implications but are very subtle. The user could specify a floating
point constant, or call a function without realizing that it will
force a change in the vector width. An example of this behaviour is
seen in https://godbolt.org/z/M3nT6c . The vectorizer should indicate
when this happens becuase it is most likely unintended behaviour.
This patch adds a simple check for this behaviour by following floating
point stores in the original loop and checking if a floating point
conversion operation occurs.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D95539
Craig Topper [Thu, 18 Feb 2021 02:19:22 +0000 (18:19 -0800)]
[RISCV] Guard the ISD::EXTRACT_VECTOR_ELT handling in ReplaceNodeResults against fixed vectors and non-MVT types.
The type legalizer is calling this code based on the scalar type so
we need to verify the input type is a scalable vector.
The vector type has also not been legalized yet when this is called
so we need to use EVT for it.