-
Notifications
You must be signed in to change notification settings - Fork 101
Backport #145690, #146068 and #144058 #182
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
Backport #145690, #146068 and #144058 #182
Conversation
…es (llvm#145648) A case found from rust-lang/rust#142752: https://llvm.godbolt.org/z/T7ce9saWh. We should emit `@bar_0` for the following code: ```llvm target triple = "x86_64-unknown-linux-gnu" @rel_0 = private unnamed_addr constant [1 x i32] [ i32 trunc (i64 sub (i64 ptrtoint (ptr @bar_0 to i64), i64 ptrtoint (ptr @rel_0 to i64)) to i32)] @bar_0 = internal unnamed_addr constant ptr @foo_0, align 8 @foo_0 = external global ptr, align 8 define void @foo(ptr %arg0) { store ptr @bar_0, ptr %arg0, align 8 ret void } ``` (cherry picked from commit 630d55c)
…id generating GOTPCREL relocations (llvm#146068) The entry in a relative lookup table is a global variable with a constant offset, such as `@gv`, `GEP @gv, 1`, and so on. We cannot only consider the case of a trivial global variable. This PR handles all cases using the existing `IsConstantOffsetFromGlobal` function. (cherry picked from commit c43282a)
…m#144058) Code originally added in llvm#120995 and later corrected in llvm#130517 but apparently still not correct according to llvm#141494 and rust-lang/rust#141913. Revert the special handling because the test written in llvm#120995 and llvm#130517 still passes without those changes. Kept the test and improved it with a `__DATA` section to keep the current behaviour checked in case other changes modify the behaviour and break this edge case. (cherry picked from commit a0662ce)
Added llvm@3d63191 for rust-lang/rust#143399. |
@nikic |
I asked Tom yesterday, and he said he's going to make a decision next week. I let him know about the ones you've raised here too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please use the commit from llvm#147034, so that the tests pass?
I think it's okay to merge this, we don't have to wait on the upstream release.
We don't have PACKSS for i64->i32. Fixes: https://godbolt.org/z/qb8nxnPbK, which was introduced by ddd2f57 (cherry picked from commit 3d63191)
a057832
to
9b1bf4c
Compare
Done. |
|
I assume that LLVM 20.1.7 is the final version.
I will use
git merge --ff-only
to merge this.