- Jul 19, 2023
-
-
Shivam Gupta authored
This fix PR37919 The below code produces -Wconstant-logical-operand for the first statement, but not the second. void foo(int x) { if (x && 5) {} if (5 && x) {} } Reviewed By: nickdesaulniers Differential Revision: https://reviews.llvm.org/D142609 -
Chuanqi Xu authored
Given LLVM17 is going to be branched, add some uncovered C++20 modules related changes to the Release Notes.
-
Chuanqi Xu authored
This reverts commit 95bdd6ee. The bot shows there are some grammar issues.
-
Alexander Belyaev authored
Differential Revision: https://reviews.llvm.org/D154830
-
Chuanqi Xu authored
Given LLVM17 is going to be branched, add some uncovered C++20 modules related changes to the Release Notes.
-
Fangrui Song authored
The test requires that an integer division by zero causes a trap, leading to a signal like SIGFPE. This is the case on x86. On many other architectures, such as Arm (unless software division is used and `__aeabi_idiv0` is patched), Power, RISC-V, LoongArch, there is no trap. Therefore, it's more appropriate to invert the condition to run the test. Reviewed By: Ami-zhang Differential Revision: https://reviews.llvm.org/D155644
-
Fangrui Song authored
The called std::terminate currently gets the declaration transitively through llvm/Demangle/Utility.h, removing <exception> from Utility.h would break ItaniumDemangle.cpp.
-
Weining Lu authored
Revert "[LoongArch] Change 'using namespace llvm;' to 'namespace llvm {' in LoongArchTargetParser.cpp. NFC" This reverts commit 58632146. Reason to revert: These changes are inconsistent with the [[https://llvm.org/docs/CodingStandards.html#use-namespace-qualifiers-to-implement-previously-declared-functions|LLVM stype guide]]. -
Jie Fu authored
-
Patryk Wychowaniec authored
Currently our AVRShiftExpand pass expands only 32-bit shifts, with the assumption that other kinds of shifts (e.g. 64-bit ones) are automatically reduced to 8-bit ones by LLVM during ISel. However this is not always true and causes problems in the rust-lang runtime. This commit changes the logic a bit, so that instead of expanding only 32-bit shifts, we expand shifts of all types except 8-bit and 16-bit. This is not the most optimal solution, because 64-bit shifts can be expanded to 32-bit shifts which has been deeply optimized. I've checked the generated code using rustc + simavr, and all shifts seem to behave correctly. Spotted in the wild in rustc: https://github.com/rust-lang/compiler-builtins/issues/523 https://github.com/rust-lang/rust/issues/112140 Reviewed By: benshi001 Differential Revision: https://reviews.llvm.org/D154785
-
Jianjian GUAN authored
This patch fixes the failed test of verifyInstructionPredicates which is caused by verifyInstructionPredicates. verifyInstructionPredicates will add JMPk without checking the target predicate. Reviewed By: benshi001 Differential Revision: https://reviews.llvm.org/D155570
-
Jie Fu authored
/buildbot/worker/arc-folder/llvm-project/clang/tools/c-index-test/c-index-test.c:234: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas] /buildbot/worker/arc-folder/llvm-project/clang/tools/c-index-test/c-index-test.c:235: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas] /buildbot/worker/arc-folder/llvm-project/clang/tools/c-index-test/c-index-test.c:236:10: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual] /buildbot/worker/arc-folder/llvm-project/clang/tools/c-index-test/c-index-test.c:237:10: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual] /buildbot/worker/arc-folder/llvm-project/clang/tools/c-index-test/c-index-test.c:238: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas] /buildbot/worker/arc-folder/llvm-project/clang/tools/c-index-test/c-index-test.c:3765: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas] /buildbot/worker/arc-folder/llvm-project/clang/tools/c-index-test/c-index-test.c:3766: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas] /buildbot/worker/arc-folder/llvm-project/clang/tools/c-index-test/c-index-test.c:3767:10: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual] /buildbot/worker/arc-folder/llvm-project/clang/tools/c-index-test/c-index-test.c:3768: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
-
Jake Egan authored
Missed this detail from D155199.
-
WANG Xuerui authored
The LA464 micro-architecture is very sensitive to alignment of hot code, with performance variation of up to ~12% in the go1 benchmark suite of the Go language (as observed by me during my work on the Go loong64 port). [[ https://go.dev/cl/479816 | Manual alignment of certain loops ]] and [[ https://go.dev/cl/479817 | automatic alignment of loop heads ]] helps a lot there, by reducing much of the random variation and generally increasing performance, so we naturally want to do the same here. Practically, LA464 is the only LoongArch micro-architecture in wide use, and we are currently supporting just that. The first "4" in "LA464" stands for "4-issue", in particular its instruction fetch and decode stages are 4-wide; so functions and branch targets should be preferably aligned to at least 16 bytes for best throughput. The Loongson team has benchmarked various combinations of function, loop, and branch target alignments with GCC. [[ https://gcc.gnu.org/pipermail/gcc-patches/2023-May/619980.html | The results ]] show that "16-byte label alignment together with 32-byte function alignment gives best results in terms of SPEC score". A "label" in GCC means a branch target; while we don't currently align branch targets, we do align loops, so in this patch we default to 32-byte function alignment and 16-byte loop alignment. Reviewed By: SixWeining Differential Revision: https://reviews.llvm.org/D148622
-
Jie Fu authored
/Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1120:18: error: cast from 'const void *' to 'unsigned char *' drops const qualifier [-Werror,-Wcast-qual] (uint8_t *)mlirDenseElementsAttrGetRawData(uint8Elements); ^ /Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1121:35: error: cast from 'const void *' to 'signed char *' drops const qualifier [-Werror,-Wcast-qual] int8_t *int8RawData = (int8_t *)mlirDenseElementsAttrGetRawData(int8Elements); ^ /Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1123:19: error: cast from 'const void *' to 'unsigned int *' drops const qualifier [-Werror,-Wcast-qual] (uint32_t *)mlirDenseElementsAttrGetRawData(uint32Elements); ^ /Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1125:18: error: cast from 'const void *' to 'int *' drops const qualifier [-Werror,-Wcast-qual] (int32_t *)mlirDenseElementsAttrGetRawData(int32Elements); ^ /Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1127:19: error: cast from 'const void *' to 'unsigned long long *' drops const qualifier [-Werror,-Wcast-qual] (uint64_t *)mlirDenseElementsAttrGetRawData(uint64Elements); ^ /Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1129:18: error: cast from 'const void *' to 'long long *' drops const qualifier [-Werror,-Wcast-qual] (int64_t *)mlirDenseElementsAttrGetRawData(int64Elements); ^ /Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1130:34: error: cast from 'const void *' to 'float *' drops const qualifier [-Werror,-Wcast-qual] float *floatRawData = (float *)mlirDenseElementsAttrGetRawData(floatElements); ^ /Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1132:17: error: cast from 'const void *' to 'double *' drops const qualifier [-Werror,-Wcast-qual] (double *)mlirDenseElementsAttrGetRawData(doubleElements); ^ /Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1134:19: error: cast from 'const void *' to 'unsigned short *' drops const qualifier [-Werror,-Wcast-qual] (uint16_t *)mlirDenseElementsAttrGetRawData(bf16Elements); ^ /Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1136:19: error: cast from 'const void *' to 'unsigned short *' drops const qualifier [-Werror,-Wcast-qual] (uint16_t *)mlirDenseElementsAttrGetRawData(f16Elements); ^ 10 errors generated. -
Jie Fu authored
/Users/jiefu/llvm-project/clang/tools/c-index-test/c-index-test.c:234:18: error: cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual] free((char *)unsaved_files[i].Filename); ^ /Users/jiefu/llvm-project/clang/tools/c-index-test/c-index-test.c:235:18: error: cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual] free((char *)unsaved_files[i].Contents); ^ /Users/jiefu/llvm-project/clang/tools/c-index-test/c-index-test.c:3762:32: error: cast from 'const char *' to 'void *' drops const qualifier [-Werror,-Wcast-qual] return (CXIdxClientContainer)"TU"; ^ 3 errors generated. -
eopXD authored
In D155502, we added code for the compiler to check GPR-s for f16 under zhinx. This commit adds code to hit the stack when we run out of GPR-s. With this patch and D155502, resolves #63922 Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D155507
-
Amir Ayupov authored
Pass the revision to checkout to (cmp-rev) as nfc-check-setup option. Simpifies the comparison against arbitrary commit, not just the previous one. Reviewed By: #bolt, rafauler Differential Revision: https://reviews.llvm.org/D155657
-
eopXD authored
The full multiply intrinsics are not included for EEW=64 in Zve64*. They require the V extension to be enabled. This commit improves diagnostic message from ``` <source>:4:10: error: call to undeclared function '__riscv_vsmul_vv_i64m1'; 4 | return __riscv_vsmul_vv_i64m1(op1, op2, __RISCV_VXRM_RNU, vl); ``` to ``` test.c:5:10: error: builtin requires: v 5 | return __riscv_vsmul_vv_i64m1(op1, op2, __RISCV_VXRM_RNU, vl); ``` Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D155416 -
Jake Egan authored
The file offset code is repeated in nearly identical form for every derivation of SectionEntry, so make it into a method in SectionEntry instead. Reviewed By: scott.linder Differential Revision: https://reviews.llvm.org/D155199
-
eopXD authored
(ELEN, LMUL) pairs of (8, mf8), (16, mf4), (32, mf2), (64, m1) requires at least `zve64x`. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D155414
-
Owen Pan authored
-
Akira Hatanaka authored
Using `L` for type `long` results in clang passing 64-bit integers to these intrinsics on LP64 operating systems. This isn't correct as the intrinsics accept 32-bit integers. Use `N` instead of `L` so that 32-bit integers are passed to the intrinsics on LP64 operating systems too. This is the same fix as the following two commits: 33703fb9 afa47c91 Differential Revision: https://reviews.llvm.org/D155012
-
LLVM GN Syncbot authored
-
Nico Weber authored
-
Nico Weber authored
-
Fangrui Song authored
for more efficient section content hashing. Also clean up the tests a bit and properly test the formatting of --print-icf-sections.
-
Johannes Doerfert authored
If we store a constant in an ICV it is easier for the optimizer to propagate it. Since we often use the full block for the thread limit and the parallel team size, we can instead replace that dynamic value with a constant that otherwise cannot occur, here 0.
-
Johannes Doerfert authored
We ended up with `llvm.assume(icmp ne ptr as(4) null, as(4) @str)` because the string in address space 4 was not known to be non-null. There is no need to create these assumes.
-
Alex MacLean authored
Disable this warning for specific cast in llvm_regcomp(). Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D153911
-
David Blaikie authored
Simpler to use ArrayRef directly here rather than a more generic/customizable range helper like iterator_range
-
Craig Topper authored
Remove template parameters that always have their default value.
-
Michael Maitland authored
[RISCV] Remove unused classes VPseudoTernary, VPseudoTernaryNoMaskNoPolicy, and VPseudoConversionW_V These classes are dead and can be removed. Differential Revision: https://reviews.llvm.org/D155634
-
Michael Jones authored
The amount of spaces to pad with is stored in the variable padding_spaces, previously the actual write calls used the same formula to calculate the value. This simplifies and clarifies the values by just reusing the variable. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D155113
-
Michael Jones authored
MPFR has a minimum precision of 2, but the strtofloat fuzz sometimes would request a precision of 1 for the case of the minimum subnormal. This patch tells the fuzzer to ignore any case where the precision would go below 2. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D155130
-
Po-yao Chang authored
1. Teach -Wuser-defined-literals to warn on using double underscores in literal suffix identifiers. 2. Add -Wdeprecated-literal-operator to warn about the use of the first grammar production of literal-operator-id, which defaults to off for now. Differential Revision: https://reviews.llvm.org/D152632
-
Matthew Voss authored
The unified LTO pipeline creates a single LTO bitcode structure that can be used by Thin or Full LTO. This means that the LTO mode can be chosen at link time and that all LTO bitcode produced by the pipeline is compatible, from an optimization perspective. This makes the behavior of LTO a bit more predictable by normalizing the set of LTO features supported by each LTO bitcode file. Example usage: clang -flto -funified-lto -fuse-ld=lld foo.c clang -flto=thin -funified-lto -fuse-ld=lld foo.c clang -c -flto -funified-lto foo.c # -flto={full,thin} are identical in terms of compilation actions clang -flto=thin -fuse-ld=lld foo.o # pass --lto=thin to ld.lld clang -c -flto -funified-lto foo.c clang -flto -fuse-ld=lld foo.o The RFC discussing the details and rational for this change is here: https://discourse.llvm.org/t/rfc-a-unified-lto-bitcode-frontend/61774 Differential Revision: https://reviews.llvm.org/D123805 -
Rashmi Mudduluru authored
Differential Revision: https://reviews.llvm.org/D155134
-
Rashmi Mudduluru authored
Differential Revision: https://reviews.llvm.org/D155304
-
Yitzhak Mandelbaum authored
[clang][dataflow] Add function to `WatchedLiteralsSolver` that reports whether the iteration limit has been reached. This change provides a centralized record of whether the solver is "exhausted". In general, once the solver is exhausted, further uses do not produce meaningful conclusions. Clients can use this information, for example, to choose to discard all results based on the solver, instead of trying to distinguish those reached before the limit was reached. Providing it at in the solver avoids the need to propagate it from each callsite to the client of the solver. Differential Revision: https://reviews.llvm.org/D155636
-