From 21ef55ca86e41acce2ff2f3f71d31d5368611fa9 Mon Sep 17 00:00:00 2001 From: John Regehr Date: Mon, 14 Sep 2026 21:30:26 -0600 Subject: [PATCH] tweak --- llvm_util/utils.cpp | 5 +++++ tests/alive-tv/vector/scalable-struct.srctgt.ll | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 tests/alive-tv/vector/scalable-struct.srctgt.ll diff --git a/llvm_util/utils.cpp b/llvm_util/utils.cpp index 8e1e3a9ec..502d388fe 100644 --- a/llvm_util/utils.cpp +++ b/llvm_util/utils.cpp @@ -159,6 +159,11 @@ Type* llvm_type2alive(const llvm::Type *ty) { if (strty->isOpaque()) return get_int_type(8); + // If there's a scalable struct member, return early since + // otherwise getStructLayout() will assert out + if (strty->isScalableTy()) + return nullptr; + auto &cache = type_cache[ty]; if (!cache) { vector elems; diff --git a/tests/alive-tv/vector/scalable-struct.srctgt.ll b/tests/alive-tv/vector/scalable-struct.srctgt.ll new file mode 100644 index 000000000..2ecce571b --- /dev/null +++ b/tests/alive-tv/vector/scalable-struct.srctgt.ll @@ -0,0 +1,10 @@ +define {, i32} @src({, i32} %x) { + ret {, i32} %x +} + +define {, i32} @tgt({, i32} %x) { + ret {, i32} %x +} + +; ERROR: Could not translate 'src' to Alive IR +; SKIP-IDENTITY