[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 23:03:24 PDT 2021


peterwaller-arm updated this revision to Diff 379611.
peterwaller-arm marked an inline comment as done.
peterwaller-arm added a comment.

- Use result of the load.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111736/new/

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 %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/")
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.379611.patch
Type: text/x-patch
Size: 1542 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211014/d2382656/attachment.bin>


More information about the llvm-commits mailing list