Skip to content

fix: add target datalayout and triple to IR #1472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

mhasel
Copy link
Member

@mhasel mhasel commented Apr 30, 2025

Adds target data-layout and target triple to generated IR. This ensures consistent alignment for both generated code and debug information.
Note that this breaks our snapshots for windows builds:

    2 │-target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
    3 │-target triple = "x86_64-pc-linux-gnu"
    2 │+target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
    3 │+target triple = "x86_64-pc-windows-msvc"

Omitting the triple does not fix this issue, since the datalayout is not identical for linux and windows either.

This commit changes ALL codegen snapshots, so the snapshot updates are separated into their own commits. It also removes the previously added special handling for struct debug types since we can now rely on the preferred alignment of LLVM.

@mhasel mhasel force-pushed the dbg-alignment branch 3 times, most recently from 663c2cd to a0d9db6 Compare April 30, 2025 10:38
Copy link

codecov bot commented Apr 30, 2025

Codecov Report

Attention: Patch coverage is 86.15385% with 9 lines in your changes missing coverage. Please review.

Project coverage is 94.10%. Comparing base (e731987) to head (a0d9db6).
Report is 67 commits behind head on master.

Files with missing lines Patch % Lines
compiler/plc_driver/src/pipelines.rs 73.52% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1472      +/-   ##
==========================================
+ Coverage   93.67%   94.10%   +0.43%     
==========================================
  Files         166      173       +7     
  Lines       50097    56590    +6493     
==========================================
+ Hits        46928    53256    +6328     
- Misses       3169     3334     +165     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant