L
I created [NFC][clang][Sema] Move two tests to SemaCXX by NagyDonat · Pull Request #240864 · llvm/llvm-project · GitHub to move two “dangling” test files (one for -Wthread-safety and one for -Wuninitialized) out of the way before doing the “bulk” moves.
L
DonatNagyE: steakhal: I think we should move the CFG tests out to somewhere else because those are unrelated. Do we need to handle this right now, or is it OK if we move them now together with the StaticAnalyzer tests and relocate them in a separate change later? It’s okay to move them in the future. DonatNagyE: steakhal: The argument that they use CSA as a driver is not a solid argument. That should be changed somehow anyway. It is awkward. There are only 30 or so CFG tests, so I felt that…
L
tarunprabhu: I took that discussion to mean that the directives that @eepshteyn-nv was proposing could not be used to align common block members explicitly. It wouldn’t prevent flang for aligning them in its default way - but perhaps I misunderstood. That is my understanding too. So the default alignment and the option to toggle it (optional) in this RFC is independent from that one.
L
steakhal: I think we should move the CFG tests out to somewhere else because those are unrelated. Do we need to handle this right now, or is it OK if we move them now together with the StaticAnalyzer tests and relocate them in a separate change later? steakhal: The argument that they use CSA as a driver is not a solid argument. That should be changed somehow anyway. It is awkward. There are only 30 or so CFG tests, so I felt that they “don’t deserve” to invoke CSA from a second separate test…
L
Hi everyone, I’d like to propose adding -Xlinker=<arg> as an alternative to -Xlinker <arg>, available in Clang, clang-cl, and Flang. This is a simple change following the rationale for the existing -Xclang= alias but llvm/llvm-project#238301 advised it would be better to start a quick discussion. My main motivation is that I need to let bazel, which constructs and understands response-files with a single string per line, pass -Xlinker args to clang-cl. Any objection? cc @MaskRay for the driver…
L
Given the concerns about complexity and about adding a cross-compiler builtin, here is a much smaller alternative that only fixes the KMSAN false positives: [KMSAN] Pass clean parameter shadow to the calls in noinstr instrumentation regions by ramosian-glider · Pull Request #240784 · llvm/llvm-project · GitHub On the kernel side, under CONFIG_KMSAN, instrumentation_begin()/end() additionally emit asm volatile("# kmsan.instrumentation.begin") / "# kmsan.instrumentation.end". That is just an…
L
DonatNagyE: @steakhal @ anybody else What do you think about this? I like the proposal and it makes sense to me. One thing I’d add (so other folks following this RFC will know about it as well) is that I am currently working on adding regression tests to test/Analysis/Regression which based on my understanding of @DonatNagyE’s roadmap would also go under test/StaticAnalyzer/Regression.
L
arsenm: I think the LangRef is using overly strong wording for what this was originally intended to solve I agree this LangRef wording is likely overly strong, and isn’t the main reason to implement this. Most other parts of the compiler ignore this “must” wording too. The point is we don’t know this. There is no contract or specification mandating the lowering guarantees flushing and I don’t think it would be reasonable to try to construct one. NVPTX, Arm, x86, and AMDGPU are the main users of…
L
FedericoBruzzone: So these layers should preserve what the frontend inferred, and I’d write the split, merge and rebuild rules in 3.x as a preservation contract. Dropping a flag is always valid, but the drop should be documented as the exception, from my POV. Agreed. FedericoBruzzone: generalizeNamedOp would copy the attribute onto each generated body op. specializeGenericOp is the hard direction. If the body ops have different flags, there is no single attribute to represent them. Should it…
L
Thanks for the RFC, @mshahneo! The level of detail is very helpful. Thanks also @rengolin for the direction on blindly propagation, and @banach-space to rise the question on CIR/Flang vs LLVM approach, in #236855. I’ll leave my preliminary comments below, with the aim of guiding this dense RFC towards a narrower scope Per-op flags (point 4) I agree with per-op flags. The flags come, eventually, from the frontend (e.g., Flang/CIR/IREE/etc.), and we don’t want to recover that information - see…
L
Thanks @gysit , that is clear. I will follow LLVM and model the value as an arbitrary width integer with an unsigned flag, so there is no special case handling in the conversion. I will wait to hear from @bcardosolopes about any ClangIR plans, and meanwhile I will prepare the patch locally so that I will be ready to commit it if I get response.
L
This plan looks good to me. I think we should move the CFG tests out to somewhere else because those are unrelated. The argument that they use CSA as a driver is not a solid argument. That should be changed somehow anyway. It is awkward.
L
alfie: LLVM stores the enumerator value as an arbitrary width integer. Would you prefer an attribute that can hold an integer of any width, or a simpler 64 bit value with an unsigned flag? Without having looked into it, I would usually follow LLVM as closely as possible to avoid any special case handling in the conversion. Using a simpler 64bit value is also possible if you can proof that a legal input will always fit. For example, if the LLVM verifier checks that value fits into a 64-bit range.
L
steakhal: Can we proceed with this at the soonest this Friday and preferably finish by next week? Yes, as we discussed. steakhal: I had a chat downstream and for SSAF, we would prefer mirroring the existing/future practice to name the test dir after the library component. This leads us to clang/test/ScalableStaticAnalysis. Ok, that’s a good principle; I support it as an outsider. steakhal: There are other Analyses, such as FlowSensitive and FlowSensitive, ThreadSafety. I’m not sure if we can…
L
igorban: Unless the divisor is known to be safe, this costs a compare and a select per unsigned division and a few compares and a select per signed one, on every target. Making it free where the hardware does not trap needs an IR change, which belongs in a separate IR & Optimizations thread. You may want to take a look at llvm.masked.udiv and friends which were added recently to avoid UB in the loop vectorizer. For masked off lanes the result is poison, so for targets that don’t trap on divison…
L
Thanks @gysit , that helps a lot. I will wait to hear from @bcardosolopes before starting, so I do not duplicate any ClangIR work. If nobody is working on it, I plan to send one small patch first that adds an attribute for DIEnumerator, with bytecode support, import and export, and tests. One design question for that patch: LLVM stores the enumerator value as an arbitrary width integer. Would you prefer an attribute that can hold an integer of any width, or a simpler 64 bit value with an…
L
Hmm.. I thought this was exactly what the tombstones prevented.. I’ll try to (re)consolidate my understanding today.Thanks.
L
hi @alfie Is there interest in modeling these in the LLVM dialect, for example for ClangIR or other C++ frontends? I would assume there is interest in having a complete representation of debug info in MLIR. On our end, it is currently not the highest priority. However, as you mentioned I would expect that the for example the ClangIR project will need a complete representation. @bcardosolopes may know if anybody from the ClangIR effort is planing to work on debug info or if there is already work…
L
Hi everyone, I recently fixed a crash in the bytecode writer for DIBasicTypeAttr (#240240). While reading the debug info import and export code I noticed some gaps, and I wanted to ask before writing anything. DebugImporter does not handle llvm::DIEnumerator. When importing an enumeration type, translating each enumerator returns null, so the whole elements list of the composite type is dropped. Template parameters (DITemplateTypeParameter and DITemplateValueParameter) are never imported, and…
L
Hey @MaskRay, Thanks for investigating this in detail. I got the distinction between having a ToolSession and explicitly opting into reusable execution wrong. Since llvm-driver always creates a session, the change affected ordinary native invocations too. My tests missed that case, so my earlier statement that native behaviour remained unchanged was incorrect. I’ll leave #222531 reverted while we discuss the intended scope. To explain the goal a bit more: I’m building WasmBolt towards an…
L
This is a quick intro and summary of the current state of the work to redefine/update the large code model. The x86-64 large code model was defined decades ago to allow people to build arbitrarily large binaries. However, it is shown to not properly link large binaries (for multiple reasons, e.g. mixing small/large text, TLS), so there is support for redefining the existing large code model. https://groups.google.com/g/x86-64-abi/c/iEwXPVq48i4 is the discussion of the newly proposed large code…
L
Thanks for having a look. I’ll read through all your reviews and write again.
L
On cost versus benefit: the consumer motivating the clang and lld driver changes is currently a single project, WasmBolt , started on 2026-09-04 with one contributor. It already runs on LLVM 23.1.2 through CompilerInstance, lld::lldMain and Workers. Repeated in-process invocation of the clang and lld drivers would be a permanent support surface for every driver change. I’d want to see broader demand first, and until then keep any remaining glue in the downstream.
L
An update from the clang driver side: I reverted #222531 (multiple in-process cc1 jobs) in #240706. The RFC and the PRs describe the reusable path as something only an embedding host selects, and say native invocations do not change. That premise did not hold. llvm-driver always constructs a ToolSession, and #222531 keyed the new behavior on ToolContext::hasSession(), so every clang run through the multicall binary (LLVM_TOOL_LLVM_DRIVER_BUILD=ON, which Fuchsia ships) got it: -save-stats wrote…
L
Again you are punishing people who are doing changes in areas which get less reviews even before the LLM issue comes into play. The reason for this limiting is not for those areas but rather for areas which getting way too many patches in the first place like instcombine; clang, etc. But you are not saying one area is getting more attention than the other but rather LLVM as a whole is getting too much attention.
L
I do think there’s probably some healthy point where we should then say - you’ve learned the basics, you can be trusted not to make the same mistakes over and over again, and take some of those training wheels off - without goiong to full commit access. Some separate tier (which, honestly, might look more like the /current/ commit access requirements - which themselves should probably be tightened up I think, but that’s a debate for another time) which removes the built-in restriction, gives…
L
Yeah, I think that’s good… folks should start with only one or two PRs and focus on those, learn from them - rather than making the same mistakes on many PRs, only to be told about those mistakes by many different reviewers.
L
I agree, but I don’t think this intrinsic is enforcing any particular semantics. It returns 1 if the feature is enabled when lowered. If a particular pipeline lowers it before inlining, it returns 0 rather than 1 if the feature isn’t enabled elsewhere (there’s no scenario where it can return 1 even if the feature isn’t enabled). The frontend must emit valid IR for any branches this intrinsic might condition, just like a runtime check.
L
The semantics can’t be mandatory optimization. There must be a baseline runtime fallback
L
dblaikie: PRs not getting traction is certainly a problem, but also the one this proposal is intending to address - to discourage folks from posting a ton of PRs in the hopes that some get traction, but to focus on the ones they have open. But it is discouraging folks from posting more than a few. That is the issue I am pointing out.