L
I don’t think we should assume contributors are being dishonest simply because we cannot independently verify their statements. Admittedly, overly strict bans may also discourage people from disclosing their use of LLMs. If a contributor says they wrote the code themselves, we should initially accept that statement in good faith(However, reviewers in the community are already under considerable pressure, and that may also be worth discussing.). If specific concerns arise during review, such as…
L
Checking CFI is worthwhile: #220720 shows that clang ships wrong x86 CFI that nothing in-tree catches. However, I am not convinced that the next step is a semantic expression type in MC. The checker produces false errors on correct compiler output. I compiled llvm/lib/Support/APInt.cpp with clang -S -O2 (190 functions) and ran llvm-mc --validate-cfi --filetype=null on the result. It reports 200 errors and 1866 warnings. Every error is did not modify CFA register RSP but changed CFA rule at a…
L
ChenMiao: If newcomers develop a habit of relying on LLMs from the outset, they may find it difficult to break that dependence. I think this is what @shafik and others in the community are concerned about: do contributors genuinely understand the problem and come up with a solution themselves, or do they merely understand what the LLM has told them? that is a valid concern, i think the risk isn’t using an LLM, it’s letting it do the thinking. learning from it and then diagnosing and deciding…
L
A C counterpart to -stdlib++-isystem, driver-only (no cc1) option, sounds reasonable to me. The name -cstdlib-isystem fits: -stdlib= selects the C++ library and --cstdlib= selects the C library (newlib/picolibc/llvm-libc). A plain -stdlib-isystem would read as the C++ one. What it replaces. Please specify the exact set. After the resource directory, Linux::AddClangSystemIncludeArgs adds multilib variant directories, getStdlibIncludePath(), /usr/local/include, the GCC installation’s include…
L
Strawman alternative: int f(int x) { __checked_overflow { return x * 2; } __overflowed { return -1; } } try-catch-style control flow should be familiar to most programmers, and it’s easier to reason about. I don’t think we should encourage using “goto”. If kernel programmers really want, they can stick a “goto” in the __overflowed block, or stick the whole thing in a statement expression, or both.
L
We could go even one step further: disallowing index on all arith dialect operations. We have a dedicated index dialect. Various other arith op folders are broken when operating on index SSA values. Some examples, found with a coding agent: module attributes { dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<index, 32>> } { // For %x = 7, the correct result is max(7, -1) = 7. func.func @maxsi_ssa(%x: index) -> index { %c = arith.constant 9223372036854775807 : index %r = arith.maxsi %x, %c : index…
L
@infra-area-team this one’s probably on us (though turning down the mailing lists would be ideal, we still haven’t quite figured out good replacements to point folks to)
L
StarOne01: most good first issues involve very few lines, but understanding the compilation flow and acquiring the necessary background knowledge (how does this pass work, what does this helper do?) takes a huge amount of time. i think LLMs can be very beneficial there, as long as the person still decides where the change goes and writes it themselves. I understand your point. However, good-first-issues are meant for newcomers to work through themselves. They are usually relatively…
L
MickeyKnox: Is it possible to somehow do the linking of the C++ standard library for the library I’m creating while creating it and not have to worry about it when compiling my C app? If you build a shared library, you link that (preferably with the C++ compiler driver) against libstdc++ (that’s also what LLVM does for the libLLVM.so). If you build a static library, you have to ensure yourself that you link the final executable/shared library against all transitive dependencies (usually a build…
L
Thank you both, I managed to link to the C++ standard libray with-lstdc++and it works. However, this is not really what I want to do. I think my question should rather be: “How to create a C API for a C++ project?” (even if the C++ project is just one small file). All I could find on the topic boils down to declare the functions extern "C". That did work for my minimal example, but it doesn’t seem to cut it for something real. Is it possible to somehow do the linking of the C++ standard library…
L
i think using LLMs to understand context (especially as a newbie) is a good thing to do. even when a person is good with compiler theory, C++, understanding of the hardware target etc. (everything their particular issue requires, an ideal case) they can still get stuck on a good first issue if they’re not familiar with the codebase. they may know in principle what the fix should do, but not how things are done here, because of the size of the codebase, the levels of abstraction and the…
L
Agreed, build-time docstring parsing is a dead end. Better to focus on structural invariants or opt-in traits rather than text analysis. Let’s look at trait-based checks if we ever revisit a lint
L
Matthias, spot on. Natural language docstrings are too brittle for reliable checks. Your flag-based pattern is much cleaner—definitely the right way to handle these edge cases without breaking LLVM compatibility.
L
@FedericoBruzzone Thank you for the sharp critique—these are exactly the questions I was hoping to surface. To be fully transparent: the 56 count in the post was indeed raw output from a keyword-matching regex script. It was a “smoke test” to see if the problem was significant enough to warrant an RFC. You are absolutely right that this approach is prone to both false positives (e.g., distinguishing “undefined value” vs. “immediate trap”) and false negatives (missed traits via deep…
L
Nice work on the overflow flag, @matthias-springer. This confirms the ‘opt-in’ flag approach is the cleanest path for these edge cases without breaking default LLVM compatibility.
L
Yes, I think it’s a good idea to explore and to find some reasonable signals to “just-in-time clone”. The sketch at https://github.com/llvm/llvm-project/pull/229402 implements an “always clone” mode, which is meant exactly as a method to evaluate if there are perf opportunities that the hinted-only cloning wouldn’t find. I plan to use that on a broader set of codebases/benchmarks I have, but I’d of course encourage anyone else to explore in similar ways.
L
You’re mixing C and C++ without linking C++ libraries. Either include it manually or compile everything to an object file and then have a single link step that invokes clang++ so you get the default C++ library linked.
L
The addui_extended, subui_extended, mulsi_extended, and mului_extended operations return a carry, borrow, or high half. The value of these results inherently depends on the bit width. The index type has no fixed width until it is lowered, but the folders compute at 64 bits. Because of this, results currently depend on pass order. For example, mului_extended 65536, 65536 : index folds its high half to 0, but lowering to SPIR-V (32-bit index) first gives 1. Index operands also trigger a…
L
Thank you @snehasish and @teresajohnson for sharing your thoughts. I agree with the points raised. @gulfemsavrun , please feel free to drop instrumentation-based profile support from your patch if maintaining both formats adds extra complexity. I was suggesting it mainly to keep sample-based memory profiling independent of sample-based code profiling. On AMD, IBS and LBR are independent event streams, as IBS PMU doesn’t handle LBR (link). However, I don’t think the additional maintenance burden…
L
I’ve noticed something similar with [llvm-bugs] - I agree disk space sounds likely. Anyone know who handled this in past?
L
boomanaiden154-1: Something is not clear here. you might have misunderstood my original question. The current situation: if I want to test an upstream PR with the downstream CI, I have to cherry-pick the patch onto the corresponding downstream branch, which is not llvm/main and which will often give me merge conflicts. That prevents easy automation for this type of testing. Even though AI is not bad at resolving these conflicts, you always have to check manually. That’s why I wondered how the…
L
It’s almost always just: Why is <small feature> not available in MLIR?, PR welcome.
L
I believe a canonicalisation is missing for this construct %cst = arith.constant 1.0 : f64 %dim = arith.constant 4 : index %splat = tensor.splat %cst[%dim] : tensor<?xf64> which could be canonicalised to %cst = arith.constant 1.0 : f64 %splat = tensor.splat %cst: tensor<4xf64> %casted = tensor.cast %splat : tensor<4xf64> to tensor<?xf64> Is there a reason why this is not done? If it’s just an oversight, I’m happy to open a PR
L
I agree, @matthias-springer. That’s exactly the kind of false negative I had in mind. Just to be clear. By false positives I meant ops that match the keywords but are fine to speculate, e.g., ops whose result is just undefined in some cases - the script would emit them. By false negatives I meant ops that can actually crash but aren’t caught, either because the docs use different wording or because they say nothing at all - the script wouldn’t emit them. The second one is the worrying one,…
L
Thanks @rengolin — and yes, that’s what I meant, though your model is stricter than my draft, and I’d like to adopt it. Concretely, what I’ll proceed with: In-tree piece stays minimal: one target under mlir/tools/ following the mlir-parser-fuzzer conventions (parse → parsePassPipeline → run → verify, with the fatal-error handler routed to abort() so libFuzzer records it). No campaign logic in-tree. Reporting defaults to collection, not filing: out-of-tree tooling clusters results by root-cause…
L
I think the object file compiled from LLVMOptimizationPasses.cpp references std::__throw_length_error, so the C++ standard library needs to be linked into the final executable.
L
This is probably not a llvm question, but a general C/C++ question. I’m trying to link a piece of C++ code compiled into a lib into my C project. I’ve created a minimal example without llvm and everything worked fine. This is my actual Makefile: all: pass libpass clang lexer.c parser.c list.c ast.c main.c `llvm-config --cflags --ldflags --system-libs --libs core` -lpass -L. -o kal pass: clang++ -c LLVMOptimizationPasses.cpp -o pass.o libpass: ar r libpass.a pass.o And this is the output with…
L
@Daniel-Hogan I have a stack of branches ending in msvc-abi/cir-ms-extension-pragmas at GitHub - R-Goc/llvm-project: The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. · GitHub that implement (still partial) support for MSVC ABI. Some parts of this could be useful for you. Disclaimer: this is still not enough to self build for various reasons and probably has bugs in the parts that aren’t missing. Not sure how the c++ abi looks for you but hopefully…
L
Good question. There was a long discussion in the LLVM Embedded sync-up a while ago, crossing both Arm/RISC-V: LLVM Embedded Toolchains Working Group sync up - #98 by voltur01 (this link should take you to the notes for the specific meeting in July of this year) It may be the RISC-V International psABI group is a place to discuss this, but I don’t know if Apple is a member of RVI. Some previous discussions there: FDPIC/ePIC draft specification and work plan by sorear · Pull Request #429 ·…
L
I believe archiving preserves all assets as read-only. That said, torch-mlir itself now has daily dev wheels that should not differ from the older wheels except in that they bundle newer code.