Skip to content

Conversation

@fangyi-zhou
Copy link
Contributor

@fangyi-zhou fangyi-zhou commented May 17, 2025

This commit attempts to un-xfail globals-ref-globals test (#1497), which was causing a crash in addition to GEP changes.

The crash was caused by incorrect offsets being calculated for global view indices. The original calculation did not take paddings into consideration, hence triggering a crash. This commit adds type alignment when calculating the offset, which will take care of paddings.

Further modification to globals-ref-globals test includes fixing some struct names that got changed, as well as replacing the expects with constant folded GEP.

@bcardosolopes
Copy link
Member

You need to fix some formatting issues, I recommend usage of git-clang-format before pushing a PR.

@fangyi-zhou
Copy link
Contributor Author

The failure in CI seems to unrelated to formatting changes, the workflow failed during upload-artifact. Could you re-run the CI?

This commit attempts to un-xfail `globals-ref-globals` test, which was
causing a crash in addition to GEP changes.

The crash was caused by incorrect offsets being calculated for global
view indices. The original calculation did not take paddings into
consideration, hence triggering a crash. This commit adds type alignment
when calculating the offset, which will take care of paddings.

Further modification to `globals-ref-globals` test includes fixing some
struct names that got changed, as well as replacing the expects with
constant folded GEP.
@bcardosolopes bcardosolopes merged commit be501d5 into llvm:main May 21, 2025
9 checks passed
terapines-osc-cir pushed a commit to Terapines/clangir that referenced this pull request Sep 2, 2025
This commit attempts to un-xfail `globals-ref-globals` test (llvm#1497),
which was causing a crash in addition to GEP changes.

The crash was caused by incorrect offsets being calculated for global
view indices. The original calculation did not take paddings into
consideration, hence triggering a crash. This commit adds type alignment
when calculating the offset, which will take care of paddings.

Further modification to `globals-ref-globals` test includes fixing some
struct names that got changed, as well as replacing the expects with
constant folded GEP.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants