forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebAssembly] Add
-i128:128
to the datalayout
string.
Clang [defaults to aligning `__int128_t` to 16 bytes], while LLVM `datalayout` strings [default to aligning `i128` to 8 bytes]. Wasm is currently using the defaults for both, so it's inconsistent. Fix this by adding `-i128:128` to Wasm's `datalayout` string so that it aligns `i28` to 16 bytes too. This is similar to dbad963 for SPARC. This fixes rust-lang/rust#133991; see that issue for further discussion. [defaults to aligning `__int128_t` to 16 bytes]: https://github.com/llvm/llvm-project/blob/f8b4182f076f8fe55f9d5f617b5a25008a77b22f/clang/lib/Basic/TargetInfo.cpp#L77 [default to aligning `i128` to 8 bytes]: https://llvm.org/docs/LangRef.html#langref-datalayout
- Loading branch information
1 parent
00b07aa
commit 337b104
Showing
6 changed files
with
55 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
; RUN: llc < %s -march=wasm32 | FileCheck %s | ||
; RUN: llc < %s -march=wasm64 | FileCheck %s | ||
|
||
; CHECK: .Li8: | ||
; CHECK-DAG: .size .Li8, 1 | ||
@i8 = private constant i8 42 | ||
|
||
; CHECK: .p2align 1 | ||
; CHECK-NEXT: .Li16: | ||
; CHECK-DAG: .size .Li16, 2 | ||
@i16 = private constant i16 42 | ||
|
||
; CHECK: .p2align 2 | ||
; CHECK-NEXT: .Li32: | ||
; CHECK-DAG: .size .Li32, 4 | ||
@i32 = private constant i32 42 | ||
|
||
; CHECK: .p2align 3 | ||
; CHECK-NEXT: .Li64: | ||
; CHECK-DAG: .size .Li64, 8 | ||
@i64 = private constant i64 42 | ||
|
||
; CHECK: .p2align 4 | ||
; CHECK-NEXT: .Li128: | ||
; CHECK-DAG: .size .Li128, 16 | ||
@i128 = private constant i128 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters