L
On a code review, I copy-pasta’ed “try to separate formatting or whitespace changes from functional changes, either by correcting the format first (ideally) or afterward.” from LLVM Developer Policy - LLVM The author observed (correctly) that that quote is part of an “if” block: If you have recently been granted commit access, these policies apply: … You are allowed to commit patches without approval which you think are obvious. … Also, try to separate formatting or whitespace changes from…
L
The meeting this Friday is “on”. Agenda: follow up (feedback, unfinished discussions) from the workshop. Meeting link and more details on how to join - in the usual agenda document. 1 post - 1 participant Read full topic
L
Here are the notes from the runtimes workshop last week. Notes are by me unless otherwise specified. I’ll try to get the presentations posted soon. If you’d like any updates to the notes feel free to email me or message me on discord. Thank you everyone who attended! LLVM + Linux (Notes by Petr Hosek and Michael Jones) LLVM/Linux if you prefer Linux implies GNU (typically), you might use some pieces that are not GNU (LLVM, musl), but you generally have to adapt to the GNU shaped hole A new door…
L
Hi, Something I brought up at the debug-info roundtable at the conference, and shared here for wider feedback: I’d like to sunset and eventually delete the “old” way of representing variable locations after instruction selection. This forces some work onto target maintainers, reduces some general maintenance burden, and is necessary step for removing debug instructions after isel. Background: LLVM post-isel used to define the register-location and instruction-position of a variable assignment…
L
I am currently working on CIR over Enzyme. About three weeks ago, I submitted a patch to wire some CIR ops to ViewLikeOpInterface (PR #230897). However, this causes MLIR’s core Local Alias Analysis (LAA) to return MustAlias for two views with different offsets, as they are based on the same underlying object. Therefore, I proposed another change to add an interface method indicating whether a view may overlap with other views in PR #231285. This allows LAA to return MayAlias and hand the…
L
I’ve been looking at using DataFileCache for some additional use cases, and I don’t think I’m doing a great job of making the settings understandable. I wanted to see what anyone (Greg especially) might think. Today we have these settings for the DataFileCache, symbols.enable-lldb-index-cache default off symbols.lldb-index-cache-expiration-days default 7 symbols.lldb-index-cache-max-byte-size symbols.lldb-index-cache-max-percent symbols.lldb-index-cache-path These allow the user to control…
L
LLVM Weekly - #670, November 2nd 2026 If you prefer, you can read the canonical version of this issue at https://llvmweekly.org/issue/670. Welcome to the six hundred and seventieth issue of LLVM Weekly, a weekly newsletter (published every Monday) covering developments in LLVM, Clang, and related projects. LLVM Weekly is brought to you by Alex Bradbury. Subscribe to future issues at https://llvmweekly.org and pass it on to anyone else you think may be interested. Please send any tips or…
L
Hi, There are several discussion on what the optimization levels do. My question is, which optimization level is used in practice to compile medium and large code bases (i.e. thousands to millions of loc) in actual products we can use. For example, I couldn’t figure out in which optimization level the llvm project itself is compiled (the download on https://releases.llvm.org/ for example for windows). 2 posts - 2 participants Read full topic
L
Let me draw the context first. In the following example, there are two reduction dimensions: r1 is a “pure reduction” dimension (only present in lhs), r2 is a “contraction” dim (present in both lhs and rhs). %res = vector.contract { indexing_maps = [ affine_map<(r1, p, r2) -> (r1, r2)>, affine_map<(r1, p, r2) -> (p, r2)>, affine_map<(r1, p, r2) -> (p)> ], iterator_types = ["reduction", "parallel", "reduction"], kind = #vector.kind<add> } %lhs, %rhs, %acc : vector<7x3xi32>, vector<2x3xi32> into…
L
Hi folks! This is a proposal to define how masking functions within the Vector dialect. It follows the discussion in #225244 and #226128, and it is related to #227821. Today an op can be masked by wrapping it in vector.mask, or by passing a mask operand. For transfer_read, transfer_write and gather both are legal at the same time, and nothing says what the combination means. The RFC in one sentence: An op must have exactly one mask and can be masked in only one way, either via vector.mask or…
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
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 2 posts - 2 participants Read full topic
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
Hi all! I have not been receiving emails from the flang-commits list this week, and I don’t think it’s because people aren’t sending messages. We had a problem like this almost a year ago and the solution then was to clear out disk space. I am only a list moderator and don’t have this ability. I believe my message to Mailman to report the issue bounced. Any advice on how to get the list un-stuck? Thanks! 3 posts - 3 participants Read full topic
L
Here is what I’ve got so far: LLVMPassManagerRef FPM = NULL; ... FPM = LLVMCreateFunctionPassManagerForModule(module); ... int optim = LLVMRunFunctionPassManager(FPM, TheFunction); printf("optimized? %i\n", optim); For the example in the fource chapter of the Kaleidoscope tutorial I get: kal> def test(x) (1+2+x)*(x+(1+2)); kal> Parsed a function definition. optimized? 0 define double @test(double %x) { entry: %addtmp = fadd double 3.000000e+00, %x %addtmp1 = fadd double %x, 3.000000e+00 %multmp…
L
The C API functions LLVMAddFunction and LLVMGetNamedFunction both return a LLVMValueRef. Unwrapping a LLVMValueRef (with unwrap) yields a *Value - not surprisingly. But do I get from there to a llvm::Function? I’ve looked at both Value.h and Function.h and found no obvious way to convert between the two. 2 posts - 2 participants Read full topic
L
I have a situation in which I want to ensure MLIR passes preserve a particular kind of metadata about SSA values. This includes my own passes but also upstream and other out-of-tree passes that may inadvertently drop this metadata depending on how it’s represented. The two approaches I have heard people take are: Find a way to encode the metadata in Location, which most passes are pretty good at preserving due to the requirement to populate an op with a Location at creation time. Encode the…
L
Recently, while reviewing a PR addressing a good first issue, I ran into some confusion: the author was a first-time contributor and disclosed their use of an LLM, for example, to learn about Clang’s code and understand the relevant context. However, I wasn’t quite sure whether these uses violated the current policy. The current AI tool policy states that AI tools must not be used to fix good first issues. However, the explanation in the same paragraph also refers to fully automating the…
L
Note: This is a continuation of [RFC] TableGen support for RegisterBankInfo - Code Generation / Common CodeGen Infrastructure - LLVM Discussion Forums. Proposal This RFC tries to provide a way to define register bank mapping rules by matching TypedOperands, with generating time checks. Following tablegen classes are introduced: class RegBankTypeMapping<RegisterBank bank, TypedOperand type> { RegisterBank Bank = bank; TypedOperand Type = type; } class RegBankMappingRule<list<RegBankTypeMapping>…
L
Summary I propose to add a new calling convention (tentatively named tail_chaincc) to LLVM and Clang. This new convention is intended to be used with [[clang::musttail]] in C and C++ (and any other language that wants to use guaranteed tail calls with LLVM, e.g. become in Rust) and is designed to address several practical issues we have encountered when using tail calls. This new convention combines the callee-cleanup mechanics of tailcc with the register optimizations of preserve_none, leading…
L
In the fource chapter of the Kaleidoscope tutorial on line 594: PassBuilder PB(*TheContext); I get an error: there is no constructor for PassBuilder accepting a LLVMContext. Indeed, I looked at PassBuilder.h and couldn’t find one. What is going on here? Is the tutorial outdated? How to resolve this? I’m on llvm version 22.1.8, release 4.fc44 2 posts - 2 participants Read full topic
L
Thanks @lenary for hosting. RISC-V’s roundtable this year attracted (a lot) more attendees compared to last year (I believe Sam wrote down some of the names?). We didn’t spend lots of time on specific topics, mostly just did a quick round on topics / questions people can think of. Here are the notes: Embedded PIC (ePIC): the general consensus is try to have a single ABI rather than, say 5 of them The x86lint / armlint’s author shared some details on the tools. Specifically, the patterns used by…
L
LLVMContextRef is the C representation of LLVMContext. I found this typedef in Types.h: typedef struct LLVMOpaqueContext *LLVMContextRef; I could not find LLVMOpaqueContext though. So, how do I get to the underlying LLVMContext? 2 posts - 2 participants Read full topic
L
See [flang] Segmentation fault (parser stack overflow) on expressions nested about 600 parentheses or 418 function calls deep · Issue #236881 · llvm/llvm-project · GitHub . Should flang perhaps support -fbracket-depth like clang does? Where would it matter in practice? I’ve seen lots of automatically generated Fortran code from customers that has weird constructs, which are taxing on the parser and semantic analysis. I haven’t seen this particular case, but since clang supports a similar limit,…
L
Seven backends still carry a hand-written legalizer rule chain plus a line saying it should be generated (AArch64, AMDGPU, ARM, M68k, Mips, RISCV, X86 – “\todo This should be generated by TableGen”, in tree since 2016/2017). The other three GlobalISel subsystems already have a TableGen backend: -gen-global-isel, -gen-global-isel-combiner, -gen-register-bank. Legalization is the last one without one. I built a prototype: a -gen-legalizer backend (not upstream) plus X86 converted to a .td.…
L
Hi, Is there a reason why GitHub issues are not enabled on the LLVM Test Suite repository? It would seem useful to be able to track problems/improvements with the test suite directly in that repo, instead of having to do that from the monorepo. Cheers, Louis 7 posts - 6 participants Read full topic
L
Would a C counterpart to -stdlib++-isystem be an acceptable addition to Clang? It would let us supply explicit libc header roots while the driver preserves its target-specific ordering relative to C++ and builtin headers. Motivation I maintain hermetic-llvm, a hermetic LLVM-based Bazel toolchain for cross-compilation. Its compiler, libc, Linux UAPI, and C++ library headers are separate build inputs, rather than a preassembled target sysroot. It is also the @llvm toolchain selected by LLVM’s own…
L
Hey everyone, Following up on the LICM bug we discussed in #233213, the initial fix in #235770, and and our recent thread on [arith integer division and remainder UB semantics]( UB Op Semantics of `arith` Integer Division / Remainder ) I decided to run a quick static audit across ~20 dialect .td files in MLIR. I wanted to see how common it is for an op to be marked Pure (or AlwaysSpeculatable), while its docs actually mention Undefined Behavior, trapping, or potential traps in regions. Since…
L
I’ve been working on adding proper Xbox 360 target support to LLVM and wanted to discuss some architectural/design things before continuing on with the entire set of changes. For context/motivation, please read the main body of this PR: Add plumbing for Xbox 360 target by landaire · Pull Request #235915 · llvm/llvm-project · GitHub @alexrp helpfully pointed out that the existing PS3 target (Lv2) is similar to Xbox 360, and I’ve been refactoring a bit to try to share logic where possible. The…
L
Hi All, One of the biggest obstacles that I hear about from internal and external customers re: hesitancy to use LTO for application builds is the difficulty in debugging issues when problems arise. Even though an application appears to be working fine without LTO enabled, some issues don’t get exposed until cross-module optimizations are turned on in the LTO recompile. Has there been any exploration into adding debug information during an LTO recompile to help with debugging an application…