Index: llvm/lib/Target/X86/X86TargetTransformInfo.cpp =================================================================== --- llvm/lib/Target/X86/X86TargetTransformInfo.cpp +++ llvm/lib/Target/X86/X86TargetTransformInfo.cpp @@ -6049,6 +6049,10 @@ if (RealCallerBits == RealCalleeBits) return true; + // If the callee is only missing VLX, they are compatible. + if (RealCallerBits == (RealCalleeBits | FeatureBitset{X86::FeatureVLX})) + return true; + // If the features are a subset, we need to additionally check for calls // that may become ABI-incompatible as a result of inlining. if ((RealCallerBits & RealCalleeBits) != RealCalleeBits) Index: llvm/test/Transforms/Inline/X86/call-abi-compatibility.ll =================================================================== --- llvm/test/Transforms/Inline/X86/call-abi-compatibility.ll +++ llvm/test/Transforms/Inline/X86/call-abi-compatibility.ll @@ -93,3 +93,21 @@ } declare i64 @caller_unknown_simple(i64) + +; This call should get inlined, because the callee is only missing VLX. +define void @caller_vlx() "target-features"="+avx512f,+avx512vl" { +; CHECK-LABEL: define {{[^@]+}}@caller_vlx +; CHECK-SAME: () #[[ATTR2:[0-9]+]] { +; CHECK-NEXT: call void @callee_not_vlx(<8 x i64> ) +; CHECK-NEXT: ret void +; + call void @caller_not_vlx(<8 x i64> ) + ret void +} + +define internal void @caller_not_vlx(<8 x i64> %arg) "target-features"="+avx512f" { + call void @callee_not_vlx(<8 x i64> %arg) + ret void +} + +declare void @callee_not_vlx(<8 x i64>)