diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 122977c672df0e..3e36f498523d6d 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -1413,8 +1413,6 @@ static bool valueCoversEntireFragment(Type *ValTy, DbgVariableIntrinsic *DII) { 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 index 1156ae5d34eed0..d986494ee501b6 100644 --- a/llvm/test/Transforms/InstCombine/debuginfo-scalable-typesize.ll +++ b/llvm/test/Transforms/InstCombine/debuginfo-scalable-typesize.ll @@ -16,9 +16,18 @@ define @debug_local_scalable( %tostor 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 undef +} + 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/")