- Jul 23, 2022
-
-
Dmitri Gribenko authored
Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D130403
-
Simon Pilgrim authored
[DAG] Move OR(AND(X,C1),AND(OR(X,Y),C2)) -> OR(AND(X,OR(C1,C2)),AND(Y,C2)) fold to SimplifyDemandedBits This will fix the SystemZ v3i31 memcpy regression in D77804 (with the help of D129765 as well....). It should also allow us to /bend/ the oneuse limitation for cases where we can use demanded bits to safely peek though multiple uses of the AND ops.
-
Corentin Jabot authored
The #warning directive is standard in C++2b and C2x, this adjusts the pedantic and extensions warning accordingly. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D130415
-
Corentin Jabot authored
This implements N2836 Identifier Syntax using Unicode Standard Annex 31. The feature was already implemented for C++, and the semantics are the same. Unlike C++ there was, afaict, no decision to backport the feature in older languages mode, so C17 and earlier are not modified and the code point tables for these language modes are conserved. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D130416
-
Benjamin Kramer authored
-
Simon Pilgrim authored
-
Simon Pilgrim authored
[DAG] ExpandIntRes_ADDSUB - create UADDO/USUBO instead of ADDCARRY/SUBCARRY if overflow is known to be zero As noticed on D127115, when splitting ADD/SUB nodes we often end up with cases where overflow from the lower bits is impossible - in such cases we're better off breaking the carry chain dependency as soon as possible. This path is being exercised by llvm/test/CodeGen/ARM/dsp-mlal.ll, although I haven't been able to get any codegen diff without a topological worklist.
-
Dimitrije Milosevic authored
Add the MIPS O32 ABI value for the stat struct's size. Differential Revision: https://reviews.llvm.org/D129749.
-
Simon Pilgrim authored
Concat KnownBits from ISD::SHL_PARTS / ISD::SRA_PARTS / ISD::SRL_PARTS lo/hi operands and perform the KnownBits calculation by the shift amount on the extended type, before splitting the KnownBits based on the requested lo/hi result.
-
Kazu Hirata authored
-
Peixin Qiao authored
For aint/anint, LLVM conversion operations llvm.trunc and llvm.round can support the edge case of aint(-0.) and anint(-0.). The output is -0. and it is the same of `gfortran` and `classic flang`, while the output of `ifort` is 0.. The `real(10)/real(16)` is not supported before. Support it and remove the runtime functions for aint/anint. For nint, `gfortran`, `ifort`, and LLVM Flang using llvm.lround have different results when the magnitude of argument is more than the max of result value range. So delay its support in lowering after more investigations. Reviewed By: vzakhari Differential Revision: https://reviews.llvm.org/D130024
-
Kazu Hirata authored
-
Kazu Hirata authored
-
Jun Zhang authored
Signed-off-by:Jun Zhang <jun@junz.org>
-
Johannes Doerfert authored
If we look at a write, we should not enact the "has been written to" logic introduced to avoid spurious write -> read dependences. Doing so lead to elimination of stores we needed, which is obviously bad.
-
Peter Klausler authored
The integer arithmetic template supports ISHFTC() but the integer intrinsic folding code had yet to call it; finish the job. Differential Revision: https://reviews.llvm.org/D130379
-
Kazu Hirata authored
This patch fixes: llvm-project/flang/lib/Semantics/expression.cpp:405:12: error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move]
-
Ivan Trofimov authored
Reviewed By: vitalybuka, eugenis Differential Revision: https://reviews.llvm.org/D129219
-
Peter Klausler authored
The code that copies data from a constant source array into a character array constant result was failing to copy its last element if it was only partially defined due to misalignment. Differential Revision: https://reviews.llvm.org/D130376
-
Fangrui Song authored
-gsplit-dwarf produces a .dwo file which will not be processed by the linker. If .dwo files contain relocations, they will not be resolved. Therefore the practice is that .dwo files do not contain relocations. Address ranges and location description need to use forms/entry kinds indexing into .debug_addr (DW_FORM_addrx/DW_RLE_startx_endx/etc), which is currently not implemented. There is a difficult-to-read MC error with -gsplit-dwarf with RISC-V for both -mrelax and -mno-relax. ``` % clang --target=riscv64-linux-gnu -g -gsplit-dwarf -c a.c error: A dwo section may not contain relocations ``` We expect to fix -mno-relax soon, so report a driver error for -mrelax for now. Link: https://github.com/llvm/llvm-project/issues/56642 Reviewed By: compnerd, kito-cheng Differential Revision: https://reviews.llvm.org/D130190
-
Peter Klausler authored
A type-param-inquiry of %KIND or %LEN applies to a designator, and so must also be allowed for a substring. F18 presently (mis)parses instances of a type-param-inquiry as structure component references and then fixes them in expression semantics when types are known and we can distinguish them. But when the base of a type-param-inquiry is a substring of an array element, as in "charArray(i)(j:k)%len", parsing fails. Adjust the grammar to parse these cases, and extend expression semantics to process the new production. Differential Revision: https://reviews.llvm.org/D130375
-
Ilya Leoshkevich authored
Many distros ship zlib with the IBM Z deflate hardware acceleration patch [1]. Sometimes it's desirable to disable the acceleration, for example, for reproducibility. This can be done by exporting DFLTCC=0. llvm-lit clears this environment variable, which causes compress-debug-sections-zlib.test fail on z15 and later machines. Add DFLTCC to the list of variables to keep. [1] https://github.com/madler/zlib/pull/410 Reviewed By: abrachet Differential Revision: https://reviews.llvm.org/D130253
-
Dmitri Gribenko authored
Start by dumping the flow condition. Reviewed By: ymandel Differential Revision: https://reviews.llvm.org/D130398
-
Volodymyr Sapsai authored
Fixes modular build for clangPseudoGrammar from clang-tools-extra. Starting from https://reviews.llvm.org/D126731 clangPseudoGrammar doesn't depend on generated .inc headers but still depends on "Basic/TokenKinds.h". It means clangPseudoGrammar depends on module 'Clang_Basic' which does depend on generated .inc headers. To avoid these coarse dependencies and extra build steps, extract "clang/Basic/TokenKinds.h" into a top-level module 'Clang_Basic_TokenKinds'. rdar://97387951 Differential Revision: https://reviews.llvm.org/D130377
-
Peter Klausler authored
Fortran specifically allows character-valued I/O specifiers to have trailing blanks, e.g. OPEN(666,STATUS='SCRATCH '). The runtime I/O library already handles them, but the I/O static checks in semantics do not. Differential Revision: https://reviews.llvm.org/D130381
-
Dmitri Gribenko authored
Reviewed By: ymandel Differential Revision: https://reviews.llvm.org/D130399
-
Ryan Prichard authored
mkstemp is guaranteed to make at least TMP_MAX attempts to create the random file, and if it can't, it fails with EEXIST. get_temp_file_name shouldn't call mkstemp again if it fails with anything other than EEXIST. A single mkstemp call seems sufficient. On Android, I've seen mkstemp fail with: - EROFS (because cwd wasn't set to a writable filesystem) - EACCES (because cwd pointed to a dir owned by root, but the test program was running as the shell user instead) Previously, get_temp_file_name would run forever in these situations. See D4962 and "llvm-svn: 229035" Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D130214
-
Dmitri Gribenko authored
Reviewed By: ymandel Differential Revision: https://reviews.llvm.org/D130400
-
Augusto Noronha authored
-
Augusto Noronha authored
-
Peter Klausler authored
Fold the intrinsic function SET_EXPONENT() and its special case, FRACTION(). Differential Revision: https://reviews.llvm.org/D130378
-
Med Ismail Bennani authored
This reverts commit b7978347, since it breaks building Clang: https://reviews.llvm.org/D129377
-
ARCHIT SAXENA authored
This change adds a nop instruction if section starts with landing pad. This change is like [D73739](https://reviews.llvm.org/D73739) which avoids zero offset landing pad in basic block sections. Detailed description: The current machine functions splitter can create ˜sections which start with a landing pad themselves. This places landing pad at offset zero from LPStart. ``` .section .text.split.foo10,"ax",@progbits foo10.cold: # %lpad .cfi_startproc .cfi_personality 3, __gxx_personality_v0 .cfi_lsda 3, .Lexception5 .cfi_def_cfa %rsp, 16 .Ltmp11: <--- This is a Landing pad and also LP Start as it is start of this section movq %rax, %rdi <--- first instruction is at offest 0 from LPStart callq _Unwind_Resume@PLT ``` This will cause landing pad entries to become zero (.Ltmp11-foo10.cold) ``` .Lcst_begin4: .uleb128 .Ltmp9-.Lfunc_begin2 # >> Call Site 1 << .uleb128 .Ltmp10-.Ltmp9 # Call between .Ltmp9 and .Ltmp10 .uleb128 .Ltmp11-foo10.cold <---This is zero # jumps to .Ltmp11 .byte 3 # On action: 2 .uleb128 .Ltmp10-.Lfunc_begin2 # >> Call Site 2 << .uleb128 .Lfunc_end9-.Ltmp10 # Call between .Ltmp10 and .Lfunc_end9 .byte 0 # has no landing pad .byte 0 # On action: cleanup .p2align 2 ``` The C++ ABI somehow assumes that no landing pads point directly to LPStart (which works in the normal case since the function begin is never a landing pad), and uses LP.offset = 0 to specify no landing pad. This change adds a nop instruction at start of such sections so that such a case could be avoided. Output: ``` .section .text.split.foo10,"ax",@progbits foo10.cold: # %lpad .cfi_startproc .cfi_personality 3, __gxx_personality_v0 .cfi_lsda 3, .Lexception5 .cfi_def_cfa %rsp, 16 nop <--- new instruction that is added .Ltmp11: movq %rax, %rdi callq _Unwind_Resume@PLT ``` Reviewed By: modimo, snehasish, rahmanl Differential Revision: https://reviews.llvm.org/D130133
-
Alexander Shaposhnikov authored
This diff adds folds for patterns like X * A < B where A, B are constants and "mul" has either "nsw" or "nuw". (to address https://github.com/llvm/llvm-project/issues/56563). Test plan: 1/ ninja check-llvm check-clang 2/ Bootstrapped LLVM/Clang pass tests Differential revision: https://reviews.llvm.org/D130039
-
Fangrui Song authored
Most common architectures (aarch64,riscv,s390x,x86,etc) have implemented -mtune=. Don't ignore -mtune= in generic code.
-
Fangrui Song authored
Similar to AArch64.
-
Fangrui Song authored
-
Fangrui Song authored
Note: we should test CHECK-NOT: "-tune-cpu" instead of CHECK-NOT: "-tune-cpu" "generic"
-
Chelsea Cassanova authored
This commit adds a fuzzer for LLDB's expression evaluator. The fuzzer takes a different approach than the current fuzzers present, and uses an approach that is currently being used for clang fuzzers. Instead of fuzzing the evaluator with randomly mutated characters, protobufs are used to generate a subset of C++. This is then converted to valid C++ code and sent to the expression evaluator. In addition, libprotobuf_mutator is used to mutate the fuzzer's inputs from valid C++ code to valid C++ code, rather than mutating from valid code to total nonsense. Differential revision: https://reviews.llvm.org/D129377
-
Fangrui Song authored
llvm::sys::getHostCPUName()'s return value is not empty. `-mtune=` (empty value) has caused a driver error. So we can omit `!TuneCPU.empty()` check.
-