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(I.getAllocatedType())) + return false; + // Check whether inlining will turn a dynamic alloca into a static // alloca and handle that case. if (I.isArrayAllocation()) { 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 +; CHECK-NEXT: call void @func() +; CHECK-NEXT: ret void + %vec.addr = alloca + call void @func(); + ret void +}