Skip to content

Conversation

iclsrc
Copy link
Collaborator

@iclsrc iclsrc commented Oct 15, 2025

jwanggit86 and others added 30 commits October 1, 2025 15:31
This patch adds documentation files for GFX12.
There's a pattern throughout LLVM of cl::opts being exported. That in
itself is probably a bit unfortunate, but what's especially bad about it
is that a lot of those symbols are in the global namespace. Move them
into the llvm namespace.

While doing this, I noticed some other variables in the global namespace
and moved them as well.
This test failed during testing on the RISC-V target because we couldn't
strip the main label from the binary. main is dynamically linked when
the -fPIC flag is enabled. The RISC-V ABI requires that executables
support loading at arbitrary addresses to enable shared libraries and
secure loading (ASLR). In PIC mode, function addresses cannot be
hardcoded in the code. Instead, code is generated to load addresses from
the GOT/PLT tables, which are initialized by the dynamic loader. The
reference to main thus ends up in .dynsym and is dynamically bound. We
cannot strip main or any other dynamically linked functions because
these functions are referenced indirectly via dynamic linking tables
(.plt and .got). Removing these symbols would break the dynamic linking
mechanism needed to resolve function addresses at runtime, causing the
executable to fail to correctly call them.
…(#156952)

Comparison predicates (equal, not equal, greater than, etc.) provide important semantic information about program behavior. Previously, IR2Vec only captured that a comparison was happening but not what kind of comparison it was. This PR extends the IR2Vec vocabulary to include comparison predicates (ICmp and FCmp) as part of the embedding space.

Following are the changes:
1. Expand the vocabulary slot layout to include predicate entries after opcodes, types, and operands
2. Add methods to handle predicate embedding lookups and conversions
3. Update the embedder implementations to include predicate information when processing CmpInst instructions
4. Update test files to include the new predicate entries in the vocabulary

(Tracking issues: #141817, #141833)
Fixes llvm/llvm-project#155459 by making sure
the cases are considered in the right order. Previously intrinsics types
where overriding the pointer cases which have higher precedence in the
specification.

Also passes the following
[tests](llvm/llvm-test-suite#287).
… (#161112)

Previously, we only used `objcopy`, which is not available for some
build configurations. With this patch, we not only try to use `objcopy`,
but also try to use `llvm-objcopy` if available.

This is a follow-up of llvm/llvm-project#156383.
Refactored IR2Vec vocabulary and introduced IR (semantics) agnostic `VocabStorage`
- `Vocabulary` *has-a* `VocabStorage`
- `Vocabulary` deals with LLVM IR specific entities. This would help in efficient reuse of parts of the logic for MIR.
- Storage uses a section-based approach instead of a flat vector, improving organization and access patterns.
Fast strlen implementations (naive wide-reads, SIMD-based, and
x86_64/aarch64-optimized versions) all may perform
technically-out-of-bound reads, which leads to reports under ASan,
HWASan (on ARM machines), and also TSan (which also has the capability
to detect heap out-of-bound reads). So, we need to explicitly disable
instrumentation in all three cases.

Tragically, Clang didn't support `[[gnu::no_sanitize]]` syntax until
recently, and since we're supporting both GCC and Clang, we have to
revert to `__attribute__` syntax.
…move the fixme (#161531)

Move LowerBufferFatPointers pass after CodegenPrepare and
LoadStoreVectorizer pass, and remove the fixme about that.
It's unnecessary to build the whole symtable, and on top of everything,
un-optimal to do so for every function. All we really need is the
instrumented PGO name - considering also LTO-ness - and then we can
compute the function name.
R_AARCH64_TLSDESC_CALL is a relocation emitted as a hint for a linker to
replace `blr r` instruction with nop. BOLT does not currently require
any special handling for it.

Note that previously existing extraction of the relocated value was
incorrect.
Fold  `mulf(x, 0) -> 0` when (nnan | nsz)
  CONFLICT (content): Merge conflict in clang/lib/Driver/ToolChains/Clang.cpp
This matches what we do for regular i8 extload due to the lack of c.lb
in Zbc.

This only affects global isel because SelectionDAG won't create an
anyext i8 atomic_load today.
This patch fixes:

  llvm/lib/Analysis/IR2Vec.cpp:289:14: error: unused variable
  'allSameDim' [-Werror,-Wunused-variable]
Previously if we had a subregister extract reading from a
full copy, the no-subregister incoming copy would overwrite
the DefSubReg index of the folding context.

There's one ugly rvv regression, but it's a downstream
issue of this; an unnecessary same class reg-to-reg full copy
was avoided.
…ers (#161491)

Both Usman Nadeem and I have constantly contributed to the
DFAJumpThreading pass so far. To push DFAJumpThreading forwards and make
it enabled by default, I volunteer myself and Usman Nadeem as
DFAJumpThreading maintainers.
`Skip` parameter not used/set inside `analyzeRelocation()`.
…161624)

### Summary
Stabilize ASan wchar tests across Darwin and Android. NFC: test-only.
Follow-up to PR #160493 (adds wchar interceptors/tests).

### Motivation
- Darwin: The top frame often resolves to `libclang_rt.asan_*` rather
than a source file, so strict checks that include file/line can fail.
See Chromium issue
[448631142](https://g-issues.chromium.org/issues/448631142).
- Android: The “ERROR:” header can go to logcat instead of stderr, so
FileCheck may not see it; stdout/stderr reordering also makes pre-crash
markers racy. See Android Buildbot
[186/12821](https://lab.llvm.org/buildbot/#/builders/186/builds/12821).

### Changes
- Android:
- Force reports to stderr via `%env_asan_opts=log_to_stderr=1`, avoiding
the “ERROR:” header going to logcat.
- Print the pre-crash “Good so far.” to stderr and `fflush(stderr)` to
avoid stdout/stderr reordering.
- Darwin:
- Relax the stack-frame check to only require the function name
(`wcscpy/wcsncpy/wcscat/wcsncat`) to tolerate `libclang_rt.asan_*`
frames.
- Common:
  - Reuse FileCheck var `[[ADDR]]` instead of redefining.
- Make wide string literals `const wchar_t*` to silence
`-Wwritable-strings`.

### Risk
- NFC: test-only; no change to runtime behavior.

### References
- Follow-up to PR #160493.
- Chromium: [448631142](https://g-issues.chromium.org/issues/448631142)
(Darwin failures).
- Android Buildbot:
[186/12821](https://lab.llvm.org/buildbot/#/builders/186/builds/12821).

Signed-off-by: Yixuan Cao <[email protected]>
I'm planning to modify this file.
jsji added 2 commits October 18, 2025 10:05
2740e4b added symlinks unconditional
for non Windows.

All the sycl-in-tree tests are failing due to check_build_features
failures.
65d730b added IMG_SPIRV to be value 6, so we need to update
IMG_SYCLBIN to 7 instead.
@jsji
Copy link
Contributor

jsji commented Oct 20, 2025

@wenju-he FYI. [libclc] Workaround AMDGPU GlobalOffset assert

You can reproduce the error in GlobalOffset for AMDGPU with
bin/clang++ -Werror -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx1030 ../sycl/test-e2e/Assert/assert_in_one_kernel.cpp

@jsji
Copy link
Contributor

jsji commented Oct 21, 2025

@MrSidims Can you help to have a look at this unknown extension issue generated by SPIRV-Backend.

https://github.com/intel/llvm/actions/runs/18699033103/job/53324529998?pr=20373

  env ONEAPI_DEVICE_SELECTOR=level_zero:gpu  /__w/llvm/llvm/build-e2e/Basic/built-ins/Output/const_vec_common.cpp.tmp.out
  # executed command: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu /__w/llvm/llvm/build-e2e/Basic/built-ins/Output/const_vec_common.cpp.tmp.out
  # .---command stderr------------
  # | InvalidModule: Invalid SPIR-V module: input SPIR-V module uses unknown extension 'SPV_KHR_float_controls2'

@wenju-he
Copy link
Contributor

@wenju-he FYI. [libclc] Workaround AMDGPU GlobalOffset assert

You can reproduce the error in GlobalOffset for AMDGPU with bin/clang++ -Werror -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx1030 ../sycl/test-e2e/Assert/assert_in_one_kernel.cpp

@jsji I've created a fix for GlobalOffset pass: #20428. With it, always_inline in 3f10fd4 is not needed.

@jsji
Copy link
Contributor

jsji commented Oct 23, 2025

@maksimsab llvm/llvm-project@65d730b4a5aae and its conflict resolution in 66e64d7 and 9ae38d9 is not ABI compatible with sycl-rel-6_3 , see https://github.com/intel/llvm/actions/runs/18700580117/job/53329446474?pr=20373 Can you have a look and drive discussion within sycl runtime team about how to deal with it? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disable-lint Skip linter check step and proceed with build jobs

Projects

None yet

Development

Successfully merging this pull request may close these issues.