Siva Chandra [Wed, 3 Feb 2021 08:37:16 +0000 (00:37 -0800)]
[libc][NFC] Move generic math implementations to the generic directory.
This expands the pattern suggest in https://reviews.llvm.org/D95850 to all
math functions.
Roland McGrath [Wed, 3 Feb 2021 04:59:45 +0000 (20:59 -0800)]
[sanitizer_common] Use zx_system_get_page_size() on Fuchsia
Fuchsia is migrating to a variable page size.
Reviewed By: phosek, charco
Differential Revision: https://reviews.llvm.org/D95919
Jez Ng [Wed, 3 Feb 2021 18:35:56 +0000 (13:35 -0500)]
[lld-macho] Rename VERSION CONTROL to VERSION TARGETING in helptext
Per https://reviews.llvm.org/D94938#inline-896740.
Jez Ng [Wed, 3 Feb 2021 18:33:30 +0000 (13:33 -0500)]
[lld-macho] Remove stray ehFrame change
Per https://reviews.llvm.org/D95121#inline-897943.
Jez Ng [Wed, 3 Feb 2021 18:31:42 +0000 (13:31 -0500)]
[lld-macho] Force-loading should share code path with regular archive loads
This extends {D92539} to work even when we are loading archive
members via `-force_load`. I uncovered this issue while trying to
force-load archives containing bitcode -- we were segfaulting.
In addition to fixing the `-force_load` case, this diff also addresses
the behavior of `-ObjC` when LTO bitcode is involved -- we need to
force-load those archive members if they contain ObjC categories.
Reviewed By: #lld-macho, smeenai
Differential Revision: https://reviews.llvm.org/D95265
Jez Ng [Wed, 3 Feb 2021 18:31:40 +0000 (13:31 -0500)]
[lld-macho] Associate each Symbol with an InputFile
This makes our error messages more informative. But the bigger motivation is for
LTO symbol resolution, which will be in an upcoming diff. The changes in this
one are largely mechanical.
Reviewed By: #lld-macho, smeenai
Differential Revision: https://reviews.llvm.org/D94316
Matt Arsenault [Mon, 16 Nov 2020 21:23:26 +0000 (16:23 -0500)]
RegisterCoalescer: Prune undef subranges from copy pairs in loops
If we had a pair of copies inside a loop which introduced new liveness
to a subregister which was undef before the loop, we would have a
dummy phi-only segment remaining across the loop body. Later, this
false segment would confuse RenameIndependentSubregs causing it to
introduce IMPLICIT_DEFs with broken value numbering.
It seems always adding the lanes to ShrinkMask is OK, so any
conditions should be purely a compile time filter.
Jonas Devlieghere [Wed, 3 Feb 2021 18:42:20 +0000 (10:42 -0800)]
[lldb] Fix debugserver-entitlements.plist path
Roland McGrath [Wed, 3 Feb 2021 18:31:45 +0000 (10:31 -0800)]
[gwp_asan] Use zx_system_get_page_size() on Fuchsia
Fuchsia is migrating to a variable page size.
Reviewed By: hctim
Differential Revision: https://reviews.llvm.org/D95920
Roland McGrath [Wed, 3 Feb 2021 04:55:52 +0000 (20:55 -0800)]
[scudo/standalone] Use zx_system_get_page_size() on Fuchsia
Fuchsia is migrating to a variable page size.
Reviewed By: hctim
Differential Revision: https://reviews.llvm.org/D95921
Matt Arsenault [Wed, 3 Feb 2021 18:19:09 +0000 (13:19 -0500)]
Revert "AMDGPU: Don't consider global pressure when bundling soft clauses"
This reverts commit
1e377a273f59375d8e6a424f66f069b3adfa1ca4.
A regression was reported.
Stanislav Mekhanoshin [Wed, 3 Feb 2021 18:04:02 +0000 (10:04 -0800)]
[AMDGPU] Added -mcpu to couple more tests. NFC.
Craig Topper [Wed, 3 Feb 2021 18:16:08 +0000 (10:16 -0800)]
[DAGCombiner] Remove (sra (shl X, C), C) if X has more than C sign bits.
If sext_inreg is supported, we will turn this into sext_inreg. That
will then remove it if there are enough sign bits. But if sext_inreg
isn't supported, we can still remove the shift pair based on sign
bits.
Split from D95890.
Sourabh Singh Tomar [Wed, 3 Feb 2021 17:28:59 +0000 (22:58 +0530)]
[flang] Enable FIR types and Dialect round trip tests
Reviewed By: schweitz, mehdi_amini
Differential Revision: https://reviews.llvm.org/D95958
Shilei Tian [Wed, 3 Feb 2021 18:12:34 +0000 (13:12 -0500)]
[OpenMP] Fixed an issue that taskwait doesn't work on detachable task
D77609 mistakenly changed the bebavior of task waiting on detachable task that a detachable task is not waited, based on https://lists.llvm.org/pipermail/openmp-dev/2021-February/003836.html. This patch fixed it. Thank Raúl for the report.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D95798
Jeremy Morse [Wed, 3 Feb 2021 17:54:33 +0000 (17:54 +0000)]
Revert "[DWARF] Location-less inlined variables should not have DW_TAG_variable"
This reverts commit
ddc2f1e3fb4f8f9ae7dd130e40b60cfc775eba24.
A build-bot objected:
http://lab.llvm.org:8011/#builders/105/builds/5486
Florian Hahn [Wed, 3 Feb 2021 17:45:03 +0000 (17:45 +0000)]
[VPlan] Manage induction value creation using VPValues.
This patch updates the induction value creation to use VPValues of
recipes to map the created values. This should bring is one step closer
to being able to optimize induction recipes directly in VPlan.
Currently widenIntOrFpInduction also generates vector values for a cast
of the induction, if it exists. Make this explicit by adding the cast
instruction to the values defined by the recipe.
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D92284
Jeremy Morse [Wed, 3 Feb 2021 17:27:30 +0000 (17:27 +0000)]
[DWARF] Location-less inlined variables should not have DW_TAG_variable
Discussed in this thread:
https://lists.llvm.org/pipermail/llvm-dev/2021-January/148139.html
DwarfDebug::collectEntityInfo accidentally distinguishes between variable
locations that never have a location specified, and variable locations that
have an empty location specified. The latter leads to the creation of an
empty variable referring to the abstract origin.
Fix this by seeking a non-empty location before producing a concrete
entity, to guarantee a DW_AT_location will be produced. Other loops in
collectEntityInfo and endFunctionImpl take care of examining the
retainedNodes collection and ensuring optimised-out variables are created.
Differential Revision: https://reviews.llvm.org/D95617
Sourabh Singh Tomar [Wed, 3 Feb 2021 14:30:21 +0000 (20:00 +0530)]
[flang][NFCI] Relpace `LoopOp` Op with `DoLoopOp` Op in FIR Dialect
Part of upstreaming effort,
PR: https://github.com/flang-compiler/f18-llvm-project/pull/296
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D95950
Jianzhou Zhao [Tue, 2 Feb 2021 22:35:27 +0000 (22:35 +0000)]
[dfsan] Clean TLS after signal callbacks
Similar to https://reviews.llvm.org/D95642, this diff fixes signal.
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D95896
Krzysztof Parzyszek [Wed, 3 Feb 2021 16:34:50 +0000 (10:34 -0600)]
[Hexagon] Add ELF flags for Hexagon V68
peter klausler [Tue, 2 Feb 2021 18:51:14 +0000 (10:51 -0800)]
[flang] Add -fsyntax-only to f18; retain -fparse-only synonym
Now that semantics is working, the standard -fsyntax-only option of
GNU and Clang should be used as the name of the option that causes
f18 to just run the front-end. Support both options in f18, silently
accepting the old option as a synonym for the new one (as
preferred by the code owner), and replace all instances of the
old -fparse-only option with -fsyntax-only throughout the source base.
Differential Revision: https://reviews.llvm.org/D95887
Kevin P. Neal [Tue, 12 Jan 2021 20:46:59 +0000 (15:46 -0500)]
[FPEnv][X86] Platform builtins edition: clang should get from the AST the metadata for constrained FP builtins
Currently clang is not correctly retrieving from the AST the metadata for
constrained FP builtins. This patch fixes that for the X86 specific builtins.
Differential Revision: https://reviews.llvm.org/D94614
Florian Hahn [Wed, 3 Feb 2021 15:00:37 +0000 (15:00 +0000)]
[ConstraintElimination] Add some tests with conds in loop header.
This patch adds a set of tests in which we can add the information from
the pre-header to a loop header, but currently do not do so.
Jay Foad [Wed, 3 Feb 2021 16:20:12 +0000 (16:20 +0000)]
[AMDGPU] Fix multiclass template parameter types. NFC.
This fixes TableGen parser errors that will be reported when D95874 is
applied.
Differential Revision: https://reviews.llvm.org/D95955
Juneyoung Lee [Wed, 3 Feb 2021 15:07:04 +0000 (00:07 +0900)]
Revert "[ConstantFold] Fold more operations to poison"
This reverts commit
53040a968dc2ff20931661e55f05da2ef8b964a0 due to its
bad interaction with select i1 -> and/or i1 transformation.
This fixes:
https://bugs.llvm.org/show_bug.cgi?id=49005
https://bugs.llvm.org/show_bug.cgi?id=48435
Abhina Sreeskantharajan [Wed, 3 Feb 2021 14:52:43 +0000 (09:52 -0500)]
[test] Use host platform specific error message substitution in lit tests - continued
On z/OS, other error messages are not matched correctly in lit tests.
```
EDC5121I Invalid argument.
EDC5111I Permission denied.
```
This patch adds a lit substitution to fix it.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D95808
Matt Arsenault [Sat, 9 Jan 2021 15:44:29 +0000 (10:44 -0500)]
AMDGPU: Move handling of allocation of fixed ABI inputs
For the fixed ABI, set this in the initial argument constructor,
rather than relying on the allocation logic to set the values. Also
stop passing them for amdgpu_gfx, since the DAG path seems to skip
these. I'm unclear on what amdgpu_gfx's expectations are. This will
allow moving the special input registers out of the normal argument
range.
Sanjay Patel [Wed, 3 Feb 2021 14:22:51 +0000 (09:22 -0500)]
[LoopVectorize] add test for fake min/max; NFC
This goes with the dyn_cast fix:
0fa61304d247a61
That was made after noticing that the assert was over-reaching here:
bbed5f2f8a ( D95690 )
Simon Pilgrim [Wed, 3 Feb 2021 13:26:36 +0000 (13:26 +0000)]
[X86][SSE] Support variable-index float/double vector insertion on SSE41+ targets (PR47924)
Extends D95779 to permit insertion into float/doubles vectors while avoiding a lot of aliased memory traffic.
The scalar value is already on the simd unit, so we only need to transfer and splat the index value, then perform the select.
SSE4 codegen is a little bulky due to the tied register requirements of (non-VEX) BLENDPS/PD but the extra moves are cheap so shouldn't be an actual problem.
Differential Revision: https://reviews.llvm.org/D95866
Anastasia Stulova [Wed, 3 Feb 2021 14:04:13 +0000 (14:04 +0000)]
[OpenCL][Docs] Fix command line flag in the example.
Fixed incorrect example of clang command line with
the builtin function declarations in OpenCLSupport.
Tags: #clang
Ilya Mirsky [Mon, 18 Jan 2021 00:02:44 +0000 (18:02 -0600)]
[Sema] Fix -Warray-bounds false negative when casting an out-of-bounds array item
Patch by Ilya Mirsky!
Fixes: http://llvm.org/PR44343
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D71714
Anastasia Stulova [Wed, 3 Feb 2021 11:05:00 +0000 (11:05 +0000)]
[OpenCL] Fix address space in binding of initializer lists to referencs
Prevent materializing temporaries in the address space of the references
they are bind to. The temporaries should always be in the same address
space - private for OpenCL.
Tags: #clang
Differential Revision: https://reviews.llvm.org/D95608
Matthew Parkinson [Wed, 3 Feb 2021 11:28:43 +0000 (11:28 +0000)]
Fix MLIR Async Runtime DLL on Windows
The AsyncRuntime declares prototypes for extern "C" functions inside a
namespace in the header, but not inside that namespace in the
definition. This causes Visual Studio to treat them as different
entities and thus the dllexport is ignored for the definitions.
Using the same namespace fixes this issue.
Secondly, this commit moves the dllexport to be consistent with the
JITs expectation.
This is an update to https://reviews.llvm.org/D95386 that fixes the
compile issues in old versions of Visual studio.
Differential Revision: https://reviews.llvm.org/D95933
Ben Shi [Wed, 3 Feb 2021 12:00:06 +0000 (20:00 +0800)]
[clang][AVR][NFC] Fix a typo
Fix a typo in commit
d38973aa4d6a2c8be97b9781ca7325ca3eb0c40d
Utkarsh Saxena [Mon, 1 Feb 2021 20:17:53 +0000 (21:17 +0100)]
[clangd] Report xref for base methods.
See: https://github.com/clangd/clangd/issues/668
```
struct A { virtual void foo() = 0; };
struct B : A { void foo() override; };
```
Find refs on `B::foo()` will show:
- decls of `A::foo()` (new)
- decls of `B::foo()`
- refs to `A::foo()` (new)
- refs to `B::foo()`.
Differential Revision: https://reviews.llvm.org/D95852
Praveen [Wed, 3 Feb 2021 10:18:30 +0000 (15:48 +0530)]
[Flang][OpenMP] Add semantic checks for invalid branches into or out of OpenMP constructs
OpenMP 4.5 - Check invalid branches into OpenMP strucutred blocks.
Check invalid branches leaving OpenMP structured blocks.
Test cases : omp-do-cycle.f90, omp-invalid-branch.f90
Resolve related test cases marked as XFAIL
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D92735
Sven van Haastregt [Wed, 3 Feb 2021 10:23:52 +0000 (10:23 +0000)]
[OpenCL] Add cl_khr_subgroup_non_uniform_vote to TableGen BIFs
Add the builtin functions brought by the
cl_khr_subgroup_non_uniform_vote extension to
`-fdeclare-opencl-builtins`.
Sven van Haastregt [Tue, 2 Feb 2021 17:20:38 +0000 (17:20 +0000)]
[OpenCL] Add cl_khr_subgroup_ballot to TableGen BIFs
Add the builtin functions brought by the cl_khr_subgroup_ballot
extension to `-fdeclare-opencl-builtins`.
Also add placeholder comments for the other Extended Subgroup
Functions from the OpenCL Extension Specification.
Add a comment clarifying the scope of the test.
Differential Revision: https://reviews.llvm.org/D95523
Ben Shi [Wed, 3 Feb 2021 10:23:01 +0000 (18:23 +0800)]
[clang][AVR] Improve avr-ld command line options
Reviewed By: dylanmckay, MaskRay
Differential Revision: https://reviews.llvm.org/D93579
Sebastian Neubauer [Wed, 3 Feb 2021 10:00:30 +0000 (11:00 +0100)]
Revert "[AMDGPU] Add a new Clamp Pattern to the GlobalISel Path."
This reverts commits
62af0305b7cc..
677a3529d3e6 from D93708.
They cause failures in the sanitizer builds because of uninitialized
values.
A fix is in D95878, but it might take some time until this is pushed,
so reverting the changes for now.
Caroline Concatto [Thu, 28 Jan 2021 08:46:44 +0000 (08:46 +0000)]
[AArch64][SVE]Add cost model for broadcast shuffle
This patch adds a cost model for SK_Broadcast in
AArch64TTIImpl::getShuffleCost with scalable vector.
Without this patch, the scalable vector type relies on BasicTTIImpl cost
implementation and assert.
Differential Revision: https://reviews.llvm.org/D95598
Andre Vieira [Wed, 3 Feb 2021 09:28:42 +0000 (09:28 +0000)]
[LIBC] Add optimized memcpy routine for AArch64
This patch adds an optimized memcpy routine for AArch64 tuned and benchmarked
on Neoverse-N1.
Differential Revision: https://reviews.llvm.org/D92235
David Sherwood [Fri, 29 Jan 2021 11:46:41 +0000 (11:46 +0000)]
[VPlan][NFC] Introduce constructors for VPIteration
This patch adds constructors to VPIteration as a cleaner way of
initialising the struct and replaces existing constructions of
the form:
{Part, Lane}
with
VPIteration(Part, Lane)
I have also added a default constructor, which is used by VPlan.cpp
when deciding whether to replicate a block or not.
This refactoring will be required in a later patch that adds more
members and functions to VPIteration.
Differential Revision: https://reviews.llvm.org/D95676
Wang, Pengfei [Wed, 3 Feb 2021 08:04:12 +0000 (16:04 +0800)]
[X86] Correct types in tablegen multiclasses found by D95874.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D95926
Sam McCall [Wed, 3 Feb 2021 07:30:45 +0000 (08:30 +0100)]
[clang-include-fixer] Pre-reserve vector size. NFC
Martin Storsjö [Wed, 4 Nov 2020 21:51:18 +0000 (23:51 +0200)]
[libcxx] Implement the read_symlink function for windows
Differential Revision: https://reviews.llvm.org/D91172
Martin Storsjö [Wed, 4 Nov 2020 21:55:10 +0000 (23:55 +0200)]
[libcxx] Implement the permissions function for windows
Differential Revision: https://reviews.llvm.org/D91171
Petr Hosek [Sat, 13 Jul 2019 21:02:07 +0000 (14:02 -0700)]
[InstrProfiling] Use !associated metadata for counters, data and values
C identifier name input sections such as __llvm_prf_* are GC roots so
they cannot be discarded. In LLD, the SHF_LINK_ORDER flag overrides the
C identifier name semantics.
The !associated metadata may be attached to a global object declaration
with a single argument that references another global object, and it
gets lowered to SHF_LINK_ORDER flag. When a function symbol is discarded
by the linker, setting up !associated metadata allows linker to discard
counters, data and values associated with that function symbol.
Note that !associated metadata is only supported by ELF, it does not have
any effect on non-ELF targets.
Differential Revision: https://reviews.llvm.org/D76802
Kazu Hirata [Wed, 3 Feb 2021 06:52:48 +0000 (22:52 -0800)]
[AsmPrinter] Use ListSeparator (NFC)
Kazu Hirata [Wed, 3 Feb 2021 06:52:46 +0000 (22:52 -0800)]
[Transforms/Utils] Use range-based for loops (NFC)
Kazu Hirata [Wed, 3 Feb 2021 06:52:45 +0000 (22:52 -0800)]
[CodeGen] Drop unnecessary const from return types (NFC)
Identified with const-return-type.
LLVM GN Syncbot [Wed, 3 Feb 2021 05:46:53 +0000 (05:46 +0000)]
[gn build] Port
fcf03e728007
Hsiangkai Wang [Tue, 15 Dec 2020 23:23:35 +0000 (07:23 +0800)]
[RISCV] Load/store vector mask types.
Use vle1.v/vse1.v to load/store vector mask types.
Differential Revision: https://reviews.llvm.org/D93364
Pushpinder Singh [Tue, 19 Jan 2021 08:13:47 +0000 (13:43 +0530)]
[OpenMP] Add OpenMP offloading toolchain for AMDGPU
This patch adds AMDGPUOpenMPToolChain for supporting OpenMP
offloading to AMD GPU's.
Originally authored by Greg Rodgers
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D94961
Hsiangkai Wang [Mon, 1 Feb 2021 08:08:46 +0000 (16:08 +0800)]
[RISCV] Add new vector instructions in v0.10.
* Add new vector instructions in v0.10.
- load/store for mask value vle1.v vse1.v
- vsetivli for 0-31 immediate vector length.
* Rename vector instructions in v0.10.
- vfrsqrte7 -> vfrsqrt7
- vfrece7 -> vfrec7
* Reserve memory width encodings for EEW>128b.
Differential Revision: https://reviews.llvm.org/D95781
Arthur Eubanks [Thu, 28 Jan 2021 00:15:44 +0000 (16:15 -0800)]
[Docs] Update HowToSubmitABug
With the new PM imminent, bugpoint will diverge from opt, meaning it may
not reproduce a crash with the same arguments passed to opt. We need to
specify alternatives to bugpoint for reducing crashes.
I looked at the rest of the document to see if anything could be
improved. Major highlights:
* Run -Xclang -disable-llvm-passes instead of -O0 for skipping IR passes
* Mention the files that clang dumps on a crash
* Remove outdated reference to `delta` and plug `creduce` instead
* Mention llvm-reduce on top of bugpoint
* Mention --print-before-all --print-module-scope
* Mention sanitizers in addition to valgrind
* Mention opt-bisect for miscompiles
Reviewed By: fhahn, MaskRay
Differential Revision: https://reviews.llvm.org/D95578
Nathan James [Wed, 3 Feb 2021 05:18:00 +0000 (05:18 +0000)]
[NFC] Fix typo in comment
Jianzhou Zhao [Tue, 2 Feb 2021 18:09:22 +0000 (18:09 +0000)]
[dfsan] Wrap memmove
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D95883
Nathan James [Wed, 3 Feb 2021 05:11:28 +0000 (05:11 +0000)]
[clang-tidy] Fix crash in readability-identifier-naming check
`isParamInMainLikeFunction` didn't check if the function had an identifer name before calling getName() which could lead to an assert.
Serguei Katkov [Tue, 2 Feb 2021 09:25:11 +0000 (16:25 +0700)]
[Statepoint] Handle 'undef' operand tied to def
FixupStatepoints pass does not take into account the undef use
it skips may have a tied def. So when defs are handled pass
considers that tied-use should be spilled and triggers an assert.
FixupStatepoints should skip undef def as well.
Reviewers: reames, dantrushin
Reviewed By: dantrushin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D95858
Yang Fan [Wed, 3 Feb 2021 03:04:58 +0000 (11:04 +0800)]
[CSSPGO] Fix MSVC initializing truncation warning (NFC)
MSVC warning:
```
\llvm-project\llvm\include\llvm\Transforms\IPO\SampleProfileProbe.h(65): warning C4305: 'initializing': truncation from 'double' to 'const float'
```
Yang Fan [Wed, 3 Feb 2021 02:48:39 +0000 (10:48 +0800)]
[clang-format] Fix MSVC "unsafe use of type 'bool' in operation" warning (NFC)
MSVC warning:
```
\llvm-project\clang\lib\Format\BreakableToken.cpp(1002): warning C4804: '-': unsafe use of type 'bool' in operation
```
Fangrui Song [Wed, 3 Feb 2021 02:28:37 +0000 (18:28 -0800)]
[yaml2obj][wasm] Support numeric relocation type
Differential Revision: https://reviews.llvm.org/D95661
Yang Fan [Wed, 3 Feb 2021 02:21:45 +0000 (10:21 +0800)]
[VFS] Fix Wreturn-type gcc warning (NFC)
GCC warning:
```
In file included from /llvm-project/llvm/lib/Support/VirtualFileSystem.cpp:13:
/llvm-project/llvm/include/llvm/Support/VirtualFileSystem.h: In static member function ‘static bool llvm::vfs::RedirectingFileSystem::RemapEntry::classof(const llvm::vfs::RedirectingFileSystem::Entry*)’:
/llvm-project/llvm/include/llvm/Support/VirtualFileSystem.h:681:5: warning: control reaches end of non-void function [-Wreturn-type]
681 | }
| ^
```
Chen Zheng [Wed, 3 Feb 2021 02:01:19 +0000 (21:01 -0500)]
[PowerPC] [NFC] fix wording typos
Post commit comments address for D92071.
Med Ismail Bennani [Wed, 3 Feb 2021 01:46:50 +0000 (02:46 +0100)]
[lldb/test] Stop recording fundamental return types (NFC)
It seems that recording fundamental return type is bogus.
This can trigger asserts when running a test with reproducers so this
patch updates the `SBTarget::IsLoaded` test to stop recording them.
Differential Revision: https://reviews.llvm.org/D95686
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Matt Arsenault [Tue, 2 Feb 2021 21:22:32 +0000 (16:22 -0500)]
AMDGPU: Fix adding extra operands for i128 asm constraints
We don't register i128 as a legal type with addRegisterClass, but it
appears in the list of legal register types. This inconsistency
resulted in the asm constraint lowering trying to use 2 128-bit
registers for these operands. This would leave behind a dead def that
would waste registers.
Regresses GlobalISel tests for i128 load/store, but these aren't very
important right now. Ideally these would not depend on the list of
register types.
Matt Arsenault [Sat, 30 Jan 2021 18:15:53 +0000 (13:15 -0500)]
AMDGPU: Don't consider global pressure when bundling soft clauses
This should only consider whether the pressure impact of the bundle at
the given point in the program will decrease the occupancy. High VGPR
pressure was incorrectly blocking the formation of scalar bundles, and
vice versa. This was also blocking bundling from high pressure
situations at other points in the program.
Jessica Paquette [Tue, 2 Feb 2021 22:21:33 +0000 (14:21 -0800)]
[GlobalISel] Check if branches use the same MBB in matchOptBrCondByInvertingCond
If the G_BR + G_BRCOND in this combine use the same MBB, then it will infinite
loop. Don't allow that to happen.
Differential Revision: https://reviews.llvm.org/D95895
Siva Chandra [Tue, 2 Feb 2021 07:43:05 +0000 (23:43 -0800)]
[libc] Add hardware implementations of ceil and ceilf for aarch64.
This change also introduces a new source layout for adding machine
specific and generic implementations. To keep the scope of this change
small, this new pattern is only applied for ceil, ceilf and ceill.
Follow up changes will switch all math functions in to the new pattern.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D95850
Lei Zhang [Tue, 2 Feb 2021 23:30:41 +0000 (18:30 -0500)]
[mlir] Fix scf.for single iteration canonicalization check
We should be check whether lb + step >= ub to determine
whether this is a single iteration. Previously we were
checking lb + lb >= ub.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D95440
Diego Caballero [Tue, 2 Feb 2021 22:39:41 +0000 (00:39 +0200)]
[mlir][Vector] Add lowering to LLVM for vector.bitcast
Add the conversion pattern for vector.bitcast to lower it to
the LLVM Dialect.
Reviewed By: ThomasRaoux, aartbik
Differential Revision: https://reviews.llvm.org/D95579
Fangrui Song [Tue, 2 Feb 2021 23:18:00 +0000 (15:18 -0800)]
[FileCheck] Make --allow-unused-prefixes cl::ZeroOrMore
cl::ZeroOrMore allows the option to be specified multiple times, which makes
downstream projects possible to specify a default value in lit configuration
while some tests can override the value.
peter klausler [Tue, 2 Feb 2021 22:39:05 +0000 (14:39 -0800)]
[flang] Add TypeAndShape::MeasureElementSizeInBytes()
Split up MeasureSizeInBytes() so that array element sizes can be
calculated accurately; use the new API in some places where
DynamicType::MeasureSizeInBytes() was being used but the new
API performs better due to TypeAndShape having precise CHARACTER
length information.
Differential Revision: https://reviews.llvm.org/D95897
Arthur Eubanks [Tue, 2 Feb 2021 22:45:45 +0000 (14:45 -0800)]
[test][NewPM] Pin various tests to the legacy PM
tut-simplify-cfg hasn't been ported to the new PM.
llvm-lto2's -enable-new-pm defaults to the CMake flag, so the legacy PM extension test needs to be pinned.
Reviewed By: MaskRay, ychen
Differential Revision: https://reviews.llvm.org/D95898
LLVM GN Syncbot [Tue, 2 Feb 2021 22:57:59 +0000 (22:57 +0000)]
[gn build] Port
4f58b1bd2974
Kyungwoo Lee [Tue, 2 Feb 2021 03:32:32 +0000 (22:32 -0500)]
[AArch64] Homogeneous Prolog and Epilog Size Optimization
Second land attempt. MachineVerifier DefRegState expensive check errors fixed.
Prologs and epilogs handle callee-save registers and tend to be irregular with
different immediate offsets that are not often handled by the MachineOutliner.
Commit D18619/
a5335647d5e8 (combining stack operations) stretched irregularity
further.
This patch tries to emit homogeneous stores and loads with the same offset for
prologs and epilogs respectively. We have observed that this canonicalizes
(homogenizes) prologs and epilogs significantly and results in a greatly
increased chance of outlining, resulting in a code size reduction.
Despite the above results, there are still size wins to be had that the
MachineOutliner does not provide due to the special handling X30/LR. To handle
the LR case, his patch custom-outlines prologs and epilogs in place. It does
this by doing the following:
* Injects HOM_Prolog and HOM_Epilog pseudo instructions during a Prolog and
Epilog Injection Pass.
* Lowers and optimizes said pseudos in a AArchLowerHomogneousPrologEpilog Pass.
* Outlined helpers are created on demand. Identical helpers are merged by the linker.
* An opt-in flag is introduced to enable this feature. Another threshold flag
is also introduced to control the aggressiveness of outlining for application's need.
This reduced an average of 4% of code size on LLVM-TestSuite/CTMark targeting arm64/-Oz.
Differential Revision: https://reviews.llvm.org/D76570
Mitch Phillips [Tue, 2 Feb 2021 22:46:25 +0000 (14:46 -0800)]
Revert "[GWP-ASan] Add aligned allocations."
This reverts commit
9dc06762470cb5a6cde8de5833cb75262e1bacb0.
Should not have been committed, was a bad rebase. Review still
continuing on D94830.
Mitch Phillips [Tue, 2 Feb 2021 22:32:28 +0000 (14:32 -0800)]
[GWP-ASan] Add locking around unwinder for atfork protection.
Unwinders (like libc's backtrace()) can call their own locks (like the
libdl lock). We need to let the unwinder release the locks before
forking. Wrap a new lock around the unwinder for atfork protection.
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D95889
Mitch Phillips [Thu, 14 Jan 2021 23:16:56 +0000 (15:16 -0800)]
[GWP-ASan] Add aligned allocations.
Adds a new allocation API to GWP-ASan that handles size+alignment
restrictions.
Differential Revision: https://reviews.llvm.org/D94830
Richard Smith [Wed, 27 Jan 2021 07:36:01 +0000 (23:36 -0800)]
Diagnose if a SLEB128 is too large to fit in an int64_t.
Previously we'd hit UB due to an invalid left shift operand.
Also fix the WASM emitter to properly use SLEB128 encoding instead of
ULEB128 encoding for signed fields so that negative numbers don't
result in overly-large values that we can't read back any more.
In passing, don't diagnose a non-canonical ULEB128 that fits in a uint64_t but
has redundant trailing zero bytes.
Reviewed By: dblaikie, aardappel
Differential Revision: https://reviews.llvm.org/D95510
Jianzhou Zhao [Thu, 28 Jan 2021 22:36:47 +0000 (22:36 +0000)]
[dfsan] Clean TLS after sigaction callbacks
DFSan uses TLS to pass metadata of arguments and return values. When an
instrumented function accesses the TLS, if a signal callback happens, and
the callback calls other instrumented functions with updating the same TLS,
the TLS is in an inconsistent state after the callback ends. This may cause
either under-tainting or over-tainting.
This fix follows MSan's workaround.
https://github.com/llvm/llvm-project/commit/
cb22c67a21e4b5e1ade65141117a70be318be072
It simply resets TLS at restore. This prevents from over-tainting. Although
under-tainting may still happen, a taint flow can be found eventually if we
run a DFSan-instrumented program multiple times. The alternative option is
saving the entire TLS. However the TLS storage takes 2k bytes, and signal calls
could be nested. So it does not seem worth.
This diff fixes sigaction. A following diff will be fixing signal.
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D95642
Florian Hahn [Tue, 2 Feb 2021 17:01:40 +0000 (17:01 +0000)]
[ConstraintElimination] Skip pointer casts.
We should be able to look through pointer casts that do not impact the
value.
Martin Storsjö [Wed, 4 Nov 2020 21:51:12 +0000 (23:51 +0200)]
[libcxx] Implement the canonical function for windows
Differential Revision: https://reviews.llvm.org/D91170
Martin Storsjö [Wed, 4 Nov 2020 21:46:12 +0000 (23:46 +0200)]
[libcxx] Implement the current_path function for windows
Differential Revision: https://reviews.llvm.org/D91169
Louis Dionne [Tue, 2 Feb 2021 19:59:35 +0000 (14:59 -0500)]
[libc++] Add new queues for specific macOS system versions
This will allow running back-deployment testing on macOS only on systems
running the right version of macOS. For the time being, we're cheating
because we don't have actual machines running older than 10.15.
Mehdi Amini [Tue, 2 Feb 2021 20:53:59 +0000 (20:53 +0000)]
Revert "Fix namespace for MLIR Async Runtime"
This reverts commit
b7d80058ff4649d1a15ef930269458dbb17145d9.
The mlir-windows buildbot is broken.
Reid Kleckner [Mon, 1 Feb 2021 23:18:42 +0000 (15:18 -0800)]
Disable CFI in __get_elem to allow casting a pointer to uninitialized memory
Fixes usage of shared_ptr with CFI enabled, which is llvm.org/pr48993.
Differential Revision: https://reviews.llvm.org/D95827
Dave Lee [Mon, 1 Feb 2021 20:01:32 +0000 (12:01 -0800)]
[lldb] Convert assertTrue(a == b) to assertEqual(a, b)
Convert `assertTrue(a == b)` to `assertEqual(a, b)` to produce better failure messages.
These were mostly done via regex search & replace, with some manual fixes.
Differential Revision: https://reviews.llvm.org/D95813
Christopher Tetreault [Tue, 2 Feb 2021 20:09:09 +0000 (12:09 -0800)]
Revert "Ensure that InstructionCost actually implements a total ordering"
This reverts commit
b481cd519e07b3ad2bd3e81c89b0dd8efd68d6bc.
River Riddle [Tue, 2 Feb 2021 19:32:52 +0000 (11:32 -0800)]
[mlir][Pattern] Create a new IRRewriter class to enable sharing code with pattern rewrites
This revision adds two new classes, RewriterBase and IRRewriter. RewriterBase is a new shared base class between IRRewriter and PatternRewriter. PatternRewriter will continue to be the base class used to perform rewrites within a rewrite pattern. IRRewriter on the other hand, is a new class that allows for tracking IR rewrites from outside of a rewrite pattern. In this revision all of the old API from PatternRewriter is moved to RewriterBase, but the distinction between IRRewriter and PatternRewriter is kept on the chance that a necessary API divergence happens in the future.
Currently if you want to have some utility that transforms a piece of IR and share it between pattern and non-pattern code, you have to duplicate it. This revision enables the creation of utilities that can be invoked from rewrite patterns and normal transformation code:
```c++
void someSharedUtility(RewriterBase &rewriter, ...) {
// Some interesting IR mutation here.
}
// Some RewritePattern
LogicalResult MyPattern::matchAndRewrite(Operation *op, PatternRewriter &rewriter) {
...
someSharedUtility(rewriter, ...);
...
}
// Some Pass
void MyPass::runOnOperation() {
...
IRRewriter rewriter(...);
someSharedUtility(rewriter, ...);
}
```
Differential Revision: https://reviews.llvm.org/D94638
Eric Schweitz [Tue, 2 Feb 2021 18:56:50 +0000 (10:56 -0800)]
[flang][NFC] Update the CG rewrite pass.
Add description and dependencies.
Differential Revision: https://reviews.llvm.org/D95888
Hongtao Yu [Fri, 11 Dec 2020 20:18:31 +0000 (12:18 -0800)]
[CSSPGO] Introducing distribution factor for pseudo probe.
Sample re-annotation is required in LTO time to achieve a reasonable post-inline profile quality. However, we have seen that such LTO-time re-annotation degrades profile quality. This is mainly caused by preLTO code duplication that is done by passes such as loop unrolling, jump threading, indirect call promotion etc, where samples corresponding to a source location are aggregated multiple times due to the duplicates. In this change we are introducing a concept of distribution factor for pseudo probes so that samples can be distributed for duplicated probes scaled by a factor. We hope that optimizations duplicating code well-maintain the branch frequency information (BFI) based on which probe distribution factors are calculated. Distribution factors are updated at the end of preLTO pipeline to reflect an estimated portion of the real execution count.
This change also introduces a pseudo probe verifier that can be run after each IR passes to detect duplicated pseudo probes.
A saturated distribution factor stands for 1.0. A pesudo probe will carry a factor with the value ranged from 0.0 to 1.0. A 64-bit integral distribution factor field that represents [0.0, 1.0] is associated to each block probe. Unfortunately this cannot be done for callsite probes due to the size limitation of a 32-bit Dwarf discriminator. A 7-bit distribution factor is used instead.
Changes are also needed to the sample profile inliner to deal with prorated callsite counts. Call sites duplicated by PreLTO passes, when later on inlined in LTO time, should have the callees’s probe prorated based on the Prelink-computed distribution factors. The distribution factors should also be taken into account when computing hotness for inline candidates. Also, Indirect call promotion results in multiple callisites. The original samples should be distributed across them. This is fixed by adjusting the callisites' distribution factors.
Reviewed By: wmi
Differential Revision: https://reviews.llvm.org/D93264
Eric Schweitz [Tue, 2 Feb 2021 17:57:26 +0000 (09:57 -0800)]
[flang][NFC] Update #include.
Differential Revision: https://reviews.llvm.org/D95882
Christopher Tetreault [Tue, 2 Feb 2021 17:14:55 +0000 (09:14 -0800)]
Ensure that InstructionCost actually implements a total ordering
Previously, operator== would consider the actual equality of the pairs
(lhs.Value, lhs.State) == (rhs.Value, rhs.State). However, if an invalid
cost was involved in a call to operator<, only the state would be
compared. Thus, it was not the case that ({2, Invalid} < {3, Invalid} ||
{2, Invalid} > {3, Invalid} || {2, Invalid} == {3, Invalid}).
This patch implements a true total ordering, where cost state is
considered first, then value. While it's not really imporant that
{2, Invalid} be considered to be less than {3, Invalid}, it's not a
problem either. This patch also implements operator== in terms of
operator<, so the two definitions will be kept in sync.
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D95803
peter klausler [Mon, 1 Feb 2021 23:23:58 +0000 (15:23 -0800)]
[flang] Implement IEEE_SUPPORT_xxx inquiry functions
Implement IEEE_SUPPORT_DATATYPE() and other inquiry intrinisic
functions from the intrinsic module IEEE_ARITHMETIC, folding all of
their results to .TRUE.
Differential Revision: https://reviews.llvm.org/D95830
peter klausler [Mon, 1 Feb 2021 23:26:48 +0000 (15:26 -0800)]
[flang] Detect UBOUND() error on assumed-size array
UBOUND() is not allowed on the last dimension of an
assumed-size array dummy argument.
Differential Revision: https://reviews.llvm.org/D95831
Fangrui Song [Tue, 2 Feb 2021 19:22:46 +0000 (11:22 -0800)]
[test] Default clang/test to FileCheck --allow-unused-prefixes=false
Matthew Parkinson [Tue, 2 Feb 2021 18:15:19 +0000 (18:15 +0000)]
Fix namespace for MLIR Async Runtime
The MLIR Async runtime uses different namespacing for the header file,
and the definitions of its C API. The header file places the extern "C"
functions inside namespace mlir::runtime, and the definitions are not
in a namespace. This causes issues in cl.exe. It treats the declaration
and definition as different, and thus does not apply dllexport to the
definition, which leads to the mlir_async_runtime.dll containing no
definitions, and the mlir_async_runtime.lib not being generated.
This patch moves the namespace to cover the definitions, and thus
generates the dll correctly on Windows with cl.exe.
This was tested with Visual Studio C++ 19.28.29336.
Differential Revision: https://reviews.llvm.org/D95386