[PATCH] D85848: [InlineCost] Skip scalable vectors in visitAlloca

Cullen Rhodes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 11:16:18 PDT 2020


c-rhodes created this revision.
c-rhodes added reviewers: efriedma, david-arm, sdesmalen.
Herald added subscribers: haicheng, hiraditya, eraman.
Herald added a project: LLVM.
c-rhodes requested review of this revision.

Discovered as part of the VLS type work (see D85128 <https://reviews.llvm.org/D85128>).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85848

Files:
  llvm/lib/Analysis/InlineCost.cpp
  llvm/test/Transforms/Inline/inline-scalable.ll


Index: llvm/test/Transforms/Inline/inline-scalable.ll
===================================================================
--- /dev/null
+++ llvm/test/Transforms/Inline/inline-scalable.ll
@@ -0,0 +1,12 @@
+; RUN: opt -S -inline < %s | FileCheck %s
+
+; Test we bail out for scalable vectors.
+define void @func() {
+; CHECK-LABEL: func
+; CHECK-NEXT:    [[VEC_ADDR:%.*]] = alloca <vscale x 4 x i32>
+; CHECK-NEXT:    call void @func()
+; CHECK-NEXT:    ret void
+  %vec.addr = alloca <vscale x 4 x i32>
+  call void @func();
+  ret void
+}
Index: llvm/lib/Analysis/InlineCost.cpp
===================================================================
--- llvm/lib/Analysis/InlineCost.cpp
+++ llvm/lib/Analysis/InlineCost.cpp
@@ -852,6 +852,10 @@
 }
 
 bool CallAnalyzer::visitAlloca(AllocaInst &I) {
+  // FIXME: Support scalable vector types.
+  if (isa<ScalableVectorType>(I.getAllocatedType()))
+    return false;
+
   // Check whether inlining will turn a dynamic alloca into a static
   // alloca and handle that case.
   if (I.isArrayAllocation()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85848.285143.patch
Type: text/x-patch
Size: 1052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200812/9dbdf95e/attachment.bin>


More information about the llvm-commits mailing list