[llvm-bugs] [Bug 120469] [TySan] Clang compilation hangs on large arrays
Issue 120469 Summary [TySan] Clang compilation hangs on large arrays Labels clang Assignees Reporter artem C++ reproducer: ```c++ #include #include struct foo { std::string name; }; std::array options; ``` Clang is invoked with: ``` clang++-20 test.cpp -c -o test.o -O1 -fsanitize=type ``` Clang version: 20.0.0 (++20241218112756+95eb49a09055-1~exp1~20241218112924.2537) ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 120462] It takes a very long time to compile a glibc test
Issue 120462 Summary It takes a very long time to compile a glibc test Labels new issue Assignees Reporter hjl-tools Clang 19 takes a very long time, it ran more than 27 minutes on Intel Core i7-1195G7 before the process was killed, to compile bug28.c. in glibc test: ``` [hjl@gnu-tgl-3 tmp]$ time gcc -c -O2 bug28.c real 0m0.059s user 0m0.046s sys 0m0.011s [hjl@gnu-tgl-3 tmp]$ time clang -c -O2 bug28.c ^c real 8m46.993s user 8m44.904s sys 0m0.132s [hjl@gnu-tgl-3 tmp]$ cat bug28.c #include #include #include int main (void) { size_t instances = 16384; #define X0 "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" const char *item = "\na\nabbcd55"; #define X3 X0 X0 X0 X0 X0 X0 X0 X0 #define X6 X3 X3 X3 X3 X3 X3 X3 X3 #define X9 X6 X6 X6 X6 X6 X6 X6 X6 #define X12 X9 X9 X9 X9 X9 X9 X9 X9 #define X14 X12 X12 X12 X12 #define TRAILER "%%" #define TRAILER2 TRAILER TRAILER size_t length = instances * strlen (item) + strlen (TRAILER) + 1; char *buf = malloc (length + 1); snprintf (buf, length + 1, X14 TRAILER2 "\n", "a", "b", "c", "d", 5); const char *p = buf; size_t i; for (i = 0; i < instances; ++i) { const char *expected; for (expected = item; *expected; ++expected) { if (*p != *expected) { printf ("mismatch at offset %zu (%zu): expected %d, got %d\n", (size_t) (p - buf), i, *expected & 0xFF, *p & 0xFF); return 1; } ++p; } } if (strcmp (p, TRAILER "\n") != 0) { printf ("mismatch at trailer: [%s]\n", p); return 1; } free (buf); return 0; } [hjl@gnu-tgl-3 tmp]$ ``` ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 120508] Build error
Issue 120508 Summary Build error Labels new issue Assignees Reporter pyl3000 I get an error when I build the system in a Windows environment:  Error as follow:  How to fix it? ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 120472] [HLSL] Implement the Root Signature parser
Issue 120472 Summary [HLSL] Implement the Root Signature parser Labels HLSL Assignees inbelic Reporter inbelic This issues handles the parsing of a root signature string into a list of `HLSLRootElement`s. It should be self-contained from the parsing of `HLSLRootSignatureAttr`. Note that the parsing of the root signature will take place in SemaHLSL so we have the capability to do semantic analysis when parsing, but we will defer much of this work to issue https://github.com/llvm/llvm-project/issues/119019. AC: - [ ] Define `HLSLRootElement` in `HLSLResource.h` - [ ] Define and implement `ParseHLSLRootSignature` in `Sema/ParseHLSLRootSignature.[h|cpp]` - [ ] Add unit testing of generated `HLSLRootElements` in `clang/unittests/Sema/ParseHLSLRootSignatureTest.cpp` ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 120392] affine dialect → emitc dialect an error occurred
Issue 120392 Summary affine dialect → emitc dialect an error occurred Labels Assignees Reporter pyl3000 When I run `mlir-opt --lower-affine --convert-scf-to-emitc --convert-arith-to-emitc --convert-memref-to-emitc --convert-func-to-emitc matmul- affine.mlir -o matmul-emitc.mlir` with the following error:  matmul- affine.mlir as follow: ``` module { func.func @main() { %cst = arith.constant 0.00e+00 : f64 %cst_0 = arith.constant 6.00e+00 : f64 %cst_1 = arith.constant 5.00e+00 : f64 %cst_2 = arith.constant 4.00e+00 : f64 %cst_3 = arith.constant 3.00e+00 : f64 %cst_4 = arith.constant 2.00e+00 : f64 %cst_5 = arith.constant 1.00e+00 : f64 %alloc = memref.alloc() : memref<2x2xf64> %alloc_6 = memref.alloc() : memref<2x3xf64> affine.store %cst_5, %alloc_6[0, 0] : memref<2x3xf64> affine.store %cst_4, %alloc_6[0, 1] : memref<2x3xf64> affine.store %cst_3, %alloc_6[0, 2] : memref<2x3xf64> affine.store %cst_2, %alloc_6[1, 0] : memref<2x3xf64> affine.store %cst_1, %alloc_6[1, 1] : memref<2x3xf64> affine.store %cst_0, %alloc_6[1, 2] : memref<2x3xf64> affine.for %arg0 = 0 to 2 { affine.for %arg1 = 0 to 2 { affine.store %cst, %alloc[%arg1, %arg0] : memref<2x2xf64> affine.for %arg2 = 0 to 3 { %0 = affine.load %alloc_6[%arg0, %arg2] : memref<2x3xf64> %1 = affine.load %alloc_6[%arg1, %arg2] : memref<2x3xf64> %2 = affine.load %alloc[%arg1, %arg0] : memref<2x2xf64> %3 = arith.mulf %1, %0 : f64 %4 = arith.addf %2, %3 : f64 affine.store %4, %alloc[%arg1, %arg0] : memref<2x2xf64> } } } memref.dealloc %alloc_6 : memref<2x3xf64> memref.dealloc %alloc : memref<2x2xf64> return } } ``` ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 120427] [libc] gcc build errors about conversion from 'int' to 'short unsigned int'
Issue 120427 Summary [libc] gcc build errors about conversion from 'int' to 'short unsigned int' Labels libc Assignees Reporter jackhong12 I built libc with g++ 13.3.0 and got the following errors. ``` [112/742] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.sinf16.dir/sinf16.cpp.o FAILED: projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.sinf16.dir/sinf16.cpp.o /usr/bin/c++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -I/home/jack/open-source/llvm-project/build_gcc/projects/libc/src/math/generic -I/home/jack/open-source/llvm-project/libc/src/math/generic -I/home/jack/open-source/llvm-project/libc -isy stem /home/jack/open-source/llvm-project/build_gcc/projects/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno -missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-overrid e -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -mavx2 -mfma -msse4.2 -D__LIBC_USE_BUILTIN_CEIL_FLOOR_RINT_TRUNC -DLIBC_QSORT_IMPL=LIBC_QSO RT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -fpie -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -mno-omit-leaf-frame-p ointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -fext-numeric-literals -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -O3 -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT projects/libc/src/math/generic/CMakeFiles/libc .src.math.generic.sinf16.dir/sinf16.cpp.o -MF projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.sinf16.dir/sinf16.cpp.o.d -o projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.sinf16.dir/sinf16.cpp.o -c /home/jac k/open-source/llvm-project/libc/src/math/generic/sinf16.cpp In file included from /home/jack/open-source/llvm-project/libc/src/math/generic/sinf16.cpp:16: /home/jack/open-source/llvm-project/libc/src/__support/FPUtil/except_value_utils.h: In instantiation of ‘constexpr __llvm_libc_20_0_0_git::cpp::optional __llvm_libc_20_0_0_git::fputil::ExceptValues::lookup_odd(StorageType, bool) c onst [with T = _Float16; long unsigned int N = 4; StorageType = short unsigned int]’: /home/jack/open-source/llvm-project/libc/src/math/generic/sinf16.cpp:58:41: required from here /home/jack/open-source/llvm-project/libc/src/__support/FPUtil/except_value_utils.h:84:20: error: conversion from ‘int’ to ‘__llvm_libc_20_0_0_git::fputil::ExceptValues<_Float16, 4>::StorageType’ {aka ‘short unsigned int’} may change value [-Werror=conversion] 84 | out_bits += sign ? values[i].rnd_downward_offset | ~^~~ 85 |: values[i].rnd_upward_offset; |~ /home/jack/open-source/llvm-project/libc/src/__support/FPUtil/except_value_utils.h:88:20: error: conversion from ‘int’ to ‘__llvm_libc_20_0_0_git::fputil::ExceptValues<_Float16, 4>::StorageType’ {aka ‘short unsigned int’} may change value [-Werror=conversion] 88 | out_bits += sign ? values[i].rnd_upward_offset | ~^ 89 |: values[i].rnd_downward_offset; |~~~ cc1plus: all warnings being treated as errors [124/742] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.tanpif16.dir/tanpif16.cpp.o FAILED: projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.tanpif16.dir/tanpif16.cpp.o /usr/bin/c++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -I/home/jack/open-source/llvm-project/build_gcc/projects/libc/src/math/generic -I/home/jack/open-source/llvm-project/libc/src/math/generic -I/home/jack/open-source/llvm-project/libc -isystem /home/jack/open-source/llvm-project/build_gcc/projects/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnost
[llvm-bugs] [Bug 120433] [SLP] Assertion `detail::isPresent(Val) && "dyn_cast on a non-existent value"' failed.
Issue 120433 Summary [SLP] Assertion `detail::isPresent(Val) && "dyn_cast on a non-existent value"' failed. Labels llvm:SLPVectorizer, llvm:crash Assignees DianQK Reporter DianQK This IR crashes on SLP: https://llvm.godbolt.org/z/8oar4o4d1 ```llvm define void @foo() { bb: br label %bb1 bb1: ; preds = %bb3, %bb %i = phi i32 [ %i26, %bb3 ], [ 0, %bb ] %i2 = phi i32 [ %i24, %bb3 ], [ 0, %bb ] br label %bb3 bb3: ; preds = %bb1 %i4 = zext i32 %i2 to i64 %i5 = mul i64 %i4, 0 %i10 = or i64 0, %i5 %i11 = trunc i64 %i10 to i32 %i12 = and i32 %i11, 0 %i13 = zext i32 %i to i64 %i14 = mul i64 %i13, 0 %i19 = or i64 0, %i14 %i20 = trunc i64 %i19 to i32 %i21 = and i32 %i20, 0 %i22 = or i32 %i12, %i21 %i23 = icmp ult i32 %i22, 0 %i24 = select i1 %i23, i32 0, i32 0 %i25 = icmp ult i32 0, 0 %i26 = select i1 %i25, i32 0, i32 0 br label %bb1 } ``` ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 120439] [clang] apple link error
Issue 120439 Summary [clang] apple link error Labels clang Assignees Reporter calvin2021y try build `sqlite/tool/lemon.c`, get error: ```sh dyld[99264]: unknown imports format clang: error: unable to execute command: Abort trap: 6 clang: error: dsymutil command failed due to signal (use -v to see invocation) ``` clang `19.1.6`, download from https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.6/LLVM-19.1.6-macOS-X64.tar.xz macOS 15.2 ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 120453] Insufficient Optimization of memcpy-Like Loop with Non-Null Pointers
Issue 120453 Summary Insufficient Optimization of memcpy-Like Loop with Non-Null Pointers Labels new issue Assignees Reporter jonathan-gruber-jg Given a `memcpy`-like loop whose pointer operands are known to be non-null, Clang does not optimize the loop into just an unconditional branch to `memcpy`. Minimal test case: ``` #include void my_void_memcpy(void *restrict dst, const void *restrict src, size_t n) { if (!src || !dst) { unreachable(); } /* At this point, we know that src and dst are both non-null. */ for (size_t i = 0; i < n; ++i) { *((char *)dst + i) = *((char *)src + i); } } ``` I only tested the target architectures x86_64, aarch64, and riscv64, but I would not be surprised if other targets have the same problem. Host system: Arch Linux, x86_64. Clang version: official Arch Linux package of clang, version 18.1.8-4. Command line to reproduce results: clang -c test.c -O\. x86_64 assembly (Intel syntax), with -Os, -O2, or -O3: ``` my_void_memcpy: test rdx, rdx jne memcpy ret ``` aarch64 assembly, with -Os, -O2, or -O3: ``` my_void_memcpy: cbz x2, .LBB0_2 b memcpy .LBB0_2: ret ``` riscv64 assembly, with -Os, -O2, or -O3: ``` my_void_memcpy: beqz a2, .LBB0_2 tail memcpy .LBB0_2: ret ``` Each of the tested targets check if `n` is `0` and, if so, execute a return instruction; otherwise, they branch to `memcpy`. However, `memcpy` already checks if `n` is `0`, so, because both `src` and `dst` are non-null, `my_void_memcpy` could be further optimized into just an unconditional branch to `memcpy`. ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 120411] 27 libc++ tests failing In Premerge Checks
Issue 120411 Summary 27 libc++ tests failing In Premerge Checks Labels libc++ Assignees Reporter fhahn See https://github.com/llvm/llvm-project/actions/runs/12391953479/job/34590109848 https://productionresultssa7.blob.core.windows.net/actions-results/4de5d37a-68c0-4f76-aabf-bb205da075c5/workflow-job-run-2da2aaae-6fb4-50f1-14dd-87676bedbd1f/logs/job/job-logs.txt?rsct=text%2Fplain&se=2024-12-18T12%3A07%3A10Z&sig=tzBDtsYcrt77IdGCnC2sOAHFoKahgn%2BFc43C8HZCdVw%3D&ske=2024-12-18T23%3A06%3A41Z&skoid=ca7593d4-ee42-46cd-af88-8b886a2f84eb&sks=b&skt=2024-12-18T11%3A06%3A41Z&sktid=398a6654-997b-47e9-b12b-9515b896b4de&skv=2024-11-04&sp=r&spr=https&sr=b&st=2024-12-18T11%3A57%3A05Z&sv=2024-11-04 2024-12-18T11:55:25.5802824Z 2024-12-18T11:55:25.5803018Z Failed Tests (27): 2024-12-18T11:55:25.5803495Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp 2024-12-18T11:55:25.5804171Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp 2024-12-18T11:55:25.5804829Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp 2024-12-18T11:55:25.5805571Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp 2024-12-18T11:55:25.5806310Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp 2024-12-18T11:55:25.5806996Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp 2024-12-18T11:55:25.5807701Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp 2024-12-18T11:55:25.5808417Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp 2024-12-18T11:55:25.5809125Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/class.directory_iterator/directory_iterator.members/ctor.pass.cpp 2024-12-18T11:55:25.5809795Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp 2024-12-18T11:55:25.5810541Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp 2024-12-18T11:55:25.5811283Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/fs.op.funcs/fs.op.exists/exists.pass.cpp 2024-12-18T11:55:25.5811883Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp 2024-12-18T11:55:25.5812523Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp 2024-12-18T11:55:25.5813173Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp 2024-12-18T11:55:25.5813783Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp 2024-12-18T11:55:25.5814362Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp 2024-12-18T11:55:25.5815012Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/fs.op.funcs/fs.op.is_other/is_other.pass.cpp 2024-12-18T11:55:25.5815647Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp 2024-12-18T11:55:25.5816320Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp 2024-12-18T11:55:25.5816925Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp 2024-12-18T11:55:25.5817550Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp 2024-12-18T11:55:25.5818208Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp 2024-12-18T11:55:25.5818785Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp 2024-12-18T11:55:25.5819358Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp 2024-12-18T11:55:25.5819956Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp 2024-12-18T11:55:25.5820716Z llvm-libc++-shared.cfg.in :: std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bu
[llvm-bugs] [Bug 120409] [clang] error: expected '(' or '{' cl dialect
Issue 120409 Summary [clang] error: expected '(' or '{' cl dialect Labels clang Assignees Reporter mzyKi ```cpp template class Tuple { public: Tuple(const T* pTup) : m_tup[0](pTup[0]), m_tup[1](pTup[1]), m_tup[2](pTup[2]) {} protected: T m_tup[3]; }; ``` I use clang.exe to compile the above code it will tell me ```error: expected '(' or '{'``` But it will have no error in cl.exe. Should we need to support this? I am not very familiar with clang parser. My thought about this is I can change some logic in clang parser and add one AST Node like ```MSArrayInitListExpr``` to fix this error. At the same time, I found the following code, ```cpp template class Tuple { public: Tuple(const T* pTup) : m_tup{pTup[0], pTup[1], pTup[2]} {} protected: T m_tup[3]; }; ``` Its ast is ```bash `-ClassTemplateDecl 0x20423924f00 line:2:7 Tuple |-TemplateTypeParmDecl 0x20423924da0 col:16 referenced class depth 0 index 0 T `-CXXRecordDecl 0x20423924e70 line:2:7 class Tuple definition |-DefinitionData standard_layout trivially_copyable has_user_declared_ctor can_const_default_init | |-DefaultConstructor | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param | |-MoveConstructor exists simple trivial needs_implicit | |-CopyAssignment simple trivial has_const_param needs_implicit implicit_has_const_param | |-MoveAssignment exists simple trivial needs_implicit | `-Destructor simple irrelevant trivial needs_implicit |-CXXRecordDecl 0x20423925198 col:7 implicit referenced class Tuple |-AccessSpecDecl 0x20423925228 col:1 public |-CXXConstructorDecl 0x20423925430 col:5 Tuple 'void (const T *)' implicit-inline | |-ParmVarDecl 0x204239252d0 col:20 pTup 'const T *' | `-<<>> |-AccessSpecDecl 0x204239254e8 col:1 protected `-FieldDecl 0x20423925600 col:7 m_tup 'T[3]' ``` Maybe I can simplify this problem by giving ```<<>>```. I would be very grateful if someone knowledgeable in this area could offer me some advice. ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 120388] Suggest include file for popular standard functions
Issue 120388 Summary Suggest include file for popular standard functions Labels enhancement, clang:frontend, clang:diagnostics Assignees Reporter tbaederr If, e.g. write: ```c++ int main() { std::cout << "Hello world\n"; } ``` I think it would be nice for the compiler to suggest importing ``. If I later write ```c++ #include int main() { std::cout << "Hello world\n"; int a = 0, b = 0; std::memcpy(&a, &b, 4); } ``` it would be nice if it suggested importing ``. I think a simple internal list of popular functions would be enough, we don't need to get fancy here. I don't know if this collides with functionality that clangd or similar tools already provide though. Popular D compilers have similar functionality: ```console ~ » cat test.d void main() { writeln("hello world"); } ~ » ldc2 test.d test.d(7): Error: `writeln` is not defined, perhaps `import std.stdio;` is needed? ``` ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 120394] [clang-cl] Generates bad manifest XML for Visual Studio UAC settings
Issue 120394 Summary [clang-cl] Generates bad manifest XML for Visual Studio UAC settings Labels new issue Assignees Reporter d3x0r This is an example of where the settings get set.  Clang-CL generates XML that looks like this ``` xml ``` Where a good manifest looks like ``` xml ``` When the clang generated manifest is used in the program the porgram throws a 'side-by-side installation error' sort of error... `The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.` when using the sxstrace tool gave me an error message when I did a profile and converted it to a log... ``` ERROR: Line 6: The required attribute level is missing from element requestedExecutionLevel. ``` `level` is what it's looking for not `ms_asmv1:level` apparently. There's no automatic namespacing of tags in most path/node based xml parsers I could fall back and run a `mt.exe ...` command and embed a correct manifest while this is broken... but really respecting the options and building the file should work. This causes a service or admin tool to not be able to run. ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 120405] [RISCV] vp.merge of nxv16i1 tries to be unrolled
Issue 120405 Summary [RISCV] vp.merge of nxv16i1 tries to be unrolled Labels backend:RISC-V Assignees Reporter lukel97 After #101641, this vp merge began to be emitted from the loop vectorizer with EVL tail folding from SPEC CPU 2017: ```llvm define @f( %m, %x, %y, i32 %evl) { %1 = tail call @llvm.vp.merge.nxv16i1( %m, %x, %y, i32 %evl) ret %1 } ``` It crashes with `llc -mtriple=riscv64 -mattr=+v` with `LLVM ERROR: Invalid size request on a scalable vector.` because it tries to unroll it when legalizing vector ops. The DAG after type legalization looks like: ``` Type-legalized selection DAG: %bb.0 'f:' SelectionDAG has 15 nodes: t0: ch,glue = EntryToken t2: nxv16i1,ch = CopyFromReg t0, Register:nxv16i1 %0 t4: nxv16i1,ch = CopyFromReg t0, Register:nxv16i1 %1 t6: nxv16i1,ch = CopyFromReg t0, Register:nxv16i1 %2 t8: i64,ch = CopyFromReg t0, Register:i64 %3 t18: i64 = and t8, Constant:i64<4294967295> t12: nxv16i1 = vp_merge t2, t4, t6, t18 t15: ch,glue = CopyToReg t0, Register:nxv16i1 $v0, t12 t16: ch = RISCVISD::RET_GLUE t15, Register:nxv16i1 $v0, t15:1 ``` ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 120407] clang-cl crash om windows
Issue 120407 Summary clang-cl crash om windows Labels new issue Assignees Reporter jtveiten 1>PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. 1>Stack dump: 1>0. Program arguments: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -cc1 -triple amd64-pc-windows-msvc19.42.34435 -emit-obj -mincremental-linker-compatible -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mdeventbus.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=none -relaxed-aliasing -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -fms-volatile -funwind-tables=2 -target-cpu x86-64 -target-feature +sse4.2 -mllvm -x86-asm-syntax=intel -tune-cpu generic -D_MT -D_DLL --dependent-lib=msvcrt --dependent-lib=oldnames -stack-protector 2 -fcxx-exceptions -fexceptions -fasync-exceptions -fdefault-calling-conv=cdecl -fdiagnostics-format msvc -gno-column-info -gcodeview -debug-info-kind=constructor -fdebug-compilation-dir=C:\\Users\\JanTveiten\\source\\repos\\paleoscan\\eventbus -object-file-name=C:\\Users\\JanTveiten\\source\\repos\\paleoscan\\eventbus\\x64\\Clang_Release\\mdeventbus.obj -ffunction-sections -fcoverage-compilation-dir=C:\\Users\\JanTveiten\\source\\repos\\paleoscan\\eventbus -resource-dir "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\Llvm\\x64\\lib\\clang\\18" -I x64\\Clang_Release\\moc -I . -I C:\\Users\\JanTveiten\\source\\repos\\paleoscan\\json\\single_include -I include -I release -I C:\\Users\\JanTveiten\\source\\repos\\paleoscan\\ -I C:\\Users\\JanTveiten\\source\\repos\\paleoscan\\eventbus\\ -I C:\\Users\\JanTveiten\\source\\repos\\paleoscan\\eventbus\\ -I C:\\QT\\qt5.15.13_msvc2019\\qtbase\\include -I C:\\QT\\qt5.15.13_msvc2019\\qtbase\\include\\QtGui -I C:\\QT\\qt5.15.13_msvc2019\\qtbase\\include\\QtCore -I C:\\QT\\qt5.15.13_msvc2019\\qtbase\\mkspecs\\win32-msvc -I x64\\Clang_Release\\moc -D _WINDOWS -D UNICODE -D _UNICODE -D WIN32 -D _ENABLE_EXTENDED_ALIGNED_STORAGE -D WIN64 -D OPENMP_ENABLED -D _EXPORTINGEVENTBUS -D NDEBUG -D QT_NO_DEBUG -D QT_PLUGIN -D _WINDOWS -D WIN32 -D _ENABLE_EXTENDED_ALIGNED_STORAGE -D WIN64 -D NDEBUG -D QT_NO_DEBUG -D QT_GUI_LIB -D QT_CORE_LIB -D _WINDLL -internal-isystem "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\Llvm\\x64\\lib\\clang\\18\\include" -internal-isystem "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\Llvm\\x64\\lib\\clang\\18\\include" -internal-isystem "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.42.34433\\include" -internal-isystem "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.42.34433\\atlmfc\\include" -internal-isystem "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Auxiliary\\VS\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\ucrt" -internal-isystem "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Auxiliary\\VS\\UnitTest\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\um" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\shared" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\winrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\cppwinrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\Include\\um" -internal-isystem "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.42.34433\\include" -internal-isystem "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.42.34433\\atlmfc\\include" -internal-isystem "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Auxiliary\\VS\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\ucrt" -internal-isystem "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Auxiliary\\VS\\UnitTest\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\um" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\shared" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\winrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\cppwinrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\Include\\um" -O2 -Wall -Wno-error -Werror=c++11-compat-deprecated-writable-strings -Werror=c++11-compat-
[llvm-bugs] [Bug 120389] [AVX-512] `movemask(u8) & 1` generates `and al, 1` + `movzx eax, al` instead of `and eax, 1`
Issue 120389 Summary [AVX-512] `movemask(u8) & 1` generates `and al, 1` + `movzx eax, al` instead of `and eax, 1` Labels new issue Assignees Reporter Validark Zig version: ([Godbolt](https://zig.godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(filename:'1',fontScale:14,fontUsePx:'0',j:1,lang:zig,selection:(endColumn:1,endLineNumber:8,positionColumn:1,positionLineNumber:8,selectionStartColumn:1,selectionStartLineNumber:8,startColumn:1,startLineNumber:8),source:'export+fn+doo(b:+u8)+u64+%7B%0Areturn+((b+%3E%3E+0)+%26+1)%3B%0A%7D%0A%0Aexport+fn+zoom(args:+@Vector(8,+i64))+u64+%7B%0Areturn+doo(@bitCast(args+%3C+@as(@TypeOf(args),+@splat(0%3B%0A%7D%0A'),l:'5',n:'0',o:'Zig+source+%231',t:'0')),k:50,l:'4',m:100,n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:ztrunk,filters:(b:'0',binary:'1',binaryObject:'1',commentOnly:'0',debugCalls:'1',demangle:'0',directives:'0',execute:'1',intel:'0',libraryCode:'0',trim:'1',verboseDemangling:'0'),flagsViewOpen:'1',fontScale:14,fontUsePx:'0',j:1,lang:zig,libs:!(),options:'-O+ReleaseFast+-mcpu%3Dznver5+-target+x86_64-linux',overrides:!(),selection:(endColumn:24,endLineNumber:15,positionColumn:24,positionLineNumber:15,selectionStartColumn:24,selectionStartLineNumber:15,startColumn:24,startLineNumber:15),source:1),l:'5',n:'0',o:'+zig+trunk+(Editor+%231)',t:'0')),header:(),k:50,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4)) ```zig export fn doo(b: u8) u64 { return ((b >> 0) & 1); } export fn zoom(args: @Vector(8, i64)) u64 { return doo(@bitCast(args < @as(@TypeOf(args), @splat(0; } ``` LLVM version: ```llvm define dso_local range(i64 0, 2) i64 @doo(i8 zeroext %0) local_unnamed_addr { Entry: %1 = and i8 %0, 1 %2 = zext nneg i8 %1 to i64 ret i64 %2 } define dso_local range(i64 0, 2) i64 @zoom(<8 x i64> %0) local_unnamed_addr { Entry: %1 = icmp slt <8 x i64> %0, zeroinitializer %2 = bitcast <8 x i1> %1 to i8 %3 = and i8 %2, 1 %4 = zext nneg i8 %3 to i64 ret i64 %4 } ``` Compiled for znver5: ```diff doo: pushrbp mov rbp, rsp mov eax, edi and eax, 1 pop rbp ret zoom: pushrbp mov rbp, rsp vpmovq2mk0, zmm0 kmovd eax, k0 - and al, 1 - movzx eax, al + and eax, 1 pop rbp vzeroupper ret ``` ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 120400] Crash on systemz with named address space
Issue 120400 Summary Crash on systemz with named address space Labels Assignees Reporter ubizjak Following testcase: ``` #define AS __attribute__((address_space(3))) int AS m; int *foo(void) { return (int *)&m; } ``` crashes when compiled with ```clang -O2 -S``` with the following backtrace: ``` Stack dump: 0. Program arguments: /usr/bin/clang --target=systemz-linux -O2 -S -fcolor-diagnostics -o as.s as.c 1. parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module 'as.c'. 4. Running pass 'SystemZ DAG->DAG Pattern Instruction Selection' on function '@foo' #0 0x7fe111017b7a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/lib64/libLLVM.so.19.1+0x217b7a) #1 0x7fe111014b24 llvm::sys::RunSignalHandlers() (/lib64/libLLVM.so.19.1+0x214b24) #2 0x7fe110f33472 (/lib64/libLLVM.so.19.1+0x133472) #3 0x7fe110f3341f llvm::CrashRecoveryContext::HandleExit(int) (/lib64/libLLVM.so.19.1+0x13341f) #4 0x7fe11101093f (/lib64/libLLVM.so.19.1+0x21093f) #5 0x55ea3ea3feae (/usr/bin/clang+0xbeae) #6 0x7fe110f47f80 llvm::report_fatal_error(llvm::Twine const&, bool) (/lib64/libLLVM.so.19.1+0x147f80) #7 0x7fe111a98edf llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/lib64/libLLVM.so.19.1+0xc98edf) #8 0x7fe111a97eb6 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/lib64/libLLVM.so.19.1+0xc97eb6) #9 0x7fe11473a1b1 (/lib64/libLLVM.so.19.1+0x393a1b1) #10 0x7fe111a8d7dc llvm::SelectionDAGISel::DoInstructionSelection() (/lib64/libLLVM.so.19.1+0xc8d7dc) #11 0x7fe111a8ca85 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/lib64/libLLVM.so.19.1+0xc8ca85) #12 0x7fe111a8b81f llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/lib64/libLLVM.so.19.1+0xc8b81f) #13 0x7fe111a88b0f llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/lib64/libLLVM.so.19.1+0xc88b0f) #14 0x7fe114738c59 (/lib64/libLLVM.so.19.1+0x3938c59) #15 0x7fe111a86b5e llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/lib64/libLLVM.so.19.1+0xc86b5e) #16 0x7fe1114e5f48 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/lib64/libLLVM.so.19.1+0x6e5f48) #17 0x7febf590 llvm::FPPassManager::runOnFunction(llvm::Function&) (/lib64/libLLVM.so.19.1+0x3bf590) #18 0x7fec78c3 llvm::FPPassManager::runOnModule(llvm::Module&) (/lib64/libLLVM.so.19.1+0x3c78c3) #19 0x7febfe22 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/lib64/libLLVM.so.19.1+0x3bfe22) #20 0x7fe11a28dbf0 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr, std::unique_ptr>, clang::BackendConsumer*) (/lib64/libclang-cpp.so.19.1+0x188dbf0) #21 0x7fe11a6ff0d9 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/lib64/libclang-cpp.so.19.1+0x1cff0d9) #22 0x7fe118bf5579 clang::ParseAST(clang::Sema&, bool, bool) (/lib64/libclang-cpp.so.19.1+0x1f5579) #23 0x7fe11b42a06b clang::FrontendAction::Execute() (/lib64/libclang-cpp.so.19.1+0x2a2a06b) #24 0x7fe11b386514 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib64/libclang-cpp.so.19.1+0x2986514) #25 0x7fe11b4b57bd clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/lib64/libclang-cpp.so.19.1+0x2ab57bd) #26 0x55ea3ea3f516 cc1_main(llvm::ArrayRef, char const*, void*) (/usr/bin/clang+0xb516) #27 0x55ea3ea3b7b7 (/usr/bin/clang+0x77b7) #28 0x7fe11af580fd (/lib64/libclang-cpp.so.19.1+0x25580fd) #29 0x7fe110f33400 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref) (/lib64/libLLVM.so.19.1+0x133400) #30 0x7fe11af57975 clang::driver::CC1Command::Execute(llvm::ArrayRef>, std::__cxx11::basic_string, std::allocator>*, bool*) const (/lib64/libclang-cpp.so.19.1+0x2557975) #31 0x7fe11af127cd clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/lib64/libclang-cpp.so.19.1+0x25127cd) #32 0x7fe11af12b37 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl>&, bool) const (/lib64/libclang-cpp.so.19.1+0x2512b37) #33 0x7fe11af35c1b clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl>&) (/lib64/libclang-cpp.so.19.1+0x2535c1b) #34 0x55ea3ea3ab7c clang_main(int, char**, llvm::ToolContext const&) (/usr/bin/clang+0x6b7c) #35 0x55ea3ea4b8a8 main (/usr/bin/clang+0x178a8) #36 0x7fe11080f248 __libc_start_call_main (/lib64/libc.so.6+0x3248) #37 0x7fe11080f30b __libc_start_main@GL
[llvm-bugs] [Bug 120516] [CUDA] should report error for inline __device__ variable
Issue 120516 Summary [CUDA] should report error for inline __device__ variable Labels new issue Assignees Reporter aywala see [CUDA - inline variable](https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#inline-variable) A namespace scope inline variable declared with __device__ or __constant__ or __managed__ memory space specifier must have internal linkage, if the code is compiled with nvcc in whole program compilation mode. ```cpp #include __device__ inline int a = 10; __global__ void kernel() { printf("%d\n",a); } int main() { kernel<<<1,1>>>(); cudaDeviceSynchronize(); } ``` ``` nvcc report_error.cu -o report_error report_error.cu(3): error: An inline __device__/__constant__/__managed__ variable must have internal linkage when the program is compiled in whole program mode (-rdc=false) __attribute__((device)) inline int a = 10; ^ 1 error detected in the compilation of "report_error.cu". ``` but no error report with ``clang++ report_error.cu -o report_error --cuda-gpu-arch=sm_52 -L /usr/local/cuda/lib64 -lcudart -pthread`` ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 120482] [AIX] Bad codegen passing packed aggregates containing PPC vectors
Issue 120482 Summary [AIX] Bad codegen passing packed aggregates containing PPC vectors Labels platform:aix Assignees Reporter hubert-reinterpretcast Consider (with `-DPACKED`): ```cpp extern "C" { struct #if PACKED __attribute__((__packed__)) #endif A { vector unsigned int x; }; void g(void *p); void f(unsigned long, A a) { g(&a); } } ``` As a packed structure, arguments of type `A` should be passed without special treatment for 16-byte alignment (https://www.ibm.com/docs/en/aix/7.3?topic=sequence-argument-passing); however, the 16-byte alignment behaviour is observed whether `-DPACKED` is specified or not. Online compiler link: https://godbolt.org/z/314ddxcb7 Compiler invocation command: ``` clang++ --target=powerpc64-ibm-aix -DPACKED -O -S -o - -emit-llvm packedvecpassing.cc ``` Actual output (partial): ``` define void @f(i64 noundef %0, ptr noundef byval(%struct.A) align 16 %a) local_unnamed_addr #0 { ``` Expected output (partial): ``` define void @f(i64 noundef %0, ptr noundef byval(%struct.A) align 8 %a) local_unnamed_addr #0 { ``` ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 120489] [mlir] `--canonicalize=disable-patterns=` doesn't work
Issue 120489 Summary [mlir] `--canonicalize=disable-patterns=` doesn't work Labels mlir Assignees jpienaar, ftynse, joker-eph Reporter makslevental If you try to specify `--canonicalize=disable-patterns=RemoveLoopInvariantArgsFromBefor...` you will not get the expected result (that none of these patterns are applied). Why? Because patterns [labels](https://github.com/llvm/llvm-project/blob/6ae7f66ff5169ddc5a7b9ab545707042c77e036c/mlir/lib/Rewrite/FrozenRewritePatternSet.cpp#L101) are their entire `typename`: ``` FoldTensorCastPackOp FoldTensorCastProducerOp CanonicalizeConvertFromConvert CanonicalizeConvertFromReshape CanonicalizeConvertFromHistogram CanonicalizeConvertFromAlloc CanonicalizeConvertFromLocalStore CanonicalizeConvertFromSplit (anonymous namespace)::InsertSliceOpConstantArgumentFolder (anonymous namespace)::InsertSliceOpCastFolder (anonymous namespace)::InsertSliceOpSourceCastInserter (anonymous namespace)::FoldStaticZeroPadding (anonymous namespace)::FoldSourceTensorCast (anonymous namespace)::FoldTargetTensorCast (anonymous namespace)::FoldOrthogonalPaddings (anonymous namespace)::FoldStaticPadding (anonymous namespace)::FoldConsecutiveConstantPadding (anonymous namespace)::InsertSliceOpConstantArgumentFolder (anonymous namespace)::InsertSliceOpCastFolder (anonymous namespace)::InsertSliceOpSourceCastInserter (anonymous namespace)::ExtractFromTensorGenerate (anonymous namespace)::StaticTensorGenerate (anonymous namespace)::ExtractElementFromIndexCast mlir::OpWithOffsetSizesAndStridesConstantArgumentFolder (anonymous namespace)::ExtractSliceOpCastFolder (anonymous namespace)::ExtractFromTensorCast mlir::ComposeReassociativeReshapeOps mlir::ComposeExpandOfCollapseOp (anonymous namespace)::ConvertToStaticExpandShape (anonymous namespace)::FoldReshapeWithConstant (anonymous namespace)::FoldReshapeWithSplat (anonymous namespace)::FoldReshapeWithFromElements (anonymous namespace)::FoldDimOfExpandShape (anonymous namespace)::FoldDimOfCollapseShape (anonymous namespace)::FoldEmptyTensorWithCastOp (anonymous namespace)::FoldEmptyTensorWithDimOp (anonymous namespace)::ReplaceEmptyTensorStaticShapeDims (anonymous namespace)::DimOfCastOp (anonymous namespace)::DimOfDestStyleOp (anonymous namespace)::DimOfReshapeOp (anonymous namespace)::SingleInputConcatOp mlir::ComposeReassociativeReshapeOps mlir::ComposeCollapseOfExpandOp (anonymous namespace)::FoldReshapeWithConstant (anonymous namespace)::FoldReshapeWithSplat (anonymous namespace)::FoldReshapeWithFromElements (anonymous namespace)::FoldCollapseOfCastOp (anonymous namespace)::ChainedTensorCast (anonymous namespace)::TensorCastExtractSlice (anonymous namespace)::ChainedTensorBitcast (anonymous namespace)::FoldComponentNeg (anonymous namespace)::FoldComponentNeg MergeComplexBitcast MergeArithBitcast (anonymous namespace)::SimplifyAffineOp (anonymous namespace)::SimplifyAffineOp (anonymous namespace)::SimplifyAffineOp (anonymous namespace)::SimplifyAffineOp CanonicalizeSingleResultAffineMinMaxOp DeduplicateAffineMinMaxExpressions MergeAffineMinMaxOp (anonymous namespace)::SimplifyAffineOp CanonicalizeAffineMinMaxOpExprAndTermOrder CanonicalizeSingleResultAffineMinMaxOp DeduplicateAffineMinMaxExpressions MergeAffineMinMaxOp (anonymous namespace)::SimplifyAffineOp CanonicalizeAffineMinMaxOpExprAndTermOrder (anonymous namespace)::SimplifyAffineOp (anonymous namespace)::CancelLinearizeOfDelinearizeExact (anonymous namespace)::DropLinearizeLeadingZero (anonymous namespace)::DropLinearizeUnitComponentsIfDisjointOrZero (anonymous namespace)::SimplifyDeadElse (anonymous namespace)::AlwaysTrueOrFalseIf (anonymous namespace)::AffineForEmptyLoopFolder (anonymous namespace)::CancelDelinearizeOfLinearizeDisjointExactTail (anonymous namespace)::DropUnitExtentBasis (anonymous namespace)::SplitDelinearizeSpanningLastLinearizeArg (anonymous namespace)::SimplifyAffineOp (anonymous namespace)::EraseRedundantGpuWaitOpPairs (anonymous namespace)::SimplifyGpuWaitOp (anonymous namespace)::EraseTrivialCopyOp FoldLaunchArguments (anonymous namespace)::SimplifyDimOfAllocOp mlir::triton::CanonicalizeMaskedStorePattern mlir::triton::CanonicalizeMaskedLoadPattern (anonymous namespace)::SimplifyConstCondBranchPred (anonymous namespace)::SimplifyPassThroughCondBranch (anonymous namespace)::SimplifyCondBranchIdenticalSuccessors (anonymous namespace)::SimplifyCondBranchFromCondBranchOnSameCondition (anonymous namespace)::CondBranchTruthPropagation (anonymous namespace)::RemoveLoopInvariantArgsFromBeforeBlock (anonymous namespace)::RemoveLoopInvariantValueYielded (anonymous namespace)::WhileConditionTruth (anonymous namespace)::WhileCmpCond (anonymous namespace)::WhileUnusedResult (anonymous namespace)::WhileRemoveDupl
[llvm-bugs] [Bug 120503] [Clang] constexpr variables wrongfully treated as captures
Issue 120503 Summary [Clang] constexpr variables wrongfully treated as captures Labels clang Assignees Reporter yuxuanchen1997 Clang currently rejects the following program by saying "error: variable 'XXXcap' cannot be implicitly captured in a lambda with no capture-default specified" ``` template struct tag_t {}; template struct vtag_t {}; template inline constexpr vtag_t vtag{}; template constexpr bool alt = true; template auto vtag_safety_of_non_stored_args() { return [](tag_t) { return vtag<[]() { constexpr bool XXXcap = alt; if constexpr (XXXcap) { return vtag<>; } else { return vtag; } }>; }(tag_t{}); } void check() { vtag_safety_of_non_stored_args(); } ``` This seems wrong. As `XXXcap` here is not a capture. GCC and MSVC seem to have no problem with this. See compiler explorer: https://godbolt.org/z/7rqcfGe7x ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs