[PATCH] D111736: [InstCombine][DebugInfo] Remove superflous assertion, add test
Peter Waller via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 13 08:46:32 PDT 2021
peterwaller-arm created this revision.
peterwaller-arm added reviewers: paulwalker-arm, bsmith, DavidTruby, MattDevereau.
Herald added a subscriber: hiraditya.
peterwaller-arm requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
When this code was added, an unnecessary assertion slipped in which we
now hit in real code.
Add a test to defend against it firing again.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D111736
Files:
llvm/lib/Transforms/Utils/Local.cpp
llvm/test/Transforms/InstCombine/debuginfo-scalable-typesize.ll
Index: llvm/test/Transforms/InstCombine/debuginfo-scalable-typesize.ll
===================================================================
--- llvm/test/Transforms/InstCombine/debuginfo-scalable-typesize.ll
+++ llvm/test/Transforms/InstCombine/debuginfo-scalable-typesize.ll
@@ -16,9 +16,18 @@
declare <vscale x 2 x double> @f(<vscale x 2 x double>*)
+define float @debug_scalablevec_bitcast_to_scalar() {
+ %v.addr = alloca <vscale x 4 x float>, align 16
+ call void @llvm.dbg.declare(metadata <vscale x 4 x float>* %v.addr, metadata !3, metadata !DIExpression()), !dbg !5
+ %a = bitcast <vscale x 4 x float>* %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/")
Index: llvm/lib/Transforms/Utils/Local.cpp
===================================================================
--- llvm/lib/Transforms/Utils/Local.cpp
+++ llvm/lib/Transforms/Utils/Local.cpp
@@ -1413,8 +1413,6 @@
if (auto *AI =
dyn_cast_or_null<AllocaInst>(DII->getVariableLocationOp(0))) {
if (Optional<TypeSize> FragmentSize = AI->getAllocationSizeInBits(DL)) {
- assert(ValueSize.isScalable() == FragmentSize->isScalable() &&
- "Both sizes should agree on the scalable flag.");
return TypeSize::isKnownGE(ValueSize, *FragmentSize);
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111736.379421.patch
Type: text/x-patch
Size: 1545 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211013/89689f3c/attachment.bin>
More information about the llvm-commits
mailing list