Omar Emara [Wed, 25 Aug 2021 20:54:49 +0000 (13:54 -0700)]
[LLDB][GUI] Add initial searcher support
This patch adds a new type of reusable UI components. Searcher Windows
contain a text field to enter a search keyword and a list of scrollable
matches are presented. The target match can be selected and executed
which invokes a user callback to do something with the match.
This patch also adds one searcher delegate, which wraps the common
command completion searchers for simple use cases.
Reviewed By: clayborg
Differential Revision: https://reviews.llvm.org/D108545
Andrea Di Biagio [Wed, 25 Aug 2021 20:24:58 +0000 (21:24 +0100)]
[X86][MCA] Add more tests for MULX (PR51495).
llvm-mca still reports a wrong latency for the case where
the two destination registers of MULX are the same.
Justas Janickas [Wed, 25 Aug 2021 20:20:06 +0000 (21:20 +0100)]
[OpenCL][NFC] Fix code example in __remove_address_space documentation.
Sanjay Patel [Wed, 25 Aug 2021 20:09:51 +0000 (16:09 -0400)]
[DAGCombiner] create binop nodes with all of expected values
This is another bug exposed by https://llvm.org/PR51612
(and the one that triggered the initial assertion) in the report.
That example was suppressed with:
985b48f18341
...but these would still crash because we created nodes
like UADDO without the expected 2 output values.
Alfonso Sánchez-Beato [Wed, 25 Aug 2021 20:03:32 +0000 (23:03 +0300)]
[llvm-objcopy] [COFF] Consider section flags when adding section
The --set-section-flags option was being ignored when adding a new
section. Take it into account if present.
Fixes https://llvm.org/PR51244
Reviewed By: jhenderson, MaskRay
Differential Revision: https://reviews.llvm.org/D106942
Florian Hahn [Wed, 25 Aug 2021 19:39:33 +0000 (20:39 +0100)]
[ConstraintElimination] Add test cases with @llvm.assume.
Tobias Gysi [Wed, 25 Aug 2021 19:27:42 +0000 (19:27 +0000)]
[mlir][linalg] Tune hasTensorSemantics/hasBufferSemantics methods.
Optimize performance by iterating all operands at once.
Reviewed By: benvanik
Differential Revision: https://reviews.llvm.org/D108716
LLVM GN Syncbot [Wed, 25 Aug 2021 19:14:11 +0000 (19:14 +0000)]
[gn build] Port
fe01014faa33
Patrick Holland [Sun, 22 Aug 2021 00:37:02 +0000 (17:37 -0700)]
[MCA] Moved View.h and View.cpp from /tools/llvm-mca/ to /lib/MCA/.
Moved View.h and View.cpp from /tools/llvm-mca/Views/ to /lib/MCA/ and
/include/llvm/MCA/. This is so that targets can define their own Views within
the /lib/Target/ directory (so that the View can use backend functionality).
To enable these Views within mca, targets will need to add them to the vector of
Views returned by their target's CustomBehaviour::getViews() methods.
Differential Revision: https://reviews.llvm.org/D108520
Nick Desaulniers [Wed, 25 Aug 2021 19:10:27 +0000 (12:10 -0700)]
[llvm][test][CodeGen] fix up D106030
Fixes missing -mtriple from llc tests, which were failing on non-x86
hosts.
Fixes: D106030
Reviewed By: arsenm, aaron.ballman
Differential Revision: https://reviews.llvm.org/D108718
David Green [Wed, 25 Aug 2021 19:10:18 +0000 (20:10 +0100)]
[ARM] Add Extra FpToIntSat tests.
This adds extra MVE vector fptosi.sat and fptoui.sat tests, along with
adding or adjusting the existing scalar tests to cover more
architectures and instruction combinations.
Tobias Gysi [Wed, 25 Aug 2021 18:43:41 +0000 (18:43 +0000)]
[mlir][linalg] Tune getTiedIndexingMap method (NFC).
Optimize the performance by using the range directly.
Reviewed By: benvanik
Differential Revision: https://reviews.llvm.org/D108715
Nico Weber [Tue, 24 Aug 2021 14:19:21 +0000 (10:19 -0400)]
[lld/COFF] Improve handling of the /manifestdependency: flag
If multiple /manifestdependency: flags are passed, they are
naively deduped, but after that each of them should have an
effect, instead of just the last one.
Also, /manifestdependency: flags are allowed in .drectve sections
(from `#pragma comment(linker, ...`). To make the interaction between
/manifestdependency: flags enabling manifest by default but
/manifest:no overriding this work, add an explict ManifestKind::Default
state to represent no explicit /manifest flag being passed.
To make /manifestdependency: flags from input file .drectve sections
work with /manifest:embed, delay embedded manifest emission until
after input files have been read.
Differential Revision: https://reviews.llvm.org/D108628
Richard Smith [Wed, 25 Aug 2021 18:01:45 +0000 (11:01 -0700)]
PR51105: look through ConstantExpr when looking for a braced string literal initialization.
Aart Bik [Wed, 25 Aug 2021 04:53:34 +0000 (21:53 -0700)]
[mlir][sparse] add sparse-dense cases to storage integration test
Reviewed By: grosul1
Differential Revision: https://reviews.llvm.org/D108685
Arthur Eubanks [Wed, 25 Aug 2021 18:29:41 +0000 (11:29 -0700)]
[test] Precommit some tests for invariant group icmps
Sanjay Patel [Wed, 25 Aug 2021 17:44:22 +0000 (13:44 -0400)]
[DAGCombiner] check uses more strictly on select-of-binop fold
There are 2 bugs here:
1. We were not checking uses of operand 2 (the false value of the select).
2. We were not checking for multiple uses of nodes that produce >1 result.
Correcting those is enough to avoid the crash in the reduced test based on:
https://llvm.org/PR51612
The additional use check on operand 0 (the condition value of the select)
should not strictly be necessary because we are only replacing one use
with another (whether it makes performance sense to do the transform with
that pattern is not clear). But as noted in the TODO, changing that
uncovers another bug.
Note: there's at least one more bug here - we aren't propagating EVTs
correctly, but I plan to fix that in another patch.
Arthur Eubanks [Wed, 25 Aug 2021 18:03:42 +0000 (11:03 -0700)]
[test] Use update_test_checks on llvm/test/Transforms/InstCombine/invariant.group.ll
Michael Kruse [Wed, 25 Aug 2021 17:06:42 +0000 (12:06 -0500)]
[test] Fix indention. NFC.
Michael Kruse [Wed, 25 Aug 2021 16:31:53 +0000 (11:31 -0500)]
[Preprocessor] Elide empty line(s) at start of file.
In -P mode, PrintPPOutputPPCallbacks::MoveToLine started at least one
newline if current and target line number mismatched. The method is also
called when entering a new file, be it the main file or an include file.
In this situation line numbers always almost mismatch, resulting in a
newline for each occurance even if no tokens have been printed
in-between.
Empty lines at the beginning of the output must be trimmed because it
may be parsed by scripts expecting the result to appear on the first
output line, as done by LibreOffice's configure script.
Fix by only emitting a newline if tokens have been printed so far using
the EmittedTokensOnThisLine flag. Also adding a test case of FileChanged
callbacks occuring with empty include files.
This fixes llvm.org/PR51616
Nick Desaulniers [Wed, 25 Aug 2021 17:18:13 +0000 (10:18 -0700)]
[Clang] add support for error+warning fn attrs
Add support for the GNU C style __attribute__((error(""))) and
__attribute__((warning(""))). These attributes are meant to be put on
declarations of functions whom should not be called.
They are frequently used to provide compile time diagnostics similar to
_Static_assert, but which may rely on non-ICE conditions (ie. relying on
compiler optimizations). This is also similar to diagnose_if function
attribute, but can diagnose after optimizations have been run.
While users may instead simply call undefined functions in such cases to
get a linkage failure from the linker, these provide a much more
ergonomic and actionable diagnostic to users and do so at compile time
rather than at link time. Users instead may be able use inline asm .err
directives.
These are used throughout the Linux kernel in its implementation of
BUILD_BUG and BUILD_BUG_ON macros. These macros generally cannot be
converted to use _Static_assert because many of the parameters are not
ICEs. The Linux kernel still needs to be modified to make use of these
when building with Clang; I have a patch that does so I will send once
this feature is landed.
To do so, we create a new IR level Function attribute, "dontcall" (both
error and warning boil down to one IR Fn Attr). Then, similar to calls
to inline asm, we attach a !srcloc Metadata node to call sites of such
attributed callees.
The backend diagnoses these during instruction selection, while we still
know that a call is a call (vs say a JMP that's a tail call) in an arch
agnostic manner.
The frontend then reconstructs the SourceLocation from that Metadata,
and determines whether to emit an error or warning based on the callee's
attribute.
Link: https://bugs.llvm.org/show_bug.cgi?id=16428
Link: https://github.com/ClangBuiltLinux/linux/issues/1173
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D106030
Akira Hatanaka [Wed, 25 Aug 2021 16:55:50 +0000 (09:55 -0700)]
[Sema][ObjC] Allow conversions between pointers to ObjC pointers and
pointers to structs
clang was just being conservative and trying to prevent users from
messing up the qualifier on the inner pointer type. Lifting this
restriction enables using some of the libc++ templates with ObjC pointer
arguments, which clang currently rejects.
rdar://
79018677
Differential Revision: https://reviews.llvm.org/D107021
Nathan Sidwell [Fri, 9 Jul 2021 14:57:10 +0000 (07:57 -0700)]
[X86] pr51000 in-register struct return tailcalling
In-register structure returns are not special, and handled by lowering
to multiple-value tuples. We can tail-call from non-sret fns to
structure-returning functions, except on i686 where the sret pointer
is callee-pop.
Differential Revision: https://reviews.llvm.org/D105807
Arthur Eubanks [Wed, 25 Aug 2021 17:12:51 +0000 (10:12 -0700)]
[gn build] Add missing dependency required by
832aae73
Stanislav Mekhanoshin [Tue, 3 Aug 2021 21:50:10 +0000 (14:50 -0700)]
[AMDGPU] Avoid assert for saved FP
With spilling into AGPRs enabled we cannot reliably predict
if we need to save FP or not. We may finally spill everything
into AGPRs and never touch stack. In this case we still may
save FP. This is deficiency but not an error, so avoid the
assert.
Differential Revision: https://reviews.llvm.org/D107404
Alexey Bataev [Wed, 25 Aug 2021 14:27:03 +0000 (07:27 -0700)]
[SLP]No need to schedule/check parent for extract{element/value} instruction.
The instruction extractelement/extractvalue are not required to
be scheduled since they only depend on the source vector/aggregate (with
constant indices), smae applies to the parent basic block checks.
Improves compile time and saves scheduling budget.
Differential Revision: https://reviews.llvm.org/D108703
Rong Xu [Wed, 25 Aug 2021 16:07:34 +0000 (09:07 -0700)]
[SampleFDO] Set ProfileIsFS bit properly from the internal option
We have "-profile-isfs" internal option for text, binary, and
compactbinary format (mostly for debug and test purpose). We
need to set the related flag in FunctionSamples so that ProfileIsFS
is written to the header in extbinary format.
Differential Revision: https://reviews.llvm.org/D108707
Wenlei He [Thu, 19 Aug 2021 04:09:49 +0000 (21:09 -0700)]
[CSSPGO] Use probe inline tree to track zero size fully optimized context for pre-inliner
This is a follow up diff for BinarySizeContextTracker to track zero size for fully optimized inlinee. When an inlinee is fully optimized away, we won't be able to get its size through symbolizing instructions, hence we will treat the corresponding context size as unknown. However by traversing the inlined probe forest, we know what're original inlinees regardless of optimization. If a context show up in inlined probes, but not during symbolization, we know that it's fully optimized away hence its size is zero instead of unknown. It should provide more accurate size cost estimation for pre-inliner to make better inline decisions in llvm-profgen.
Differential Revision: https://reviews.llvm.org/D108350
Kazu Hirata [Wed, 25 Aug 2021 15:59:12 +0000 (08:59 -0700)]
[Transforms] Remove SplitCriticalEdge (NFC)
These functions have not been in use for at least one year.
Kirill Stoimenov [Tue, 24 Aug 2021 20:23:47 +0000 (20:23 +0000)]
[asan] Implemented intrinsic for the custom calling convention similar used by HWASan for X86.
The implementation uses the int_asan_check_memaccess intrinsic to instrument the code. The intrinsic is replaced by a call to a function which performs the access check. The generated function names encode the input register name as a number using Reg - X86::NoRegister formula.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D107850
alex-t [Thu, 15 Jul 2021 16:43:56 +0000 (19:43 +0300)]
[AMDGPU] Divergence-driven compare operations instruction selection
Description: This change enables the compare operations to be selected to SALU/VALU form
dependent of the SDNode divergence flag.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D106079
Neumann Hon [Wed, 25 Aug 2021 15:24:02 +0000 (11:24 -0400)]
[SystemZ] [NFC] Replace SpecialRegisters field with a unique_ptr instead of a raw pointer.
This patch replaces the SpecialRegisters field with a unique_ptr instead of a raw pointer. This is better practice, and allows us to remove the definition of the dtor for the SystemZSubtarget class.
Reviewed By: uweigand, Kai
Differential Revision: https://reviews.llvm.org/D108639
Balazs Benics [Wed, 25 Aug 2021 14:47:13 +0000 (16:47 +0200)]
Revert "Revert "[analyzer] Ignore IncompleteArrayTypes in getStaticSize() for FAMs""
This reverts commit
df1f4e0cc6ec9a734aae41ffd48ee8b2007fcabb.
Now the test case explicitly specifies the target triple.
I decided to use x86_64 for that matter, to have a fixed
bitwidth for `size_t`.
Aside from that, relanding the original changes of:
https://reviews.llvm.org/D105184
Andrea Di Biagio [Wed, 25 Aug 2021 13:53:45 +0000 (14:53 +0100)]
[X86][SchedModel] Fix latency the Hi register write of MULX (PR51495).
Before this patch, WriteIMulH reported a latency value which is correct for the
RR variant of MULX, but not for the RM variant.
This patch fixes the issue by introducing a new WriteIMulHLd, which is meant to
be used only by the RM variant of MULX.
Differential Revision: https://reviews.llvm.org/D108701
Vyacheslav Zakharin [Tue, 24 Aug 2021 23:19:49 +0000 (16:19 -0700)]
[CodeExtractor] Preserve topological order for the return blocks.
Differential Revision: https://reviews.llvm.org/D108673
Jon Chesterfield [Wed, 25 Aug 2021 14:53:47 +0000 (15:53 +0100)]
[openmp] Delete unused grid value field, missed from D108380
Thomas Johnson [Tue, 24 Aug 2021 18:40:04 +0000 (14:40 -0400)]
[ARC] Add ADC (addition with carry) and SBC (subtraction with carry) instructions
Differential Revision: https://reviews.llvm.org/D108672
Balazs Benics [Wed, 25 Aug 2021 14:43:25 +0000 (16:43 +0200)]
Revert "[analyzer] Ignore IncompleteArrayTypes in getStaticSize() for FAMs"
This reverts commit
360ced3b8fd2cfb9f2a26deb739e6c381e98b9a5.
Nicholas Guy [Mon, 16 Aug 2021 13:10:21 +0000 (14:10 +0100)]
[AArch64] Generate SMOV in place of sext(fmov(...))
A single smov instruction is capable of moving from a vector register while performing
the sign-extend during said move, rather than each step being performed by separate instructions.
Differential Revision: https://reviews.llvm.org/D108633
Balazs Benics [Wed, 25 Aug 2021 14:12:17 +0000 (16:12 +0200)]
[analyzer] Ignore IncompleteArrayTypes in getStaticSize() for FAMs
Currently only `ConstantArrayType` is considered for flexible array
members (FAMs) in `getStaticSize()`.
However, `IncompleteArrayType` also shows up in practice as FAMs.
This patch will ignore the `IncompleteArrayType` and return Unknown
for that case as well. This way it will be at least consistent with
the current behavior until we start modeling them accurately.
I'm expecting that this will resolve a bunch of false-positives
internally, caused by the `ArrayBoundV2`.
Reviewed By: ASDenysPetrov
Differential Revision: https://reviews.llvm.org/D105184
Jon Chesterfield [Wed, 25 Aug 2021 14:09:46 +0000 (15:09 +0100)]
[libomptarget][amdgpu][nfc] Make grid value access match devicertl
Jeremy Morse [Wed, 25 Aug 2021 13:56:05 +0000 (14:56 +0100)]
[DebugInfo][InstrRef] Don't use instr-ref for unoptimised functions
InstrRefBasedLDV is marginally slower than VarlocBasedLDV when analysing
optimised code -- however, it's much slower when analysing code compiled
-O0.
To avoid this: don't use instruction referencing for -O0 functions. In the
"pure" case of unoptimised code, this won't really harm the debugging
experience because most variables won't have been promoted off the stack,
so can't go missing. It becomes more complicated when optimised code is
inlined into functions marked optnone; however these are rare, and as -O0
doesn't run many optimisations there should be little damage to the debug
experience as a result.
I've taken the opportunity to refactor testing for instruction-referencing
into a MachineFunction method, which seems the most appropriate place to
put it.
Differential Revision: https://reviews.llvm.org/D108585
Jon Chesterfield [Wed, 25 Aug 2021 13:57:50 +0000 (14:57 +0100)]
[libomptarget][amdgpu] Refactor debug printing
Move most debug printing in rtl.cpp behind DP() macro
Adjust the print output for gpu arch mismatch when the architectures match
Convert an assert into graceful failure
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D108562
Joe Nash [Tue, 24 Aug 2021 18:40:04 +0000 (14:40 -0400)]
[AMDGPU] Support global_atomic_fmin/max on gfx10
Makes patterns added for gfx90a usable with the gfx10 versions of the
insts.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D108654
Change-Id: I86167bf6b4823f975f74ccb619bd6190331ba16b
Andrea Di Biagio [Wed, 25 Aug 2021 13:15:17 +0000 (14:15 +0100)]
[X86][NFC] Pre-commit llvm-mca tests for PR51495.
WriteIMulH reports an incorrect latency for RM variants of MULX.
Louis Dionne [Tue, 24 Aug 2021 15:58:36 +0000 (11:58 -0400)]
[libc++] Assume that compilers support extended constexpr in C++14 mode
We don't support any compiler that doesn't support C++14 constexpr when
compiling in C++14 mode anymore, so we can just assume that we have C++14
extended constexpr when compiling in C++14 mode. This allows us to remove
some workarounds for older compilers.
Differential Revision: https://reviews.llvm.org/D108638
Florian Hahn [Wed, 25 Aug 2021 10:58:49 +0000 (11:58 +0100)]
[LoopPeel] Allow peeling with multiple unreachable-terminated exit blocks.
Support for peeling with multiple exit blocks was added in D63921/
77bb3a486fa6.
So far it has only been enabled for loops where all non-latch exits are
'de-optimizing' exits (D63923). But peeling of multi-exit loops can be
highly beneficial in other cases too, like if all non-latch exiting
blocks are unreachable.
The motivating case are loops with runtime checks, like the C++ example
below. The main issue preventing vectorization is that the invariant
accesses to load the bounds of B is conditionally executed in the loop
and cannot be hoisted out. If we peel off the first iteration, they
become dereferenceable in the loop, because they must execute before the
loop is executed, as all non-latch exits are terminated with
unreachable. This subsequently allows hoisting the loads and runtime
checks out of the loop, allowing vectorization of the loop.
int sum(std::vector<int> *A, std::vector<int> *B, int N) {
int cost = 0;
for (int i = 0; i < N; ++i)
cost += A->at(i) + B->at(i);
return cost;
}
This gives a ~20-30% increase of score for Geekbench5/HDR on AArch64.
Note that this requires a follow-up improvement to the peeling cost
model to actually peel iterations off loops as above. I will share that
shortly.
Also, peeling of multi-exits might be beneficial for exit blocks with
other terminators, but I would like to keep the scope limited to known
high-reward cases for now.
I removed the option to disable peeling for multi-deopt exits because
the code is more general now. Alternatively, the option could also be
generalized, but I am not sure if there's much value in the option?
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D108108
Dawid Jurczak [Wed, 25 Aug 2021 11:13:18 +0000 (13:13 +0200)]
[LoopIdiom] Don't transform loop into memmove when load from body has more than one use
This change fixes issue found by Markus: https://reviews.llvm.org/rG11338e998df1
Before this patch following code was transformed to memmove:
for (int i = 15; i >= 1; i--) {
p[i] = p[i-1];
sum += p[i-1];
}
However load from p[i-1] is used not only by store to p[i] but also by sum computation.
Therefore we cannot emit memmove in loop header.
Differential Revision: https://reviews.llvm.org/D107964
Jan Kuehle [Wed, 25 Aug 2021 12:11:43 +0000 (14:11 +0200)]
[clang-format] Support TypeScript override keyword
TypeScript 4.3 added a new "override" keyword for class members. This
lets clang-format know about it, so it can format code using it
properly.
Reviewed By: krasimir
Differential Revision: https://reviews.llvm.org/D108692
Peilin Guo [Wed, 25 Aug 2021 11:31:00 +0000 (19:31 +0800)]
[DAGCombine] Check the legality of the index of EXTRACT_SUBVECTOR
For ISD::EXTRACT_SUBVECTOR, its second operand must be a constant
multiple of the known-minimum vector length of the result type.
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D107795
Jeremy Morse [Wed, 25 Aug 2021 11:04:59 +0000 (12:04 +0100)]
[DebugInfo][InstrRef] Avoid stack-slot-coloring changing codegen due to DI
Stack slot colouring adds "weight" to slots if a non-dbg-value instruction
refers to it. This, unfortunately, means that DBG_PHI instructions can have
an effect on codegen. The fix is very simple, replace isDebugValue with
isDebugInstr.
The regression test contains a scenario that reproduces this problem; I've
represented both normal-debug mode and instr-ref debug mode instructions
in comment lines prefixed with AAAAAA and BBBBBB, and un-comment them with
sed to test that the two different modes produce the same behaviour.
Differential Revision: https://reviews.llvm.org/D108627
River Riddle [Wed, 25 Aug 2021 09:26:56 +0000 (09:26 +0000)]
[mlir][AttrTypeGen] Add support for specifying a "accessor" type of a parameter
This allows for using a different type when accessing a parameter than the
one used for storage. This allows for returning parameters by reference,
enables using more optimized/convient reference results, and more.
Differential Revision: https://reviews.llvm.org/D108593
River Riddle [Wed, 25 Aug 2021 09:26:39 +0000 (09:26 +0000)]
[mlir] Update DialectAsmParser::parseString to use std::string instead of StringRef
This allows for parsing strings that have escape sequences, which require constructing
a string (as they can't be represented by looking at the Token contents directly).
Differential Revision: https://reviews.llvm.org/D108589
River Riddle [Wed, 25 Aug 2021 09:26:23 +0000 (09:26 +0000)]
[mlir] Move the Operation use iteration utilities to ResultRange
This allows for iterating and interacting with the uses of a specific subset of
results as opposed to just the full range.
Differential Revision: https://reviews.llvm.org/D108586
Jean Perier [Wed, 25 Aug 2021 09:15:22 +0000 (11:15 +0200)]
[flang] Implement Posix version of DATE_AND_TIME runtime
Use gettimeofday and localtime_r to implement DATE_AND_TIME intrinsic.
The Windows version fallbacks to the "no date and time information
available" defined by the standard (strings set to blanks and values to
-HUGE).
The implementation uses an ifdef between windows and the rest because
from my tests, the SFINAE approach leads to undeclared name bogus errors
with clang 8 that seems to ignore failure to instantiate is not an error
for the function names (i.e., it understands it should not instantiate
the version using gettimeofday if it is not there, but still yields an
error that it is not declared on the spot where it is called in the
uninstantiated version).
Differential Revision: https://reviews.llvm.org/D108622
Jan Svoboda [Wed, 25 Aug 2021 08:56:15 +0000 (10:56 +0200)]
[clang][deps] Ensure deterministic order of TU '-fmodule-file=' arguments
Translation units with multiple direct modular dependencies trigger a non-deterministic ordering in `clang-scan-deps`. This boils down to usage of `std::unordered_map`, which gets replaced by `std::map` in this patch.
Depends on D103526.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D103807
Rosie Sumpter [Tue, 24 Aug 2021 16:04:35 +0000 (17:04 +0100)]
[LoopFlatten] Add statistic for number of loops flattened. NFC
Differential Revision: https://reviews.llvm.org/D108644
Tres Popp [Mon, 23 Aug 2021 17:24:12 +0000 (19:24 +0200)]
[mlir] Add assertion in NamedAttrList to prevent adding null attributes
Differential Revision: https://reviews.llvm.org/D108570
LLVM GN Syncbot [Wed, 25 Aug 2021 09:02:08 +0000 (09:02 +0000)]
[gn build] Port
48958d02d294
Daniil Fukalov [Mon, 23 Aug 2021 20:50:19 +0000 (23:50 +0300)]
[NFC][AMDGPU] Reduce includes dependencies.
1. Splitted out some parts of R600 target to separate modules/headers.
2. Reduced some include lists in headers.
3. Found and fixed issue with override `GCNTargetMachine::getSubtargetImpl()`
and `R600TargetMachine::getSubtargetImpl()` had different return value type
than base class.
4. Minor forward declarations cleanup.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D108596
Jan Svoboda [Wed, 25 Aug 2021 08:36:03 +0000 (10:36 +0200)]
[clang][deps] Use top-level modules as precompiled dependencies
The `ASTReader` populates `Module::PresumedModuleMapFile` only for top-level modules, not submodules. To avoid generating empty `-fmodule-map-file=` arguments, make discovered modules depend on top-level precompiled modules. The granularity of submodules is not important here.
The documentation of `Module::PresumedModuleMapFile` says this field is non-empty only when building from preprocessed source. This means there can still be cases where the dependency scanner generates empty `-fmodule-map-file=` arguments. That's being addressed in separate patch: D108544.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D108647
serge-sans-paille [Wed, 18 Aug 2021 21:48:14 +0000 (23:48 +0200)]
Have lit preserve SOURCE_DATE_EPOCH
This environment variable has been standardized for reproducible builds. Setting
it can help to have reproducible tests too, so keep it as part of the testing
env when set.
See https://reproducible-builds.org/docs/source-date-epoch/
Differential Revision: https://reviews.llvm.org/D108332
Jan Svoboda [Wed, 25 Aug 2021 08:14:15 +0000 (10:14 +0200)]
[clang][deps] Collect precompiled deps from submodules too
In this patch, the dependency scanner starts collecting precompiled dependencies from all encountered submodules, not only from top-level modules.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D108540
Florian Mayer [Mon, 23 Aug 2021 13:03:16 +0000 (14:03 +0100)]
[hwasan] do not check if freed pointer belonged to allocator.
In that case it is very likely that there will be a tag mismatch anyway.
We handle the case that the pointer belongs to neither of the allocators
by getting a nullptr from allocator.GetBlockBegin.
Reviewed By: hctim, eugenis
Differential Revision: https://reviews.llvm.org/D108383
Konstantin Schwarz [Tue, 24 Aug 2021 13:13:39 +0000 (15:13 +0200)]
[GlobalISel] Do not generate illegal G_SEXTLOADs after legalization
The sext_inreg_of_load combine did not have the isLegalOrBeforeLegalizer check,
leading to the generation of potentially illegal G_SEXTLOADs when run after legalization.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D108626
Jonas Hahnfeld [Fri, 20 Aug 2021 11:28:37 +0000 (13:28 +0200)]
[CUDA] Fix static device variables with -fgpu-rdc
NVPTX does not allow dots in the identifier, so ptxas errors out with
fatal : Parsing error near '.static': syntax error
because it parses .static as a directive. Avoid this problem by using
two underscores, similar to what OpenMP does for outlined functions.
Differential Revision: https://reviews.llvm.org/D108456
Yi Kong [Tue, 24 Aug 2021 09:06:08 +0000 (17:06 +0800)]
[clang] Don't generate warn-stack-size when the warning is ignored
8ace12130526 introduced a regression for code that explicitly ignores the
-Wframe-larger-than= warning. Make sure we don't generate the
warn-stack-size attribute for that case.
Differential Revision: https://reviews.llvm.org/D108686
Douglas Yung [Wed, 25 Aug 2021 05:22:16 +0000 (22:22 -0700)]
Add "REQUIRES: arm-registered-target" line to test added in D108603.
This should fix the test failure on the PS4 build bot.
Vang Thao [Fri, 13 Aug 2021 04:39:32 +0000 (21:39 -0700)]
[MachineCopyPropagation] Check CrossCopyRegClass for cross-class copys
On some AMDGPU subtargets, copying to and from AGPR registers using another
AGPR register is not possible. A intermediate VGPR register is needed for AGPR
to AGPR copy. This is an issue when machine copy propagation forwards a
COPY $agpr, replacing a COPY $vgpr which results in $agpr = COPY $agpr. It is
removing a cross class copy that may have been optimized by previous passes and
potentially creating an unoptimized cross class copy later on.
To avoid this issue, check CrossCopyRegClass if a different register class will
be needed for the copy. If so then avoid forwarding the copy when the
destination does not match the desired register class and if the original copy
already matches the desired register class.
Issue seen while attempting to optimize another AGPR to AGPR issue:
Live-ins: $agpr0
$vgpr0 = COPY $agpr0
$agpr1 = V_ACCVGPR_WRITE_B32 $vgpr0
$agpr2 = COPY $vgpr0
$agpr3 = COPY $vgpr0
$agpr4 = COPY $vgpr0
After machine-cp:
$vgpr0 = COPY $agpr0
$agpr1 = V_ACCVGPR_WRITE_B32 $vgpr0
$agpr2 = COPY $agpr0
$agpr3 = COPY $agpr0
$agpr4 = COPY $agpr0
Machine-cp propagated COPY $agpr0 to replace $vgpr0 creating 3 AGPR to AGPR
copys. Later this creates a cross-register copy from AGPR->VGPR->AGPR for each
copy when the prior VGPR->AGPR copy was already optimal.
Reviewed By: lkail, rampitec
Differential Revision: https://reviews.llvm.org/D108011
Lang Hames [Wed, 25 Aug 2021 03:31:06 +0000 (13:31 +1000)]
[JITLink][MachO] Add more detail to error message.
Lang Hames [Wed, 25 Aug 2021 01:18:00 +0000 (11:18 +1000)]
[ORC] Fix typo in debugging output
Carl Ritson [Wed, 25 Aug 2021 03:11:51 +0000 (12:11 +0900)]
[DAGCombine] Pre-commit test for D108619
Fangrui Song [Wed, 25 Aug 2021 03:14:02 +0000 (20:14 -0700)]
[InstrProfiling] Keep profd non-private for non-renamable comdat functions
The NS==0 condition used by D103717 missed a corner case: if the current copy
does not have a hash suffix (e.g. weak_odr), a copy with value profiling (with a
different CFG) may exist. This is super rare, but is possible with pre-inlining
PGO instrumentation (which can make a weak_odr function inlines its callees
differently, sometimes with value profiling while sometimes without).
If the current copy with private profd is prevailing, the non-prevailing copy
may get an undefined symbol if a caller inlining the non-prevailing function
references its profd. If the other copy with non-private profd is prevailing,
the current copy may cause a "relocation to discarded section" linker error.
The fix is straightforward: just keep non-private profd in such a `DataReferencedByCode` case.
With this change, a stage 2 (`-DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_BUILD_INSTRUMENTED=IR`)
clang is 0.08% larger (
172431496/
172286720-1).
`stat -c %s **/*.o | awk '{s+=$1}END{print s}' is 0.026% larger.
The majority of D103717's benefits remains.
Reviewed By: xur
Differential Revision: https://reviews.llvm.org/D108432
Richard Smith [Wed, 25 Aug 2021 01:34:38 +0000 (18:34 -0700)]
PR48030: Fix COMDAT-related linking problem with C++ thread_local static data members.
Previously when emitting a C++ guarded initializer, we tried to work out what
the enclosing function would be used for and added it to the COMDAT containing
the variable if we thought that doing so would be correct. But this was done
from a context in which we didn't -- and realistically couldn't -- correctly
infer how the enclosing function would be used.
Instead, add the initialization function to a COMDAT from the code that
creates it, in the case where it makes sense to do so: when we know that
the one and only reference to the initialization function is in
@llvm.global.ctors and that reference is in the same COMDAT.
Reviewed By: rjmccall
Differential Revision: https://reviews.llvm.org/D108680
Thomas Lively [Wed, 25 Aug 2021 02:44:03 +0000 (19:44 -0700)]
[WebAssembly] Fix some UB from
ca541aa319cd
Fangrui Song [Wed, 25 Aug 2021 02:16:07 +0000 (19:16 -0700)]
Revert D108432 "[InstrProfiling] Keep profd non-private for non-renamable comdat functions"
This reverts commit
f653beea88d2684cdc8117e662b321ba04666771.
It broke Windows coverage-inline.cpp because link.exe has a limitation
that external symbols in IMAGE_COMDAT_SELECT_ASSOCIATIVE don't work.
It essentially dropped the previous size optimization for coverage
because coverage doesn't rename comdat by default.
Needs more investigation what we should do.
Rob Suderman [Wed, 25 Aug 2021 01:23:21 +0000 (18:23 -0700)]
[mlir][tosa] Quantized tosa.avg_pool2d lowering to linalg
Includes the quantized version of average pool lowering to linalg dialect.
This includes a lit test for the transform. It is not 100% correct as the
multiplier / shift should be done in i64 however this is negligable rounding
difference.
Reviewed By: NatashaKnk
Differential Revision: https://reviews.llvm.org/D108676
Rob Suderman [Wed, 25 Aug 2021 01:14:47 +0000 (18:14 -0700)]
[mlir][tosa] Table did not apply offset before extract on i8 input
Lowering to table was incorrect as it did not apply a 128 offset before
extracting the value from the table. Fixed and correct tensor length on input
table.
Reviewed By: NatashaKnk
Differential Revision: https://reviews.llvm.org/D108436
Matthias Springer [Wed, 25 Aug 2021 01:28:01 +0000 (10:28 +0900)]
[mlir][SCF] Generalize AffineMinSCFCanonicalization to min/max ops
* Add support for affine.max ops to SCF loop peeling pattern.
* Add support for affine.max ops to `AffineMinSCFCanonicalizationPattern`.
* Rename `AffineMinSCFCanonicalizationPattern` to `AffineOpSCFCanonicalizationPattern`.
* Rename `AffineMinSCFCanonicalization` pass to `SCFAffineOpCanonicalization`.
Differential Revision: https://reviews.llvm.org/D108009
wren romano [Wed, 25 Aug 2021 01:29:05 +0000 (18:29 -0700)]
[mlir][sparse] Correcting the use of emplace_back
The emplace commands are variadic and should take all the constructor arguments directly, since they implicitly call the constructor themselves in order to avoid the cost of constructing and then moving/copying temporaries.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D108670
Heejin Ahn [Tue, 17 Aug 2021 06:30:02 +0000 (23:30 -0700)]
[WebAssembly] Use SSAUpdaterBulk in LowerEmscriptenSjLj
We update SSA in two steps in Emscripten SjLj:
1. Rewrite uses of `setjmpTable` and `setjmpTableSize` variables and
place `phi`s where necessary, which are updated where we call
`saveSetjmp`.
2. Do a whole function level SSA update for all variables, because we
split BBs where `setjmp` is called and there are possibly variable
uses that are not dominated by a def.
(See https://github.com/llvm/llvm-project/blob/
955b91c19c00ed4c917559a5d66d14c669dde2e3/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp#L1314-L1324)
We have been using `SSAUpdater` to do this, but `SSAUpdaterBulk` class
was added after this pass was first created, and for the step 2 it looks
like a better alternative with a possible performance benefit. Not sure
the author is aware of it, but `SSAUpdaterBulk` seems to have a
limitation: it cannot handle a use within the same BB as a def but
before it. For example:
```
... = %a + 1
%a = foo();
```
or
```
%a = %a + 1
```
The uses `%a` in RHS should be rewritten with another SSA variable of
`%a`, most likely one generated from a `phi`. But `SSAUpdaterBulk`
thinks all uses of `%a` are below the def of `%a` within the same BB.
(`SSAUpdater` has two different functions of rewriting because of this:
`RewriteUse` and `RewriteUseAfterInsertions`.) This doesn't affect our
usage in the step 2 because that deals with possibly non-dominated uses
by defs after block splitting. But it does in the step 1, which still
uses `SSAUpdater`.
But this CL also simplifies the step 1 by using `make_early_inc_range`,
removing the need to advance the iterator before rewriting a use.
This is NFC; the test changes are just the order of PHI nodes.
Reviewed By: dschuff
Differential Revision: https://reviews.llvm.org/D108583
Rob Suderman [Wed, 25 Aug 2021 01:08:07 +0000 (18:08 -0700)]
[mlir][tosa] Fix conv/depthwise conv padding for quantized values
When padding quantized operations, the padding needs to equal the zero point
of the input value. Corrected the pass to change the padding value if quantized.
Reviewed By: NatashaKnk
Differential Revision: https://reviews.llvm.org/D108440
Heejin Ahn [Mon, 23 Aug 2021 10:55:55 +0000 (03:55 -0700)]
[WebAssembly] Add Wasm SjLj option support for clang
This adds support for Wasm SjLj in clang. Also this sets the new
`-mllvm -wasm-enable-eh` option for Wasm EH.
Note there is a little unfortunate inconsistency there: Wasm EH is
enabled by a clang option `-fwasm-exceptions`, which sets
`-mllvm -wasm-enable-eh` in the backend options. It also sets
`-exception-model=wasm` but this is done in the common code.
Wasm SjLj doesn't have a clang-level option like `-fwasm-exceptions`.
`-fwasm-exceptions` was added because each exception model has its
corresponding `-f***-exceptions`, but I'm not sure if adding a new
option like `-fwasm-sjlj` or something is a good idea.
So the current plan is Emscripten sets `-mllvm -wasm-enable-sjlj` if
Wasm SJLj is enabled in its settings.js, as it does for Emscripten
EH/SjLj (it sets `-mllvm -enable-emscripten-cxx-exceptions` for
Emscripten EH and `-mllvm -enable-emscripten-sjlj` for Emscripten SjLj).
And setting this enables the exception handling feature, and also sets
`-exception-model=wasm`, but this time this is not done in the common
code so we do it ourselves.
Also note that other exception models have 1-to-1 correspondance with
their `-f***-exceptions` flag and their `-exception-model=***` flag, but
because we use `-exception-model=wasm` also for Wasm SjLj while
`-fwasm-exceptions` still means Wasm EH, there is also a little
inconsistency there, but I think it is manageable.
Also this adds various error checking and tests.
Reviewed By: dschuff
Differential Revision: https://reviews.llvm.org/D108582
Ed Maste [Mon, 23 Aug 2021 16:12:43 +0000 (12:12 -0400)]
[clang] allow -fstack-clash-protection on FreeBSD
-fstack-clash-protection was added in Clang commit
e67cbac81211 but was
enabled only on Linux. Allow it on FreeBSD as well, as it works fine.
Reviewed By: serge-sans-paille
Differential Revision: https://reviews.llvm.org/D108571
Nico Weber [Wed, 25 Aug 2021 01:01:20 +0000 (21:01 -0400)]
[gn build] Manually port
dbed061b more
Heejin Ahn [Sat, 7 Aug 2021 02:35:18 +0000 (19:35 -0700)]
[WebAssembly] Tidy up EH/SjLj options
This CL is small, but the description can be a little long because I'm
trying to sum up the status quo for Emscripten/Wasm EH/SjLj options.
First, this CL adds an option for Wasm SjLj (`-wasm-enable-sjlj`), which
handles SjLj using Wasm EH. The implementation for this will be added as
a followup CL, but this adds the option first to do error checking.
This also adds an option for Wasm EH (`-wasm-enable-eh`), which has been
already implemented. Before we used `-exception-model=wasm` as the same
meaning as enabling Wasm EH, but after we add Wasm SjLj, it will be
possible to use Wasm EH instructions for Wasm SjLj while not enabling
EH, so going forward, to use Wasm EH, `opt` and `llc` will need this
option. This only affects `opt` and `llc` command lines and does not
affect Emscripten user interface.
Now we have two modes of EH (Emscripten/Wasm) and also two modes of SjLj
(also Emscripten/Wasm). The options corresponding to each of are:
- Emscripten EH: `-enable-emscripten-cxx-exceptions`
- Emscripten SjLj: `-enable-emscripten-sjlj`
- Wasm EH: `-wasm-enable-eh -exception-model=wasm`
`-mattr=+exception-handling`
- Wasm SjLj: `-wasm-enable-sjlj -exception-model=wasm`
`-mattr=+exception-handling`
The reason Wasm EH/SjLj's options are a little complicated are
`-exception-model` and `-mattr` are common LLVM options ane not under
our control. (`-mattr` can be omitted if it is embedded within the
bitcode file.)
And we have the following rules of the option composition:
- Emscripten EH and Wasm EH cannot be turned on at the same itme
- Emscripten SjLj and Wasm SjLj cannot be turned on at the same time
- Wasm SjLj should be used with Wasm EH
Which means we now allow these combinations:
- Emscripten EH + Emscripten SjLj: the current default in `emcc`
- Wasm EH + Emscripten SjLj:
This is allowed, but only as an interim step in which we are testing
Wasm EH but not yet have a working implementation of Wasm SjLj. This
will error out (D107687) in compile time if `setjmp` is called in a
function in which Wasm exception is used.
- Wasm EH + Wasm SjLj:
This will be the default mode later when using Wasm EH. Currently Wasm
SjLj implementation doesn't exist, so it doesn't work.
- Emscripten EH + Wasm SjLj will not work.
This CL moves these error checking routines to
`WebAssemblyPassConfig::addIRPasses`. Not sure if this is an ideal place
to do this, but I couldn't find elsewhere. Currently some checking is
done within LowerEmscriptenEHSjLj, but these checks only run if
LowerEmscriptenEHSjLj runs so it may not run when Wasm EH is used. This
moves that to `addIRPasses` and adds some more checks.
Currently LowerEmscriptenEHSjLj pass is responsible for Emscripten EH
and Emscripten SjLj. Wasm EH transformations are done in multiple
places, including WasmEHPrepare, LateEHPrepare, and CFGStackify. But in
the followup CL, LowerEmscriptenEHSjLj pass will be also responsible for
a part of Wasm SjLj transformation, because WasmSjLj will also be using
several Emscripten library functions, and we will be sharing more than
half of the transformation to do that between Emscripten SjLj and Wasm
SjLj.
Currently we have `-enable-emscripten-cxx-exceptions` and
`-enable-emscripten-sjlj` but these only work for `llc`, because for
`llc` we feed these options to the pass but when we run the pass using
`opt` the pass will be created with no options and the default options
will be used, which turns both Emscripten EH and Emscripten SjLj on.
Now we have one more SjLj option to care for, LowerEmscriptenEHSjLj pass
needs a finer way to control these options. This CL removes those
default parameters and make LowerEmscriptenEHSjLj pass read directly
from command line options specified. So if we only run
`opt -wasm-lower-em-ehsjlj`, currently both Emscripten EH and Emscripten
SjLj will run, but with this CL, none will run unless we additionally
pass `-enable-emscripten-cxx-exceptions` or `-enable-emscripten-sjlj`,
or both. This does not affect users; this only affects our `opt` tests
because `emcc` will not call either `opt` or `llc`. As a result of this,
our existing Emscripten EH/SjLj tests gained one or both of those
options in their `RUN` lines.
Reviewed By: dschuff
Differential Revision: https://reviews.llvm.org/D107685
Shimin Cui [Wed, 25 Aug 2021 00:47:33 +0000 (20:47 -0400)]
[GlobalOpt] Fix the assert for null check of global value
This is to fix the reported assert - https://bugs.llvm.org/show_bug.cgi?id=51608.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D108674
Chenggang Zhao [Wed, 25 Aug 2021 00:41:35 +0000 (00:41 +0000)]
[mlir][docs] A friendlier improvement for the Toy tutorial chapter 4.
Add notes for discarding private-visible functions in the Toy tutorial chapter 4.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D108026
Jon Chesterfield [Wed, 25 Aug 2021 00:26:45 +0000 (01:26 +0100)]
[libomptarget][amdgpu] Fix debug build from D104696
Thomas Lively [Wed, 25 Aug 2021 00:24:03 +0000 (17:24 -0700)]
[WebAssembly] Fix up out-of-range BUILD_VECTOR lane constants
Fixes PR51605 in which a DAG combine and legalization sequence generated
out-of-range constants in BUILD_VECTOR lanes. In the v16i8 case, the constants
were 255, which would be in range if DAG ISel used unsigned constants, but it is
out of range because DAG ISel uses signed constants.
Differential Revision: https://reviews.llvm.org/D108669
Vitaly Buka [Tue, 24 Aug 2021 21:43:59 +0000 (14:43 -0700)]
[msan] Unpoison trailing nullptr in wordexp interceptor
Differential Revision: https://reviews.llvm.org/D108665
Vitaly Buka [Wed, 25 Aug 2021 00:11:51 +0000 (17:11 -0700)]
[msan] Don't EXPECT_POISONED beyond the we_wordv
Partially reverts commit
629411d799223d7bc7aad98661b1443a4788c0c5.
EXPECT_POISONED argument is outside of the allocation so we can't
assume the state of shadow there.
Richard Smith [Fri, 23 Jul 2021 00:52:16 +0000 (17:52 -0700)]
Extend diagnostic for out of date AST input file.
If the size has changed, list the old and new sizes; if the mtime has
changed, list the old and new mtimes (as raw time_t values).
Matthias Springer [Tue, 24 Aug 2021 23:47:05 +0000 (08:47 +0900)]
[mlir][linalg] Replace AffineMinSCFCanonicalizationPattern with SCF reimplementation
Use the new canonicalization pattern in the SCF dialect.
Differential Revision: https://reviews.llvm.org/D107732
Vitaly Buka [Tue, 24 Aug 2021 23:23:50 +0000 (16:23 -0700)]
[msan] Fix wordexp after D108646
I introduced this bug reformating the patch before commit.
Amara Emerson [Tue, 24 Aug 2021 23:08:08 +0000 (16:08 -0700)]
Revert "[AArch64][GlobalISel] Don't contract cross-bank copies into truncating stores."
This reverts commit
67bf3ac7446bd8ba16bb5ef82fa9f28a848616da.
The reason is that this change is now superseded by
04fb9b729a53 which fixes the
underlying problem in the selector. Now it's fine to generate truncating FP stores
since the selector code will just generate subreg copies to handle them.
Aart Bik [Tue, 24 Aug 2021 22:18:29 +0000 (15:18 -0700)]
[mlir][sparse] enable a few vectorized runs in integration tests
Recent changes outside sparse compiler exposed the requirement of running a
new pass (lower-affine) but this only became apparent with private testing.
By adding some vectorized runs to integration test, we will detect the need
for such changes earlier and also widen codegen coverage of course.
Reviewed By: gussmith23
Differential Revision: https://reviews.llvm.org/D108667
Amara Emerson [Tue, 24 Aug 2021 20:56:01 +0000 (13:56 -0700)]
[AArch64][GlobalISel] Fix incorrect handling of fp truncating stores.
When the tablegen patterns fail to select a truncating scalar FPR store,
our manual selection code also failed to handle it silently, trying to
generate an invalid copy. Fix this by adding support in the manual code
to generate a proper subreg copy before selecting a non-truncating store.
Fangrui Song [Tue, 24 Aug 2021 22:59:35 +0000 (15:59 -0700)]
[InstrProfiling] Keep profd non-private for non-renamable comdat functions
The NS==0 condition used by D103717 missed a corner case: if the current copy
does not have a hash suffix (e.g. weak_odr), a copy with value profiling (with a
different CFG) may exist. This is super rare, but is possible with pre-inlining
PGO instrumentation (which can make a weak_odr function inlines its callees
differently, sometimes with value profiling while sometimes without).
If the current copy with private profd is prevailing, the non-prevailing copy
may get an undefined symbol if a caller inlining the non-prevailing function
references its profd. If the other copy with non-private profd is prevailing,
the current copy may cause a "relocation to discarded section" linker error.
The fix is straightforward: just keep non-private profd in this case.
With this change, a stage 2 (`-DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_BUILD_INSTRUMENTED=IR`)
clang is 0.08% larger (
172431496/
172286720-1).
`stat -c %s **/*.o | awk '{s+=$1}END{print s}' is 0.026% larger.
The majority of D103717's benefits remains.
Reviewed By: xur
Differential Revision: https://reviews.llvm.org/D108432
Matthias Springer [Tue, 24 Aug 2021 12:21:12 +0000 (21:21 +0900)]
[mlir][scf] Add general affine.min canonicalization pattern
This canonicalization simplifies affine.min operations inside "for loop"-like operations (e.g., scf.for and scf.parallel) based on two invariants:
* iv >= lb
* iv < lb + step * ((ub - lb - 1) floorDiv step) + 1
This commit adds a new pass `canonicalize-scf-affine-min` (instead of being a canonicalization pattern) to avoid dependencies between the Affine dialect and the SCF dialect.
Differential Revision: https://reviews.llvm.org/D107731