diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -1413,8 +1413,6 @@ if (auto *AI = dyn_cast_or_null(DII->getVariableLocationOp(0))) { if (Optional FragmentSize = AI->getAllocationSizeInBits(DL)) { - assert(ValueSize.isScalable() == FragmentSize->isScalable() && - "Both sizes should agree on the scalable flag."); return TypeSize::isKnownGE(ValueSize, *FragmentSize); } } diff --git a/llvm/test/Transforms/InstCombine/debuginfo-scalable-typesize.ll b/llvm/test/Transforms/InstCombine/debuginfo-scalable-typesize.ll --- a/llvm/test/Transforms/InstCombine/debuginfo-scalable-typesize.ll +++ b/llvm/test/Transforms/InstCombine/debuginfo-scalable-typesize.ll @@ -16,9 +16,18 @@ declare @f(*) +define float @debug_scalablevec_bitcast_to_scalar() { + %v.addr = alloca , align 16 + call void @llvm.dbg.declare(metadata * %v.addr, metadata !3, metadata !DIExpression()), !dbg !5 + %a = bitcast * %v.addr to float* + %b = load float, float* %a, align 16 + ret float %b +} + declare void @llvm.dbg.declare(metadata, metadata, metadata) !llvm.module.flags = !{!2} +!llvm.dbg.cu = !{!0} !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1) !1 = !DIFile(filename: "/tmp/test.c", directory: "/tmp/")