diff options
author | Justin Bogner <mail@justinbogner.com> | 2025-08-19 13:23:42 -0600 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2025-09-26 15:13:28 -0700 |
commit | 637a958bedca09e3be1e55082550fa8c68015b69 (patch) | |
tree | 9c719b23802b68ec620b58426d493dedde48fc6c /llvm/lib/TargetParser/TargetDataLayout.cpp | |
parent | 220ad03d5b28dbd83dbb90896a7eb55b74004818 (diff) | |
download | llvm-users/bogner/pr160955.zip llvm-users/bogner/pr160955.tar.gz llvm-users/bogner/pr160955.tar.bz2 |
[DirectX] Add 32- and 64-bit 3-element vectors to DataLayoutusers/bogner/pr160955
This explicitly adds two 3-element vectors to the DataLayout so that
they'll be element-aligned. We need to do this more generally for
vectors, but this unblocks some very common cases.
Workaround for #123968
Diffstat (limited to 'llvm/lib/TargetParser/TargetDataLayout.cpp')
-rw-r--r-- | llvm/lib/TargetParser/TargetDataLayout.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/TargetParser/TargetDataLayout.cpp b/llvm/lib/TargetParser/TargetDataLayout.cpp index cea246e..5e6f773 100644 --- a/llvm/lib/TargetParser/TargetDataLayout.cpp +++ b/llvm/lib/TargetParser/TargetDataLayout.cpp @@ -548,8 +548,11 @@ std::string Triple::computeDataLayout(StringRef ABIName) const { case Triple::csky: return computeCSKYDataLayout(*this); case Triple::dxil: + // TODO: We need to align vectors on the element size generally, but for now + // we hard code this for 3-element 32- and 64-bit vectors as a workaround. + // See https://github.com/llvm/llvm-project/issues/123968 return "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-" - "f32:32-f64:64-n8:16:32:64"; + "f32:32-f64:64-n8:16:32:64-v48:16:16-v96:32:32-v192:64:64"; case Triple::hexagon: return "e-m:e-p:32:32:32-a:0-n16:32-" "i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-" |