- Dec 24, 2020
-
-
Georgii Rymar authored
When something is wrong with the GNU hash table header we dump its context as a raw data. Currently we have the calculation overflow issue and it is possible to bypass the validation we have (and crash). The patch fixes it. Differential revision: https://reviews.llvm.org/D93760
-
Kazu Hirata authored
The function was introduced without a user on Jan 3, 2011 in commit 0f87ca77. We still don't have a user yet.
-
Kazu Hirata authored
-
Juneyoung Lee authored
This adds tests in directories missing from https://reviews.llvm.org/rGdb7a2f347f132b3920415013d62d1adfb18d8d58
-
Juneyoung Lee authored
This commit copies existing tests at llvm/Transforms and replaces 'insertelement undef' in those files with 'insertelement poison'. (see https://reviews.llvm.org/D93586) Tests listed using this script: grep -R -E '^[^;]*insertelement <.*> undef,' . | cut -d":" -f1 | uniq | wc -l Tests updated: file_org=llvm/test/Transforms/$1 file=${file_org%.ll}-inseltpoison.ll cp $file_org $file sed -i -E 's/^([^;]*)insertelement <(.*)> undef/\1insertelement <\2> poison/g' $file head -1 $file | grep "Assertions have been autogenerated by utils/update_test_checks.py" -q if [ "$?" == 1 ]; then echo "$file : should be manually updated" # I manually updated the script exit 1 fi python3 ./llvm/utils/update_test_checks.py --opt-binary=./build-releaseassert/bin/opt $file
-
Andrew Litteken authored
Some predicates, can be considered the same as long as the operands are flipped. For example, a > b gives the same result as b > a. This maps instructions in a greater than form, to their appropriate less than form, swapping the operands in the IRInstructionData only, allowing for more flexible matching. Tests: llvm/test/Transforms/IROutliner/outlining-isomorphic-predicates.ll llvm/unittests/Analysis/IRSimilarityIdentifierTest.cpp Reviewers: jroelofs, paquette Recommit of commit 05039266 Differential Revision: https://reviews.llvm.org/D87310
-
Alexandre Ganea authored
-
Layton Kifer authored
Fixes a bug introduced by D91589. When folding `(sext (not i1 x)) -> (add (zext i1 x), -1)`, we try to replace the not first when possible. If we replace the not in-visit, then the now invalidated node will be returned, and subsequently we will return an invalid sext. In cases where the not is replaced in-visit we can simply return SDValue, as the not in the current sext should have already been replaced. Thanks @jgorbe, for finding the below reproducer. The following reduced test case crashes clang when built with `clang -O1 -frounding-math`: ``` template <class> class a { int b() { return c == 0.0 ? 0 : -1; } int c; }; template class a<long>; ``` A debug build of clang produces this "assertion failed" error: ``` clang: /home/jgorbe/code/llvm/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:264: void {anonymous}::DAGCombiner::AddToWorklist(llvm:: SDNode*): Assertion `N->getOpcode() != ISD::DELETED_NODE && "Deleted Node added to Worklist"' failed. ``` Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D93274 -
Jacques Pienaar authored
-
Duncan P. N. Exon Smith authored
Add support for stdin to SourceManager and FileManager. Adds FileManager::getSTDIN, which adds a FileEntryRef for `<stdin>` and reads the MemoryBuffer, which is stored as `FileEntry::Content`. Eventually the other buffers in `ContentCache` will sink to here as well -- we probably usually want to load/save a MemoryBuffer eagerly -- but it's happening early for stdin to get rid of CompilerInstance::InitializeSourceManager's final call to `SourceManager::overrideFileContents`. clang/test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.export/p1.cpp relies on building a module from stdin; supporting that requires setting ContentCache::BufferOverridden. Differential Revision: https://reviews.llvm.org/D93148
-
Duncan P. N. Exon Smith authored
Handle named pipes natively in SourceManager and FileManager, removing a call to `SourceManager::overrideFileContents` in `CompilerInstance::InitializeSourceManager` (removing a blocker for sinking the content cache to FileManager (which will incidently sink this new named pipe logic with it)). SourceManager usually checks if the file entry's size matches the eventually loaded buffer, but that's now skipped for named pipes since the `stat` won't reflect the full size. Since we can't trust `ContentsEntry->getSize()`, we also need shift the check for files that are too large until after the buffer is loaded... and load the buffer immediately in `createFileID` so that no client gets a bad value from `ContentCache::getSize`. `FileManager::getBufferForFile` also needs to treat these files as volatile when loading the buffer. Native support in SourceManager / FileManager means that named pipes can also be `#include`d, and clang/test/Misc/dev-fd-fs.c was expanded to check for that. This is a new version of 3b18a594, which was reverted in b3463220 since it was missing the `SourceManager` changes. Differential Revision: https://reviews.llvm.org/D92531
-
Stanislav Mekhanoshin authored
If we happen to extract a non-dword subreg that breaks the logic of the function and it may shrink the dmask because it does not recognize the use of a lane(s). This bug is next to impossible to trigger with the current lowering in the BE, but it breaks in one of my future patches. Differential Revision: https://reviews.llvm.org/D93782
-
Jordan Rupprecht authored
D93491 implemented `--version` for the MachO LLD port, but asserts that the string contains something like "LLD N.N". However, this is just the cmake default for `LLD_VERSION_STRING`, and downstream users may choose a different value, e.g. a rolling distro may print "LLD trunk".
-
Sriraman Tallam authored
Rename the basic block symbols in the test to reflect the new names.
-
Jonas Devlieghere authored
Use early return to reduce the levels of indentation. Extract logic to find object in container into helper function.
-
Sam McCall authored
See https://github.com/clangd/clangd/issues/631
-
Andrew Litteken authored
Reverting due to unit test errors between commits. This reverts commit 05039266.
-
Björn Schäpers authored
With which you can add a space before the colon of a case or default statement. Differential Revision: https://reviews.llvm.org/D93240
-
Björn Schäpers authored
Differential Revision: https://reviews.llvm.org/D93163
-
Roman Lebedev authored
As Nuno is noting in post-commit review in https://reviews.llvm.org/D87188#2467915 it is not correct to keep NSW for negated abs pattern, so don't do that.
-
Andrew Litteken authored
Some predicates, can be considered the same as long as the operands are flipped. For example, a > b gives the same result as b > a. This maps instructions in a greater than form, to their appropriate less than form, swapping the operands in the IRInstructionData only, allowing for more flexible matching. Tests: llvm/test/Transforms/IROutliner/outlining-isomorphic-predicates.ll llvm/unittests/Analysis/IRSimilarityIdentifierTest.cpp Reviewers: jroelofs, paquette Differential Revision: https://reviews.llvm.org/D87310
-
Andrew Litteken authored
Certain instructions, such as adds and multiplies can have the operands flipped and still be considered the same. When we are analyzing structure, this gives slightly more flexibility to create a mapping from one region to another. We can add both operands in a corresponding instruction to an operand rather than just the exact match. We then try to eliminate items from the set, until there is only one valid mapping between the regions of code. We do this for adds, multiplies, and equality checking. However, this is not done for floating point instructions, since the order can still matter in some cases. Tests: llvm/test/Transforms/IROutliner/outlining-commutative-fp.ll llvm/test/Transforms/IROutliner/outlining-commutative.ll llvm/unittests/Analysis/IRSimilarityIdentifierTest.cpp Reviewers: jroelofs, paquette Differential Revision: https://reviews.llvm.org/D87311
-
Nikita Popov authored
The source pointer type is not necessarily the same as the result pointer type, so we can't simply return the original null pointer, it might be a different one.
-
Nikita Popov authored
Effectively, this is what we were previously already doing when the GEP was used in conjunction with a load or store, but this fold can also be applied more generally: > The only in bounds address for a null pointer in the default > address-space is the null pointer itself.
-
Nikita Popov authored
We were only considering the gep of null pattern in conjunction with a load/store. Also test it independently.
-
Nathan James authored
This removes alot of unnecessary padding, trimming the size of the struct from 728->608 on 64 bit platforms. Reviewed By: MyDeveloperDay Differential Revision: https://reviews.llvm.org/D93758
-
Fraser Cormack authored
This patch extends the SDNode ISel support for RVV from only the vector/vector instructions to include the vector/scalar and vector/immediate forms. It uses splat_vector to carry the scalar in each case, except when XLEN<SEW (RV32 SEW=64) when a custom node `SPLAT_VECTOR_I64` is used for type-legalization and to encode the fact that the value is sign-extended to SEW. When the scalar is a full 64-bit value we use a sequence to materialize the constant into the vector register. The non-intrinsic ISel patterns have also been split into their own file. Authored-by:
Roger Ferrer Ibanez <rofirrim@gmail.com> Co-Authored-by:
Fraser Cormack <fraser@codeplay.com> Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D93312
-
Nikita Popov authored
If the GEP isn't inbounds, then accessing a GEP of null location is generally not UB. While this is a minimal fix, the GEP of null handling should probably be its own fold.
-
Nikita Popov authored
-
Lei Zhang authored
Previously for each op we generate a separate serialization method for it. Those serialization methods duplicate the logic of parsing operands/results/attributes and such. This commit creates a generic method and let suitable op-specific serialization method to call into it. wc -l SPIRVSerialization.inc: before 8304; after: 5597 (So -2707) Reviewed By: hanchung, ThomasRaoux Differential Revision: https://reviews.llvm.org/D93535
-
Lei Zhang authored
Previously for each op we generate a separate deserialization method for it. Those deserialization methods duplicate the logic of parsing operands/results/attributes and such. This commit creates a generic method and let suitable op-specific deserialization method to call into it. wc -l SPIRVSerialization.inc: before 13290; after: 8304 (So -4986) Reviewed By: hanchung, ThomasRaoux Differential Revision: https://reviews.llvm.org/D93504
-
Craig Topper authored
Fixes unused variable warnings.
-
Lei Zhang authored
This commit renames various SPIR-V related conversion files for consistency. It drops the "Convert" prefix to various files and fixes various comment headers. Reviewed By: hanchung, ThomasRaoux Differential Revision: https://reviews.llvm.org/D93489
-
Sriraman Tallam authored
Every basic block section symbol created by -fbasic-block-sections will contain ".__part." to know that this symbol corresponds to a basic block fragment of the function. This patch solves two problems: a) Like D89617, we want function symbols with suffixes to be properly qualified so that external tools like profile aggregators know exactly what this symbol corresponds to. b) The current basic block naming just adds a ".N" to the symbol name where N is some integer. This collides with how clang creates __cxx_global_var_init.N. clang creates these symbol names to call constructor functions and basic block symbol naming should not use the same style. Fixed all the test cases and added an extra test for __cxx_global_var_init breakage. Differential Revision: https://reviews.llvm.org/D93082
-
Lei Zhang authored
Previously all SCF to SPIR-V conversion patterns were tested as the -convert-gpu-to-spirv pass. That obscured the structure we want. This commit fixed it. Reviewed By: ThomasRaoux, hanchung Differential Revision: https://reviews.llvm.org/D93488
-
Roman Lebedev authored
[LoopIdiom] 'left-shift until bittest' idiom: support rewriting loop as countable, allow extra cruft The current state of the transform is still not enough to support my motivational pattern, because it has one more "induction variable". I have delayed posting this patch, because originally even just rewriting the loop as countable wasn't enough to nicely transform my motivational pattern, because i expected that extra IV to be rewritten afterwards, but it wasn't happening until i fixed that in D91800. So, this patch allows the 'left-shift until bittest' loop idiom as long as the inserted ops are cheap, and lifts any and all extra use checks on the instructions. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D92754
-
Roman Lebedev authored
If the bitmask is for sign bit, instcombine would have canonicalized the pattern into a proper sign bit check. Supporting that is still simple, but requires a bit of a roundtrip - we first have to use `decomposeBitTestICmp()`, and the rest again just works. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D91726
-
Roman Lebedev authored
The handing of the case where the mask is a constant is trivial, if said constant is a power of two, the bit in question is log2(mask), rest just works. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D91725
-
Roman Lebedev authored
The motivation here is the following inner loop in fp16/fp24 -> fp32 expander, that runs as part of the floating-point DNG decompression in RawSpeed library: https://github.com/darktable-org/rawspeed/blob/cd380bb9a209bd2e7a0e7022b0cab04528d151e7/src/librawspeed/decompressors/DeflateDecompressor.cpp#L112-L115 ``` while (!(fp32_fraction & (1 << 23))) { fp32_exponent -= 1; fp32_fraction <<= 1; } ``` (https://godbolt.org/z/r13YMh) As one might notice, that loop is currently uncountable, and that whole code stays scalar. Yet, it is rather trivial to make that loop countable: https://godbolt.org/z/do8WMz and we can prove that via alive2: https://alive2.llvm.org/ce/z/7vQnji (ha nice, isn't it?) ... and that allow for the whole fp16->fp32 code to vectorize: https://godbolt.org/z/7hYr13 Now, while i'd love to get there, i feel like i should take it in steps. For now, this introduces support for the most basic case, where the bit position is known as a variable, and the loop *will* go away (has no live-outs other than the recurrence, no extra instructions in the loop). I have added sufficient (i believe) test coverage, and alive2 is happy with those transforms. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D91038
-
Nico Weber authored
They seem to pass fine with the analyzer off, and with this I would've noticed my last check-clang break locally.
-