- Dec 25, 2020
-
-
Monk Chiang authored
integer group: vredsum/vredmaxu/vredmax/vredminu/vredmin/vredand/vredor/vredxor float group: vfredosum/vfredsum/vfredmax/vfredmin We work with @rogfer01 from BSC to come out this patch. Authored-by:
Roger Ferrer Ibanez <rofirrim@gmail.com> Co-Authored-by:
Zakk Chen <zakk.chen@sifive.com> Differential Revision: https://reviews.llvm.org/D93746
-
Roman Lebedev authored
[LoopIdiom] 'left-shift-until-bittest': keep no-wrap flags on shift, fix edge-case miscompilation for %x.next While `%x.curr` is always safe to compute, because `LoopBackedgeTakenCount` will always be smaller than `bitwidth(X)`, i.e. we never get poison, rewriting `%x.next` is more complicated, however, because `X << LoopTripCount` will be poison iff `LoopTripCount == bitwidth(X)` (which will happen iff `BitPos` is `bitwidth(x) - 1` and `X` is `1`). So unless we know that isn't the case (as alive2 notes, we know it's safe to do iff shift had no-wrap flags, or bitpos does not indicate signbit, or we know that %x is never `1`), we'll need to emit an alternative, safe IR, by either just shifting the `%x.curr`, or conditionally selecting between the computed `%x.next` and `0`.. Former IR looks better so let's do that. While there, ensure that we don't drop no-wrap flags from said shift.
-
Roman Lebedev authored
In particular, add tests with no-wrap flags on shift, a test where %x is not `1`, and ensure that tests where %bit is a constant bitwidth-1, or is not a constant bitwidth-1 test both liveout values.
-
Roman Lebedev authored
This is one of the deficiencies that can be observed in https://godbolt.org/z/YPczsG after D91038 patch set. This exposed two missing folds, one was fixed by the previous commit, another one is `(A ^ B) | ~(A ^ B) --> -1` / `(A ^ B) & ~(A ^ B) --> 0`. `-early-cse` will catch it: https://godbolt.org/z/4n1T1v, but isn't meaningful to fix it in InstCombine, because we'd need to essentially do our own CSE, and we can't even rely on `Instruction::isIdenticalTo()`, because there are no guarantees that the order of operands matches. So let's just accept it as a loss.
-
Roman Lebedev authored
-
Roman Lebedev authored
``` ---------------------------------------- define i32 @and_xor_not_common_op(i32 %a, i32 %b) { %0: %b2 = xor i32 %b, 4294967295 %t2 = xor i32 %a, %b2 %t4 = and i32 %t2, %a ret i32 %t4 } => define i32 @and_xor_not_common_op(i32 %a, i32 %b) { %0: %t4 = and i32 %a, %b ret i32 %t4 } Transformation seems to be correct! ``` -
Roman Lebedev authored
... which is a variation of `a & (a ^ ~b)` --> a & b`. A follow-up patch exposes this missing fold, so we need to fix it first.
-
Roman Lebedev authored
-
Roman Lebedev authored
A pattern to ignore ConstantExpr's is quite common, since they frequently lead into infinite combine loops, so let's make writing it easier.
-
Roman Lebedev authored
Thanks to Luke Benes for pointing it out.
-
Kazu Hirata authored
The last use of the function was removed on Sep 13, 2010 in commit 1094c802.
-
Kazu Hirata authored
-
- Dec 24, 2020
-
-
Simon Pilgrim authored
Replace the local compute*SignedMinMaxValuesFromKnownBits methods with the equivalent KnownBits helpers to determine the min/max value ranges.
-
Simon Pilgrim authored
Add unit test coverage - a followup will update InstCombineCompares.cpp to use this and could be used by D86578 as well.
-
Simon Pilgrim authored
Update the comment to make this clear, following the same approach as APInt.
-
Evgeniy Brevnov authored
Make test case x86 specific. Reviewed By: xbolva00 Differential Revision: https://reviews.llvm.org/D93803
-
Nikita Popov authored
This reverts commit 899faa50. Upon further consideration, this does not fix the right issue. Doing this fold for non-inbounds GEPs is legal, because the resulting pointer is still based-on null, which has no associated address range, and as such and access to it is UB. https://bugs.llvm.org/show_bug.cgi?id=48577#c3
-
Evgeniy Brevnov authored
Currently 'resume' is lowered to _Unwind_Resume with out "noreturn" attribute. Semantically _Unwind_Resume library call is expected to never return and should be marked as such. Though I didn't find any changes in behavior of existing tests there will be a difference once https://reviews.llvm.org/D79485 lands. I was not able to come up with the test case anything better than just checking for presence of "noreturn" attribute. Please let me know if there is a better way to test the change. Reviewed By: xbolva00 Differential Revision: https://reviews.llvm.org/D93682
-
Praveen Velliengiri authored
Currently, the compiler crashes in instruction selection of global load/stores in gfx600 due to the lack of FLAT instructions. This patch fix the crash by selecting MUBUF instructions for global load/stores in gfx600. Authored-by:
Praveen Velliengiri <Praveen.Velliengiri@amd.com> Reviewed by: t-tye Differential revision: https://reviews.llvm.org/D92483
-
Nikita Popov authored
This reverts commit eb79fd3c. This causes stage2 crashes, possibly due to StringMap being miscompiled. Reverting for now.
-
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.
-