- Sep 14, 2020
-
-
Sjoerd Meijer authored
This adds additional checks for the original scalar loop tripcount value, i.e. get.active.lane.mask second argument, and perform several sanity checks to see if it is of the form that we expect similarly like we already do for the IV which is the first argument of get.active.lane. Differential Revision: https://reviews.llvm.org/D86074
-
David Sherwood authored
The function LoopIdiomRecognize::isLegalStore looks for stores in loops that could be transformed into memset or memcpy. However, the algorithm currently requires that we know how big the store is at runtime, i.e. that the store size will not overflow an unsigned integer. For scalable vectors we cannot guarantee this so I have changed the code to bail out for now. In addition, even if we add a way to query the maximum value of vscale in future we will still need to update the algorithm to cope with non-constant strides. The additional cost associated with calculating the memset and memcpy arguments will need to be taken into account as well. This patch also fixes up an implicit TypeSize -> uint64_t cast, thereby removing a warning. I've added tests here showing a fixed width vector loop being transformed into memcpy, and a scalable vector loop remaining unchanged: Transforms/LoopIdiom/memcpy-vectors.ll Differential Revision: https://reviews.llvm.org/D87439
-
Petar Avramovic authored
Check for NoNaNsFPMath function attribute in isKnownNeverSNaN. Function attributes are in held in 'TargetMachine.Options'. Among other things, this allows selection of some patterns imported in D87351 since G_FCANONICALIZE is not generated when isKnownNeverSNaN returns true in lowerFMinNumMaxNum. However we notice some incorrect results since function attributes are not correctly written in TargetMachine.Options when next function is processed. Take a look at @v_test_no_global_nnans_med3_f32_pat0_srcmod0, it has "no-nans-fp-math"="false" but TargetMachine.Options still has it set to true since first function in test file had this attribute set to true. This will be fixed in D87511. Differential Revision: https://reviews.llvm.org/D87456
-
Petar Avramovic authored
The "name" of a non-leaf complex pattern (MY_PAT $op1, $op2) is "MY_PAT:op1:op2" and the ones with same "name" represent same operand. Add 'same operand check' for this case. Differential Revision: https://reviews.llvm.org/D87351
-
Petar Avramovic authored
GlobalIsel emitter does not import patterns where complex sub-operand of a non-leaf complex pattern is referenced more then once. Multiple references of complex patterns with same name and same sub-operands represent the same operand. Document this with a test.
-
Simon Pilgrim authored
-
Sam McCall authored
-
Simon Pilgrim authored
avx512-reduceIntrin.c wasn't bothering with the exhaustive alloca/store/load/bitcast checks and avx512-reduceMinMaxIntrin.c shouldn't need to either. This makes it a lot easier to maintain as the update script still doesn't work properly on x86 targets
-
Kadir Cetinkaya authored
Differential Revision: https://reviews.llvm.org/D87501
-
Jeremy Morse authored
Add a DBG_INSTR_REF instruction and a "debug instruction number" field to MachineInstr. The two allow variable values to be specified by identifying where the value is computed, rather than the register it lies in, like so: %0 = fooinst, debug-instr-number 1 [...] DBG_INSTR_REF 1, 0 See the original RFC for motivation: http://lists.llvm.org/pipermail/llvm-dev/2020-February/139440.html This patch is NFCI; it only adds fields and other boiler plate. Differential Revision: https://reviews.llvm.org/D85741
-
LLVM GN Syncbot authored
-
Sam McCall authored
Summary: This is considerably terser than the makeStringError and friends, and avoids verbosity cliffs that discourage adding log information. It follows the syntax used in log/elog/vlog/dlog that have been successful. The main caveats are: - it's strictly out-of-place in logger.h, though kind of fits thematically and in implementation - it claims the "error" identifier, which seems a bit too opinionated to put higher up in llvm I've updated some users of StringError mostly at random - there are lots more mechanical changes but I'd like to get this reviewed before making them all. Reviewers: kbobyrev, hokein Subscribers: mgorny, ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D83419
-
Petar Avramovic authored
Predicates with 'let PredicateCodeUsesOperands = 1' want to examine matched operands. When we encounter predicate code that uses operands, analyze its named operand arguments and create a map between argument index and name. Later, when leaf node with name is encountered, emit GIM_RecordNamedOperand that will store that operand at its argument index in operand list. This operand list will be an argument to c++ code of the predicate. Differential Revision: https://reviews.llvm.org/D87285
-
David Stenberg authored
This fixes PR47297. When ProcessBlock() was able to constant fold the terminator's condition, but not do any more transformations, the function would return false, which would lead to the JumpThreading pass returning an incorrect modified status. This patch makes so that ProcessBlock() returns true in such cases. This will trigger an unnecessary invocation of ProcessBlock() in such cases, but this should be rare to occur. This was caught using the check introduced by D80916. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D87392
-
Kamil Rytarowski authored
-
Jay Foad authored
This was causing random minor codegen differences in shaders compiled with the AMDGPU backend. Differential Revision: https://reviews.llvm.org/D87548
-
Simon Wallis authored
Treating an SoImm offset as a multiple of 4 between -1020 and 1020 mis-handles the second of a pair of 16-bit constants where the offset is a multiple of 2 but not a multiple of 4, leading to an LLVM ERROR: out of range pc-relative fixup value For 32-bit and larger (64-bit) constants, continue to treat an SoImm offset as a multiple of 4 between -1020 and 1020. For smaller (16-bit) constants, treat an SoImm offset as a multiple of 1 between -255 and 255. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D86949
-
David Sherwood authored
In an earlier patch I meant to add the correct flags to the ADD node when incrementing the pointer, but forgot to pass them to SelectionDAG::getNode. Differential Revision: https://reviews.llvm.org/D87496
-
Balazs Benics authored
Previously, it was a tedious task to comprehend Z3 dumps. We will use the same name prefix just as we use in the corresponding dump method For all `SymbolData` values: `$###` -> `conj_$###` `$###` -> `derived_$###` `$###` -> `extent_$###` `$###` -> `meta_$###` `$###` -> `reg_$###` Reviewed By: xazax.hun,mikhail.ramalho Differential Revision: https://reviews.llvm.org/D86223 -
Balazs Benics authored
Document the `ento` namespace in the Lexicon according to @nicolas17 on the mailing list (http://lists.llvm.org/pipermail/cfe-dev/2020-August/066577.html). The analyzer lived at different namespaces at different times. Originally lived at the `GR` aka. (Graph Reachability) namespace [7], later it moved under the `ento` namespace [9]. The Static Analyzer's code lived at many other places as well: `Analysis` -[2]-> `Checker` -[5]-> `GR` -[10]> `entoSA` -[11]-> `StaticAnalyzer` The relevant code motion, refactor commits, cfe-dev mailing in chronological order: 1) 2008-03-15 Make a major restructuring of the clang tree: introduce a ... 7a51313d 2) 2010-01-25 Split libAnalysis into two libraries: libAnalysis and libChecker d6b87086 3) 2010-12-21 Reorganization of Checker files http://lists.llvm.org/pipermail/cfe-dev/2010-December/012694.html 4) 2010-12-22 Refactoring: include/clang/Checker -> include/clang/GR 8d602a8a 5) 2010-12-22 Refactoring: lib/Checker -> lib/GR 2ff5ab15 6) 2010-12-22 Refactoring: Move checkers into lib/GR/Checkers and their own a700e976 7) 2010-12-22 Refactoring: Move stuff into namespace 'GR' ca08fba4 8) 2010-12-22 Refactoring: Drop the 'GR' prefix. 1696f508 9) 2010-12-23 Rename static analyzer namespace 'GR' to 'ento' 98857c98 10) 2010-12-23 Rename headers: 'clang/GR' 'clang/EntoSA' and update Makefile ef33f099 11) 2010-12-23 Chris Lattner has strong opinions about directory d99bd55a 12) 2010-12-24 Remove the EntoSA directories. 9d6af532 Reviewed By: Szelethus,martong,ASDenysPetrov,xazax.hun Differential Revision: https://reviews.llvm.org/D86446
-
Balazs Benics authored
We did not evaluate such expressions, just returned `Unknown` for such cases. After this patch, we will be able to access a unique value identifying a template instantiation via the value of the `PRETTY_FUNCTION` predefined expression. Reviewed By: vsavchenko Differential Revision: https://reviews.llvm.org/D87004
-
Fangrui Song authored
The current organization of FileInfo and its referenced utility functions of (GCOVFile, GCOVFunction, GCOVBlock) is messy. Some members of FileInfo are just copied from GCOVFile. FileInfo::print (.gcov output and --intermediate output) is interleaved with branch statistics and computation of line execution counts. --intermediate has to do redundant .gcov output to gather branch statistics. This patch deletes lots of code and introduces a clearer work flow: ``` fn collectFunction for each block b for each line lineNum let line be LineInfo of the file on lineNum line.exists = 1 increment function's lines & linesExec if necessary increment line.count line.blocks.push_back(&b) fn collectSourceLine compute cycle counts count = incoming_counts + cycle_counts if line.exists ++summary->lines if line.count ++summary->linesExec fn collectSource for each line call collectSourceLine fn main for each function call collectFunction print function summary for each source file call collectSource print file summary annotate the source file with line execution counts if -i print intermediate file ``` The output order of functions and files now follows the original order in .gcno files. -
Serge Pavlov authored
This is recommit of 6c8041aa, reverted in de044f75 because of some fails. Original commit message is below. This change allow a CastExpr to have optional FPOptionsOverride object, stored in trailing storage. Of all cast nodes only ImplicitCastExpr, CStyleCastExpr, CXXFunctionalCastExpr and CXXStaticCastExpr are allowed to have FPOptions. Differential Revision: https://reviews.llvm.org/D85960
-
Yevgeny Rouban authored
This patch fixes a problem of the commit 52cc97a0. A test case is created to demonstrate the crash caused by the instruction iterator invalidated by the recursive removal of dead operands of assume. The solution restarts from the blocks's first instruction in case CurInstIterator is invalidated by RecursivelyDeleteTriviallyDeadInstructions(). Reviewed By: bkramer Differential Revision: https://reviews.llvm.org/D87434
-
Dave Lee authored
Add `LLVM_EXTERNALIZE_DEBUGINFO` to CMake.rst. This should help make dSYM generation more discoverable. Differential Revision: https://reviews.llvm.org/D87591
-
Craig Topper authored
Previously, we formed ISD::PARITY by looking for (and (ctpop X), 1) but the AND might be separated from the ctpop. For example if the parity result is multiplied by 2, we'll pull the AND through the shift. So to handle more cases, move to SimplifyDemandedBits where we can handle more cases that result in only the LSB of the CTPOP being used.
-
Lang Hames authored
-
Fangrui Song authored
-
Fangrui Song authored
gcov 4.7 introduced the two options. https://sourceware.org/pipermail/gcc-patches/2011-November/328782.html -r only dumps files with relative paths or absolute paths with the prefix specified by -s. The two options are useful filtering out system header files.
-
Nikita Popov authored
As well as vector commuted operands.
-
David Blaikie authored
Reduces the chance of confusion when calling the function with autocomplete (will show the more accurate/informative variable name), etc.
-
David Blaikie authored
-
David Blaikie authored
Turns out this was use-after-move of function_ref, which is trivially copyable and movable, so the move did nothing and use after move was safe. But since this function_ref is being copied into a std::function, change the function_ref to be std::function to avoid extra layers of type erasure indirection - and then it's a real use after move, and fix that by referring to the moved-to member variable rather than the moved-from parameter.
-
Craig Topper authored
[SelectionDAG] Remove default for 'unsigned' Alignment for getLoad/getStore/getExtLoad/getTruncStore. Add default for MaybeAlign version. NFCI We want to remove the unsigned signatures eventually. This change migrates any that don't explicitly pass an alignment.
-
Raphael Isemann authored
Right now the ASTImporter assumes for most Expr nodes that they are always equal which leads to non-compatible declarations ending up being merged. This patch adds the basic framework for comparing Stmts (and with that also Exprs) and implements the custom checks for a few Stmt subclasses. I'll implement the remaining subclasses in follow up patches (mostly because there are a lot of subclasses and some of them require further changes like having GNU language in the testing framework) The motivation for this is that in LLDB we try to import libc++ source code and some of the types we are importing there contain expressions (e.g. because they use `enable_if<expr>`), so those declarations are currently merged even if they are completely different (e.g. `enable_if<value> ...` and `enable_if<!value> ...` are currently considered equal which is clearly not true). Reviewed By: martong, balazske Differential Revision: https://revi...
-
Qiu Chaofan authored
DAG combiner folds (fma a 1.0 b) into (fadd a b) but the flag isn't propagated into new fadd. This patch fixes that. Some code in visitFMA is redundant and such support for vector constants is missing. Need follow-up patch to clean. Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D87037
-
- Sep 13, 2020
-
-
David Green authored
The recently added optimizePhiType algorithm had no checks to make sure it didn't continually iterate backward and forth between float and int types. This means that given an input like store(phi(bitcast(load))), we could convert that back and forth to store(bitcast(phi(load))). This particular case would usually have been simplified to a different load type (folding the bitcast into the load) before CGP, but other cases can occur. The one that came up was phi(bitcast(phi)), where the two phi's of different types were bitcast between. That was not helped by a dead bitcast being kept around which could make conversion look profitable. This adds an extra check of the bitcast Uses or Defs, to make sure that at least one is grounded and will not end up being converted back. It also makes sure that dead bitcasts are removed, and there is a minor change to include newly created Phi nodes in the Visited set so that they do not need to be revisited. Differential Revision: https://reviews.llvm.org/D82676
-
Nikita Popov authored
-
Simon Pilgrim authored
Demonstrates that redundant masked stores may be removed, as long as we're able to replace the AVX/AVX2 masked store with a generic masked store (constant mask or sign-extended bool vector mask).
-
Qiu Chaofan authored
Commit 3c0b3250 introduced store fusion for PowerPC target, but it brought failure under UB sanitizer and was reverted. This patch fixes them.
-