Skip to content

[X86][Inline] Make ABI compatibility check more precise - #205106

Merged
nikic merged 3 commits into
llvm:mainfrom
nikic:x86-abi-check
Jun 23, 2026
Merged

nikic merged 3 commits into
llvm:mainfrom
nikic:x86-abi-check

Conversation

@nikic

@nikic nikic commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

When inlining a function that contains calls with vector arguments, we have to be careful that inlining does not change the ABI of the call. E.g. we generally can't inline a function without +avx into a function with +avx if there are calls using vectors of size 256 or larger, because they'd switch from passing in two xmm registers to passing in a ymm register.

However, the current check is very crude and only allows inlining with interior calls if the target features match exactly (via the base areTypesABICompatible implementation). This is unnecessarily conservative, as many target features do not affect the call ABI at all.

Make this check more precise by checking the result of getRegisterTypeForCallingConv for the type between the TLI instances for the caller and callee.

@llvmorg-github-actions

llvmorg-github-actions Bot commented Jun 22, 2026 •

Copy link
Copy Markdown

@llvm/pr-subscribers-llvm-transforms

@llvm/pr-subscribers-backend-x86

Author: Nikita Popov (nikic)

Changes

When inlining a function that contains calls with vector arguments, we have to be careful that inlining does not change the ABI of the call. E.g. we generally can't inline a function without +avx2 into a function with +avx2 if there are calls using vectors of size 256 or larger, because they'd switch from passing in two xmm registers to passing in a ymm register.

However, the current check is very crude and only allows inlining with interior calls if the target features match exactly (via the base areTypesABICompatible implementation). This is unnecessarily conservative, as many target features do not affect the call ABI at all.

Make this check more precise by checking the result of getRegisterTypeForCallingConv for the type between the TLI instances for the caller and callee.


Full diff: https://github.com/llvm/llvm-project/pull/205106.diff

3 Files Affected:

  • (modified) llvm/lib/Target/X86/X86TargetTransformInfo.cpp (+12-16)
  • (modified) llvm/test/Transforms/Inline/X86/call-abi-compatibility.ll (+133)
  • (modified) llvm/test/Transforms/PhaseOrdering/X86/loop-vectorizer-noalias.ll (+2-4)
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index 0e9d8679ca9ec..7b00502ce1c6c 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -6765,23 +6765,19 @@ bool X86TTIImpl::areInlineCompatible(const Function *Caller,
 bool X86TTIImpl::areTypesABICompatible(const Function *Caller,
                                        const Function *Callee,
                                        ArrayRef<Type *> Types) const {
-  if (!BaseT::areTypesABICompatible(Caller, Callee, Types))
-    return false;
-
-  // If we get here, we know the target features match. If one function
-  // considers 512-bit vectors legal and the other does not, consider them
-  // incompatible.
   const TargetMachine &TM = getTLI()->getTargetMachine();
-
-  if (TM.getSubtarget<X86Subtarget>(*Caller).useAVX512Regs() ==
-      TM.getSubtarget<X86Subtarget>(*Callee).useAVX512Regs())
-    return true;
-
-  // Consider the arguments compatible if they aren't vectors or aggregates.
-  // FIXME: Look at the size of vectors.
-  // FIXME: Look at the element types of aggregates to see if there are vectors.
-  return llvm::none_of(Types,
-      [](Type *T) { return T->isVectorTy() || T->isAggregateType(); });
+  const TargetLowering *CallerTLI =
+      TM.getSubtargetImpl(*Caller)->getTargetLowering();
+  const TargetLowering *CalleeTLI =
+      TM.getSubtargetImpl(*Callee)->getTargetLowering();
+
+  LLVMContext &Ctx = Caller->getContext();
+  CallingConv::ID CC = Callee->getCallingConv();
+  return all_of(Types, [&](Type *Ty) {
+    EVT VT = CallerTLI->getValueType(DL, Ty);
+    return CallerTLI->getRegisterTypeForCallingConv(Ctx, CC, VT) ==
+           CalleeTLI->getRegisterTypeForCallingConv(Ctx, CC, VT);
+  });
 }
 
 X86TTIImpl::TTI::MemCmpExpansionOptions
diff --git a/llvm/test/Transforms/Inline/X86/call-abi-compatibility.ll b/llvm/test/Transforms/Inline/X86/call-abi-compatibility.ll
index 9d0981cd63756..158fa4471d542 100644
--- a/llvm/test/Transforms/Inline/X86/call-abi-compatibility.ll
+++ b/llvm/test/Transforms/Inline/X86/call-abi-compatibility.ll
@@ -143,5 +143,138 @@ define internal <8 x i64> @callee_inline_asm(ptr %p0, i64 %k, ptr %p1, ptr %p2)
   ret <8 x i64> %3
 }
 
+declare void @callee_128bit(<4 x float>)
+declare void @callee_256bit(<8 x float>)
+declare void @callee_512bit(<16 x float>)
+
+define void @callee_calls_128bit_baseline() {
+; CHECK-LABEL: define {{[^@]+}}@callee_calls_128bit_baseline() {
+; CHECK-NEXT:    call void @callee_128bit(<4 x float> zeroinitializer)
+; CHECK-NEXT:    ret void
+;
+  call void @callee_128bit(<4 x float> zeroinitializer)
+  ret void
+}
+
+; Okay to inline as +sse3 does not change the ABI of 128 bit vectors relative
+; to x86-64 baseline.
+define void @caller_calls_128bit_sse3() "target-features"="+sse3" {
+; CHECK-LABEL: define {{[^@]+}}@caller_calls_128bit_sse3
+; CHECK-SAME: () #[[ATTR3:[0-9]+]] {
+; CHECK-NEXT:    call void @callee_128bit(<4 x float> zeroinitializer)
+; CHECK-NEXT:    ret void
+;
+  call void @callee_calls_128bit_baseline()
+  ret void
+}
+
+define void @callee_calls_256bit_baseline() {
+; CHECK-LABEL: define {{[^@]+}}@callee_calls_256bit_baseline() {
+; CHECK-NEXT:    call void @callee_256bit(<8 x float> zeroinitializer)
+; CHECK-NEXT:    ret void
+;
+  call void @callee_256bit(<8 x float> zeroinitializer)
+  ret void
+}
+
+; Okay to inline as +sse3 does not change the ABI of 256 bit vectors relative
+; to x86-64 baseline.
+define void @caller_calls_256bit_sse3() "target-features"="+sse3" {
+; CHECK-LABEL: define {{[^@]+}}@caller_calls_256bit_sse3
+; CHECK-SAME: () #[[ATTR3]] {
+; CHECK-NEXT:    call void @callee_256bit(<8 x float> zeroinitializer)
+; CHECK-NEXT:    ret void
+;
+  call void @callee_calls_256bit_baseline()
+  ret void
+}
+
+; Can NOT inline as +avx changes the ABI of 256 bit vectors.
+define void @caller_calls_256bit_avx() "target-features"="+avx" {
+; CHECK-LABEL: define {{[^@]+}}@caller_calls_256bit_avx
+; CHECK-SAME: () #[[ATTR0]] {
+; CHECK-NEXT:    call void @callee_calls_256bit_baseline()
+; CHECK-NEXT:    ret void
+;
+  call void @callee_calls_256bit_baseline()
+  ret void
+}
+
+define void @callee_calls_256bit_avx() "target-features"="+avx" {
+; CHECK-LABEL: define {{[^@]+}}@callee_calls_256bit_avx
+; CHECK-SAME: () #[[ATTR0]] {
+; CHECK-NEXT:    call void @callee_256bit(<8 x float> zeroinitializer)
+; CHECK-NEXT:    ret void
+;
+  call void @callee_256bit(<8 x float> zeroinitializer)
+  ret void
+}
+
+; Okay to inline as +avx2 does not change the ABI of 256 bit vectors relative
+; to +avx.
+define void @caller_calls_256bit_avx2() "target-features"="+avx2" {
+; CHECK-LABEL: define {{[^@]+}}@caller_calls_256bit_avx2
+; CHECK-SAME: () #[[ATTR4:[0-9]+]] {
+; CHECK-NEXT:    call void @callee_256bit(<8 x float> zeroinitializer)
+; CHECK-NEXT:    ret void
+;
+  call void @callee_calls_256bit_avx()
+  ret void
+}
+
+define void @callee_calls_512bit_baseline() {
+; CHECK-LABEL: define {{[^@]+}}@callee_calls_512bit_baseline() {
+; CHECK-NEXT:    call void @callee_512bit(<16 x float> zeroinitializer)
+; CHECK-NEXT:    ret void
+;
+  call void @callee_512bit(<16 x float> zeroinitializer)
+  ret void
+}
+
+; Okay to inline as +sse3 does not change the ABI of 512 bit vectors relative
+; to x86-64 baseline.
+define void @caller_calls_512bit_sse3() "target-features"="+sse3" {
+; CHECK-LABEL: define {{[^@]+}}@caller_calls_512bit_sse3
+; CHECK-SAME: () #[[ATTR3]] {
+; CHECK-NEXT:    call void @callee_512bit(<16 x float> zeroinitializer)
+; CHECK-NEXT:    ret void
+;
+  call void @callee_calls_512bit_baseline()
+  ret void
+}
+
+; Can NOT inline as +avx changes the ABI of 512 bit vectors.
+define void @caller_calls_512bit_avx() "target-features"="+avx" {
+; CHECK-LABEL: define {{[^@]+}}@caller_calls_512bit_avx
+; CHECK-SAME: () #[[ATTR0]] {
+; CHECK-NEXT:    call void @callee_calls_512bit_baseline()
+; CHECK-NEXT:    ret void
+;
+  call void @callee_calls_512bit_baseline()
+  ret void
+}
+
+define void @callee_calls_512bit_avx512f() "target-features"="+avx512f" {
+; CHECK-LABEL: define {{[^@]+}}@callee_calls_512bit_avx512f
+; CHECK-SAME: () #[[ATTR5:[0-9]+]] {
+; CHECK-NEXT:    call void @callee_512bit(<16 x float> zeroinitializer)
+; CHECK-NEXT:    ret void
+;
+  call void @callee_512bit(<16 x float> zeroinitializer)
+  ret void
+}
+
+; Okay to inline as +avx512bw does not change the ABI of 512 bit vectors
+;relative to +avx512f.
+define void @caller_calls_512bit_avx512bw() "target-features"="+avx512bw" {
+; CHECK-LABEL: define {{[^@]+}}@caller_calls_512bit_avx512bw
+; CHECK-SAME: () #[[ATTR6:[0-9]+]] {
+; CHECK-NEXT:    call void @callee_512bit(<16 x float> zeroinitializer)
+; CHECK-NEXT:    ret void
+;
+  call void @callee_calls_512bit_avx512f()
+  ret void
+}
+
 attributes #0 = { "min-legal-vector-width"="512" "target-features"="+avx,+avx2,+avx512bw,+avx512dq,+avx512f,+cmov,+crc32,+cx8,+evex512,+f16c,+fma,+fxsr,+mmx,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87,+xsave" "tune-cpu"="generic" }
 attributes #1 = { "min-legal-vector-width"="512" "target-features"="+avx,+avx2,+avx512bw,+avx512f,+cmov,+crc32,+cx8,+evex512,+f16c,+fma,+fxsr,+mmx,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87,+xsave" "tune-cpu"="generic" }
diff --git a/llvm/test/Transforms/PhaseOrdering/X86/loop-vectorizer-noalias.ll b/llvm/test/Transforms/PhaseOrdering/X86/loop-vectorizer-noalias.ll
index 112cc75b1cf05..96a7e2d4c52b3 100644
--- a/llvm/test/Transforms/PhaseOrdering/X86/loop-vectorizer-noalias.ll
+++ b/llvm/test/Transforms/PhaseOrdering/X86/loop-vectorizer-noalias.ll
@@ -27,9 +27,9 @@ define void @accsum(ptr noundef %vals, i64 noundef %num) #0 {
 ; CHECK-NEXT:    [[STORE_FORWARDED:%.*]] = phi i8 [ [[LOAD_INITIAL]], [[FOR_BODY_PREHEADER]] ], [ [[ADD_I:%.*]], [[FOR_BODY]] ]
 ; CHECK-NEXT:    [[I_02:%.*]] = phi i64 [ 1, [[FOR_BODY_PREHEADER]] ], [ [[INC:%.*]], [[FOR_BODY]] ]
 ; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds i8, ptr [[VALS]], i64 [[I_02]]
-; CHECK-NEXT:    [[TMP0:%.*]] = load i8, ptr [[ARRAYIDX]], align 1, !alias.scope [[META0:![0-9]+]], !noalias [[META3:![0-9]+]]
+; CHECK-NEXT:    [[TMP0:%.*]] = load i8, ptr [[ARRAYIDX]], align 1, !alias.scope [[META0:![0-9]+]]
 ; CHECK-NEXT:    [[ADD_I]] = add i8 [[TMP0]], [[STORE_FORWARDED]]
-; CHECK-NEXT:    store i8 [[ADD_I]], ptr [[ARRAYIDX]], align 1, !alias.scope [[META0]], !noalias [[META3]]
+; CHECK-NEXT:    store i8 [[ADD_I]], ptr [[ARRAYIDX]], align 1, !alias.scope [[META0]]
 ; CHECK-NEXT:    [[INC]] = add nuw i64 [[I_02]], 1
 ; CHECK-NEXT:    [[EXITCOND_NOT:%.*]] = icmp eq i64 [[INC]], [[NUM]]
 ; CHECK-NEXT:    br i1 [[EXITCOND_NOT]], label [[FOR_END]], label [[FOR_BODY]]
@@ -73,6 +73,4 @@ attributes #0 = { "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87"}
 ; CHECK: [[META0]] = !{[[META1:![0-9]+]]}
 ; CHECK: [[META1]] = distinct !{[[META1]], [[META2:![0-9]+]], !"acc: %val"}
 ; CHECK: [[META2]] = distinct !{[[META2]], !"acc"}
-; CHECK: [[META3]] = !{[[META4:![0-9]+]]}
-; CHECK: [[META4]] = distinct !{[[META4]], [[META2]], !"acc: %prev"}
 ;.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change to this test is because one of the i8 loads gets argument promoted (which is legal, as target features do not change the i8 call ABI).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can skip scalar type as it should be ABI compatible for any features. Outliers like fp80, fp16 etc. should be blocked in the front end already.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be clear, the change here is because we now report i8 as ABI compatible, not the other way around. I don't think there's a need to special case scalar types, they are handled correctly by the general check.


; Okay to inline as +avx512bw does not change the ABI of 512 bit vectors
;relative to +avx512f.
define void @caller_calls_512bit_avx512bw() "target-features"="+avx512bw" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work if one has "min-legal-vector-width"="256"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm always confused by this attribute. Do you have an example I can test? I wasn't able to come up with a case where this attribute actually changes the call ABI: https://llvm.godbolt.org/z/anPMvEdv8

(Note that there is existing adjustment for the attribute during inlining.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I managed to get an ABI difference using avx512vl and setting both min-legal-vector-width and prefer-vector-width: https://llvm.godbolt.org/z/Yezz8r7n8 I have no idea why you need precisely that incantation...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's what the previous code prevent for:

  if (TM.getSubtarget<X86Subtarget>(*Caller).useAVX512Regs() ==
      TM.getSubtarget<X86Subtarget>(*Callee).useAVX512Regs())
    return true;

I'm surprised no test case to cover it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a test case for this here: https://github.com/llvm/llvm-project/blob/main/llvm/test/Transforms/ArgumentPromotion/X86/min-legal-vector-width.ll The new implementation hands this correctly.

However, I found that there is a pre-existing issue that the inlining ABI check (unlike the one in ArgPromotion) does not handle this, because it bails out early if the target features match exactly, so it never gets to this code. I've pushed an extra commit to fix this, so we now only skip the ABI check if both the features are the same and useAVX512Regs is the same.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks correct, but does ArgPromotion not need to check useAVX512Regs now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't need the explicit check anymore, because getRegisterTypeForCallingConv() will handle it (depending on useAVX512Regs the 512-bit vectors will either be legal or not, and that affects the register type used for the calling convention).

@github-actions

github-actions Bot commented Jun 22, 2026 •

Copy link
Copy Markdown

🪟 Windows x64 Test Results

  • 136091 tests passed
  • 3464 tests skipped

✅ The build succeeded and all tests passed.

@phoebewang phoebewang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@nikic
nikic merged commit 876439f into llvm:main Jun 23, 2026
11 checks passed
@nikic
nikic deleted the x86-abi-check branch June 23, 2026 08:52
@llvm-ci

llvm-ci commented Jun 23, 2026

Copy link
Copy Markdown

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux running on sanitizer-buildbot1 while building llvm at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/66/builds/32657

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
-- Install configuration: "Release"
[417/423] Generating MSAN_INST_GTEST.gtest-all.cc.x86_64-with-call.o
[418/423] Generating MSAN_INST_GTEST.gtest-all.cc.x86_64.o
[419/423] Generating MSAN_INST_TEST_OBJECTS.msan_test.cpp.x86_64-with-call.o
[420/423] Generating Msan-x86_64-with-call-Test
[421/423] Generating MSAN_INST_TEST_OBJECTS.msan_test.cpp.x86_64.o
[422/423] Generating Msan-x86_64-Test
[422/423] Running compiler_rt regression tests
-- Testing: 11642 tests, 64 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.
FAIL: cfi-devirt-lld-i386 :: mfcall.cpp (10029 of 11642)
******************** TEST 'cfi-devirt-lld-i386 :: mfcall.cpp' FAILED ********************
Exit Code: -6

Command Output (stdout):
--
# RUN: at line 3
/home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang   -m32 -fuse-ld=lld -flto  -fsanitize=cfi -fwhole-program-vtables --driver-mode=g++ -fvisibility=hidden -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/cfi/Devirt-lld-i386/Output/mfcall.cpp.tmp /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/cfi/mfcall.cpp
# executed command: /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -m32 -fuse-ld=lld -flto -fsanitize=cfi -fwhole-program-vtables --driver-mode=g++ -fvisibility=hidden -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/cfi/Devirt-lld-i386/Output/mfcall.cpp.tmp /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/cfi/mfcall.cpp
# .---command stderr------------
# | Unknown type!
# | UNREACHABLE executed at /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/CodeGen/ValueTypes.cpp:254!
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
# | Stack dump:
# | 0.	Program arguments: /home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld -z relro --hash-style=gnu --eh-frame-hdr -m elf_i386 -pie -dynamic-linker /lib/ld-linux.so.2 -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/cfi/Devirt-lld-i386/Output/mfcall.cpp.tmp /usr/lib/gcc-cross/i686-linux-gnu/15/../../../../lib32/Scrt1.o /usr/lib/gcc-cross/i686-linux-gnu/15/../../../../lib32/crti.o /usr/lib/gcc-cross/i686-linux-gnu/15/crtbeginS.o -L/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/23/lib/i386-unknown-linux-gnu -L/usr/lib/gcc-cross/i686-linux-gnu/15 -L/usr/lib/gcc-cross/i686-linux-gnu/15/../../../../lib32 -L/lib/i386-linux-gnu -L/lib/../lib32 -L/usr/lib/i386-linux-gnu -L/usr/lib32 -L/usr/lib/gcc-cross/i686-linux-gnu/15/../../../../i686-linux-gnu/lib -L/lib -L/usr/lib -plugin-opt=mcpu=pentium4 /tmp/lit-tmp-c7aidjlb/mfcall-e75aba.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc-cross/i686-linux-gnu/15/crtendS.o /usr/lib/gcc-cross/i686-linux-gnu/15/../../../../lib32/crtn.o
# | 1.	Running pass "cgscc(function-attrs,argpromotion,function(sroa<modify-cfg>))" on module "ld-temp.o"
# |  #0 0x000057e5269acf08 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x54c6f08)
# |  #1 0x000057e5269a9d21 llvm::sys::RunSignalHandlers() (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x54c3d21)
# |  #2 0x000057e5269adce1 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
# |  #3 0x00007cfa27c47e10 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x47e10)
# |  #4 0x00007cfa27cae3ec pthread_kill (/usr/lib/x86_64-linux-gnu/libc.so.6+0xae3ec)
# |  #5 0x00007cfa27c47cde raise (/usr/lib/x86_64-linux-gnu/libc.so.6+0x47cde)
# |  #6 0x00007cfa27c288ec abort (/usr/lib/x86_64-linux-gnu/libc.so.6+0x288ec)
# |  #7 0x000057e52690ecef (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x5428cef)
# |  #8 0x000057e5297b0e87 llvm::MVT::getVT(llvm::Type*, bool) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x82cae87)
# |  #9 0x000057e5297b0193 llvm::EVT::getEVT(llvm::Type*, bool) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x82ca193)
# | #10 0x000057e528ae8a87 llvm::X86TTIImpl::areTypesABICompatible(llvm::Function const*, llvm::Function const*, llvm::ArrayRef<llvm::Type*>) const X86TargetTransformInfo.cpp:0:0
# | #11 0x000057e5298a5ada llvm::ArgumentPromotionPass::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x83bfada)
# | #12 0x000057e52a7ee863 llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x9308863)
# | #13 0x000057e52a7efe50 llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x9309e50)
# | #14 0x000057e52b184d49 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x9c9ed49)
# | #15 0x000057e528cb8db4 llvm::lto::opt(llvm::lto::Config const&, llvm::TargetMachine*, unsigned int, llvm::Module&, bool, llvm::ModuleSummaryIndex*, llvm::ModuleSummaryIndex const*, std::vector<unsigned char, std::allocator<unsigned char>> const&, llvm::ArrayRef<llvm::StringRef>) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x77d2db4)
# | #16 0x000057e528cb9ac9 llvm::lto::backend(llvm::lto::Config const&, std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex&, llvm::ArrayRef<llvm::StringRef>) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x77d3ac9)
# | #17 0x000057e528ca2d54 llvm::lto::LTO::runRegularLTO(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x77bcd54)
# | #18 0x000057e528ca21bb llvm::lto::LTO::run(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, llvm::FileCache) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x77bc1bb)
# | #19 0x000057e526c0d839 lld::elf::BitcodeCompiler::compile() (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x5727839)
# | #20 0x000057e526afe553 void lld::elf::LinkerDriver::compileBitcodeFiles<llvm::object::ELFType<(llvm::endianness)1, false>>(bool) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x5618553)
# | #21 0x000057e526ae67ff void lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::endianness)1, false>>(llvm::opt::InputArgList&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x56007ff)
# | #22 0x000057e526ad4e72 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x55eee72)
Step 9 (test compiler-rt symbolizer) failure: test compiler-rt symbolizer (failure)
...
-- Install configuration: "Release"
[417/423] Generating MSAN_INST_GTEST.gtest-all.cc.x86_64-with-call.o
[418/423] Generating MSAN_INST_GTEST.gtest-all.cc.x86_64.o
[419/423] Generating MSAN_INST_TEST_OBJECTS.msan_test.cpp.x86_64-with-call.o
[420/423] Generating Msan-x86_64-with-call-Test
[421/423] Generating MSAN_INST_TEST_OBJECTS.msan_test.cpp.x86_64.o
[422/423] Generating Msan-x86_64-Test
[422/423] Running compiler_rt regression tests
-- Testing: 11642 tests, 64 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.
FAIL: cfi-devirt-lld-i386 :: mfcall.cpp (10029 of 11642)
******************** TEST 'cfi-devirt-lld-i386 :: mfcall.cpp' FAILED ********************
Exit Code: -6

Command Output (stdout):
--
# RUN: at line 3
/home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang   -m32 -fuse-ld=lld -flto  -fsanitize=cfi -fwhole-program-vtables --driver-mode=g++ -fvisibility=hidden -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/cfi/Devirt-lld-i386/Output/mfcall.cpp.tmp /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/cfi/mfcall.cpp
# executed command: /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -m32 -fuse-ld=lld -flto -fsanitize=cfi -fwhole-program-vtables --driver-mode=g++ -fvisibility=hidden -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/cfi/Devirt-lld-i386/Output/mfcall.cpp.tmp /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/cfi/mfcall.cpp
# .---command stderr------------
# | Unknown type!
# | UNREACHABLE executed at /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/CodeGen/ValueTypes.cpp:254!
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
# | Stack dump:
# | 0.	Program arguments: /home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld -z relro --hash-style=gnu --eh-frame-hdr -m elf_i386 -pie -dynamic-linker /lib/ld-linux.so.2 -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/cfi/Devirt-lld-i386/Output/mfcall.cpp.tmp /usr/lib/gcc-cross/i686-linux-gnu/15/../../../../lib32/Scrt1.o /usr/lib/gcc-cross/i686-linux-gnu/15/../../../../lib32/crti.o /usr/lib/gcc-cross/i686-linux-gnu/15/crtbeginS.o -L/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/23/lib/i386-unknown-linux-gnu -L/usr/lib/gcc-cross/i686-linux-gnu/15 -L/usr/lib/gcc-cross/i686-linux-gnu/15/../../../../lib32 -L/lib/i386-linux-gnu -L/lib/../lib32 -L/usr/lib/i386-linux-gnu -L/usr/lib32 -L/usr/lib/gcc-cross/i686-linux-gnu/15/../../../../i686-linux-gnu/lib -L/lib -L/usr/lib -plugin-opt=mcpu=pentium4 /tmp/lit-tmp-c7aidjlb/mfcall-e75aba.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc-cross/i686-linux-gnu/15/crtendS.o /usr/lib/gcc-cross/i686-linux-gnu/15/../../../../lib32/crtn.o
# | 1.	Running pass "cgscc(function-attrs,argpromotion,function(sroa<modify-cfg>))" on module "ld-temp.o"
# |  #0 0x000057e5269acf08 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x54c6f08)
# |  #1 0x000057e5269a9d21 llvm::sys::RunSignalHandlers() (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x54c3d21)
# |  #2 0x000057e5269adce1 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
# |  #3 0x00007cfa27c47e10 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x47e10)
# |  #4 0x00007cfa27cae3ec pthread_kill (/usr/lib/x86_64-linux-gnu/libc.so.6+0xae3ec)
# |  #5 0x00007cfa27c47cde raise (/usr/lib/x86_64-linux-gnu/libc.so.6+0x47cde)
# |  #6 0x00007cfa27c288ec abort (/usr/lib/x86_64-linux-gnu/libc.so.6+0x288ec)
# |  #7 0x000057e52690ecef (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x5428cef)
# |  #8 0x000057e5297b0e87 llvm::MVT::getVT(llvm::Type*, bool) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x82cae87)
# |  #9 0x000057e5297b0193 llvm::EVT::getEVT(llvm::Type*, bool) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x82ca193)
# | #10 0x000057e528ae8a87 llvm::X86TTIImpl::areTypesABICompatible(llvm::Function const*, llvm::Function const*, llvm::ArrayRef<llvm::Type*>) const X86TargetTransformInfo.cpp:0:0
# | #11 0x000057e5298a5ada llvm::ArgumentPromotionPass::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x83bfada)
# | #12 0x000057e52a7ee863 llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x9308863)
# | #13 0x000057e52a7efe50 llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x9309e50)
# | #14 0x000057e52b184d49 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x9c9ed49)
# | #15 0x000057e528cb8db4 llvm::lto::opt(llvm::lto::Config const&, llvm::TargetMachine*, unsigned int, llvm::Module&, bool, llvm::ModuleSummaryIndex*, llvm::ModuleSummaryIndex const*, std::vector<unsigned char, std::allocator<unsigned char>> const&, llvm::ArrayRef<llvm::StringRef>) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x77d2db4)
# | #16 0x000057e528cb9ac9 llvm::lto::backend(llvm::lto::Config const&, std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex&, llvm::ArrayRef<llvm::StringRef>) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x77d3ac9)
# | #17 0x000057e528ca2d54 llvm::lto::LTO::runRegularLTO(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x77bcd54)
# | #18 0x000057e528ca21bb llvm::lto::LTO::run(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, llvm::FileCache) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x77bc1bb)
# | #19 0x000057e526c0d839 lld::elf::BitcodeCompiler::compile() (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x5727839)
# | #20 0x000057e526afe553 void lld::elf::LinkerDriver::compileBitcodeFiles<llvm::object::ELFType<(llvm::endianness)1, false>>(bool) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x5618553)
# | #21 0x000057e526ae67ff void lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::endianness)1, false>>(llvm::opt::InputArgList&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x56007ff)
# | #22 0x000057e526ad4e72 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x55eee72)
Step 11 (test compiler-rt debug) failure: test compiler-rt debug (failure)
...
[0/1] Install the project...
-- Install configuration: "Release"
[418/423] Generating MSAN_INST_GTEST.gtest-all.cc.x86_64.o
[419/423] Generating MSAN_INST_TEST_OBJECTS.msan_test.cpp.x86_64-with-call.o
[420/423] Generating Msan-x86_64-with-call-Test
[421/423] Generating MSAN_INST_TEST_OBJECTS.msan_test.cpp.x86_64.o
[422/423] Generating Msan-x86_64-Test
[422/423] Running compiler_rt regression tests
-- Testing: 5523 of 11622 tests, 64 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 
FAIL: cfi-devirt-lld-i386 :: mfcall.cpp (3974 of 5523)
******************** TEST 'cfi-devirt-lld-i386 :: mfcall.cpp' FAILED ********************
Exit Code: -6

Command Output (stdout):
--
# RUN: at line 3
/home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang   -m32 -fuse-ld=lld -flto  -fsanitize=cfi -fwhole-program-vtables --driver-mode=g++ -fvisibility=hidden -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/cfi/Devirt-lld-i386/Output/mfcall.cpp.tmp /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/cfi/mfcall.cpp
# executed command: /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -m32 -fuse-ld=lld -flto -fsanitize=cfi -fwhole-program-vtables --driver-mode=g++ -fvisibility=hidden -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/cfi/Devirt-lld-i386/Output/mfcall.cpp.tmp /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/cfi/mfcall.cpp
# .---command stderr------------
# | Unknown type!
# | UNREACHABLE executed at /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/CodeGen/ValueTypes.cpp:254!
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
# | Stack dump:
# | 0.	Program arguments: /home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld -z relro --hash-style=gnu --eh-frame-hdr -m elf_i386 -pie -dynamic-linker /lib/ld-linux.so.2 -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/cfi/Devirt-lld-i386/Output/mfcall.cpp.tmp /usr/lib/gcc-cross/i686-linux-gnu/15/../../../../lib32/Scrt1.o /usr/lib/gcc-cross/i686-linux-gnu/15/../../../../lib32/crti.o /usr/lib/gcc-cross/i686-linux-gnu/15/crtbeginS.o -L/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/23/lib/i386-unknown-linux-gnu -L/usr/lib/gcc-cross/i686-linux-gnu/15 -L/usr/lib/gcc-cross/i686-linux-gnu/15/../../../../lib32 -L/lib/i386-linux-gnu -L/lib/../lib32 -L/usr/lib/i386-linux-gnu -L/usr/lib32 -L/usr/lib/gcc-cross/i686-linux-gnu/15/../../../../i686-linux-gnu/lib -L/lib -L/usr/lib -plugin-opt=mcpu=pentium4 /tmp/lit-tmp-4m0z6_5x/mfcall-c7faff.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc-cross/i686-linux-gnu/15/crtendS.o /usr/lib/gcc-cross/i686-linux-gnu/15/../../../../lib32/crtn.o
# | 1.	Running pass "cgscc(function-attrs,argpromotion,function(sroa<modify-cfg>))" on module "ld-temp.o"
# |  #0 0x00005772dfb0ef08 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x54c6f08)
# |  #1 0x00005772dfb0bd21 llvm::sys::RunSignalHandlers() (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x54c3d21)
# |  #2 0x00005772dfb0fce1 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
# |  #3 0x00007c608e647e10 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x47e10)
# |  #4 0x00007c608e6ae3ec pthread_kill (/usr/lib/x86_64-linux-gnu/libc.so.6+0xae3ec)
# |  #5 0x00007c608e647cde raise (/usr/lib/x86_64-linux-gnu/libc.so.6+0x47cde)
# |  #6 0x00007c608e6288ec abort (/usr/lib/x86_64-linux-gnu/libc.so.6+0x288ec)
# |  #7 0x00005772dfa70cef (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x5428cef)
# |  #8 0x00005772e2912e87 llvm::MVT::getVT(llvm::Type*, bool) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x82cae87)
# |  #9 0x00005772e2912193 llvm::EVT::getEVT(llvm::Type*, bool) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x82ca193)
# | #10 0x00005772e1c4aa87 llvm::X86TTIImpl::areTypesABICompatible(llvm::Function const*, llvm::Function const*, llvm::ArrayRef<llvm::Type*>) const X86TargetTransformInfo.cpp:0:0
# | #11 0x00005772e2a07ada llvm::ArgumentPromotionPass::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x83bfada)
# | #12 0x00005772e3950863 llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x9308863)
# | #13 0x00005772e3951e50 llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x9309e50)
# | #14 0x00005772e42e6d49 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x9c9ed49)
# | #15 0x00005772e1e1adb4 llvm::lto::opt(llvm::lto::Config const&, llvm::TargetMachine*, unsigned int, llvm::Module&, bool, llvm::ModuleSummaryIndex*, llvm::ModuleSummaryIndex const*, std::vector<unsigned char, std::allocator<unsigned char>> const&, llvm::ArrayRef<llvm::StringRef>) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x77d2db4)
# | #16 0x00005772e1e1bac9 llvm::lto::backend(llvm::lto::Config const&, std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex&, llvm::ArrayRef<llvm::StringRef>) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x77d3ac9)
# | #17 0x00005772e1e04d54 llvm::lto::LTO::runRegularLTO(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x77bcd54)
# | #18 0x00005772e1e041bb llvm::lto::LTO::run(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, llvm::FileCache) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x77bc1bb)
# | #19 0x00005772dfd6f839 lld::elf::BitcodeCompiler::compile() (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x5727839)
# | #20 0x00005772dfc60553 void lld::elf::LinkerDriver::compileBitcodeFiles<llvm::object::ELFType<(llvm::endianness)1, false>>(bool) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x5618553)
# | #21 0x00005772dfc487ff void lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::endianness)1, false>>(llvm::opt::InputArgList&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x56007ff)
# | #22 0x00005772dfc36e72 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x55eee72)
Step 14 (test compiler-rt default) failure: test compiler-rt default (failure)
...
-- Install configuration: "Release"
[417/423] Generating MSAN_INST_GTEST.gtest-all.cc.x86_64-with-call.o
[418/423] Generating MSAN_INST_GTEST.gtest-all.cc.x86_64.o
[419/423] Generating MSAN_INST_TEST_OBJECTS.msan_test.cpp.x86_64-with-call.o
[420/423] Generating Msan-x86_64-with-call-Test
[421/423] Generating MSAN_INST_TEST_OBJECTS.msan_test.cpp.x86_64.o
[422/423] Generating Msan-x86_64-Test
[422/423] Running compiler_rt regression tests
-- Testing: 11642 tests, 64 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.
FAIL: cfi-devirt-lld-i386 :: mfcall.cpp (10045 of 11642)
******************** TEST 'cfi-devirt-lld-i386 :: mfcall.cpp' FAILED ********************
Exit Code: -6

Command Output (stdout):
--
# RUN: at line 3
/home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang   -m32 -fuse-ld=lld -flto  -fsanitize=cfi -fwhole-program-vtables --driver-mode=g++ -fvisibility=hidden -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/cfi/Devirt-lld-i386/Output/mfcall.cpp.tmp /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/cfi/mfcall.cpp
# executed command: /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -m32 -fuse-ld=lld -flto -fsanitize=cfi -fwhole-program-vtables --driver-mode=g++ -fvisibility=hidden -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/cfi/Devirt-lld-i386/Output/mfcall.cpp.tmp /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/cfi/mfcall.cpp
# .---command stderr------------
# | Unknown type!
# | UNREACHABLE executed at /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/CodeGen/ValueTypes.cpp:254!
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
# | Stack dump:
# | 0.	Program arguments: /home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld -z relro --hash-style=gnu --eh-frame-hdr -m elf_i386 -pie -dynamic-linker /lib/ld-linux.so.2 -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/cfi/Devirt-lld-i386/Output/mfcall.cpp.tmp /usr/lib/gcc-cross/i686-linux-gnu/15/../../../../lib32/Scrt1.o /usr/lib/gcc-cross/i686-linux-gnu/15/../../../../lib32/crti.o /usr/lib/gcc-cross/i686-linux-gnu/15/crtbeginS.o -L/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/23/lib/i386-unknown-linux-gnu -L/usr/lib/gcc-cross/i686-linux-gnu/15 -L/usr/lib/gcc-cross/i686-linux-gnu/15/../../../../lib32 -L/lib/i386-linux-gnu -L/lib/../lib32 -L/usr/lib/i386-linux-gnu -L/usr/lib32 -L/usr/lib/gcc-cross/i686-linux-gnu/15/../../../../i686-linux-gnu/lib -L/lib -L/usr/lib -plugin-opt=mcpu=pentium4 /tmp/lit-tmp-3sxpuo1g/mfcall-44c02d.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc-cross/i686-linux-gnu/15/crtendS.o /usr/lib/gcc-cross/i686-linux-gnu/15/../../../../lib32/crtn.o
# | 1.	Running pass "cgscc(function-attrs,argpromotion,function(sroa<modify-cfg>))" on module "ld-temp.o"
# |  #0 0x000060bc4db71f08 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x54c6f08)
# |  #1 0x000060bc4db6ed21 llvm::sys::RunSignalHandlers() (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x54c3d21)
# |  #2 0x000060bc4db72ce1 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
# |  #3 0x000071b0bbc47e10 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x47e10)
# |  #4 0x000071b0bbcae3ec pthread_kill (/usr/lib/x86_64-linux-gnu/libc.so.6+0xae3ec)
# |  #5 0x000071b0bbc47cde raise (/usr/lib/x86_64-linux-gnu/libc.so.6+0x47cde)
# |  #6 0x000071b0bbc288ec abort (/usr/lib/x86_64-linux-gnu/libc.so.6+0x288ec)
# |  #7 0x000060bc4dad3cef (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x5428cef)
# |  #8 0x000060bc50975e87 llvm::MVT::getVT(llvm::Type*, bool) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x82cae87)
# |  #9 0x000060bc50975193 llvm::EVT::getEVT(llvm::Type*, bool) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x82ca193)
# | #10 0x000060bc4fcada87 llvm::X86TTIImpl::areTypesABICompatible(llvm::Function const*, llvm::Function const*, llvm::ArrayRef<llvm::Type*>) const X86TargetTransformInfo.cpp:0:0
# | #11 0x000060bc50a6aada llvm::ArgumentPromotionPass::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x83bfada)
# | #12 0x000060bc519b3863 llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x9308863)
# | #13 0x000060bc519b4e50 llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x9309e50)
# | #14 0x000060bc52349d49 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x9c9ed49)
# | #15 0x000060bc4fe7ddb4 llvm::lto::opt(llvm::lto::Config const&, llvm::TargetMachine*, unsigned int, llvm::Module&, bool, llvm::ModuleSummaryIndex*, llvm::ModuleSummaryIndex const*, std::vector<unsigned char, std::allocator<unsigned char>> const&, llvm::ArrayRef<llvm::StringRef>) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x77d2db4)
# | #16 0x000060bc4fe7eac9 llvm::lto::backend(llvm::lto::Config const&, std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex&, llvm::ArrayRef<llvm::StringRef>) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x77d3ac9)
# | #17 0x000060bc4fe67d54 llvm::lto::LTO::runRegularLTO(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x77bcd54)
# | #18 0x000060bc4fe671bb llvm::lto::LTO::run(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, llvm::FileCache) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x77bc1bb)
# | #19 0x000060bc4ddd2839 lld::elf::BitcodeCompiler::compile() (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x5727839)
# | #20 0x000060bc4dcc3553 void lld::elf::LinkerDriver::compileBitcodeFiles<llvm::object::ELFType<(llvm::endianness)1, false>>(bool) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x5618553)
# | #21 0x000060bc4dcab7ff void lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::endianness)1, false>>(llvm::opt::InputArgList&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x56007ff)
# | #22 0x000060bc4dc99e72 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/ld.lld+0x55eee72)

nikic added a commit that referenced this pull request Jun 23, 2026
Fixes a regression from #205106. getValueType() asserts on aggregate
types. Use CompuateValueVTs() to compute the de-aggregated VTs.

Performing argument promotion for struct types seems pretty
dubious to me, but it was previously allowed, so I'm retaining
that behavior. We may want to disable promotion of aggregates
in ArgPromotion entirely though.
beamandala pushed a commit to beamandala/llvm-project that referenced this pull request Jun 24, 2026
When inlining a function that contains calls with vector arguments, we
have to be careful that inlining does not change the ABI of the call.
E.g. we generally can't inline a function without `+avx` into a
function with `+avx` if there are calls using vectors of size 256 or
larger, because they'd switch from passing in two xmm registers to
passing in a ymm register.

However, the current check is very crude and only allows inlining with
interior calls if the target features match *exactly* (via the base
areTypesABICompatible implementation). This is unnecessarily
conservative, as many target features do not affect the call ABI at all.

Make this check more precise by checking the result of
getRegisterTypeForCallingConv for the type between the TLI instances for
the caller and callee.
beamandala pushed a commit to beamandala/llvm-project that referenced this pull request Jun 24, 2026
Fixes a regression from llvm#205106. getValueType() asserts on aggregate
types. Use CompuateValueVTs() to compute the de-aggregated VTs.

Performing argument promotion for struct types seems pretty
dubious to me, but it was previously allowed, so I'm retaining
that behavior. We may want to disable promotion of aggregates
in ArgPromotion entirely though.
nikic added a commit that referenced this pull request Jul 6, 2026
…#205113)

If inlining is unsound due to incompatible target feature attributes, we
should not inline the call even if alwaysinline is set. This will likely
result in a crash during instruction selection.

We tried this previously in
d6f994a,
but the change had to be reverted because the quality of our
areInlineCompatible() hooks was very bad at the time, which resulted in
inlining not happening in many cases where it was safe.

I think we're in a much better position now. Most notably, we now have a
default areInlineCompatible() implementation that actually does
something sensible (#117493),
inlining compatibility for target features is now specified in TableGen
(#205348). Various
target-specific issues have been fixed as well, e.g. ARM's overly strict
feature whitelist (#205763) and
X86's overly conservative ABI compatibility checks
(#205106).
llvm-upstreamsync Bot pushed a commit to qualcomm/cpullvm-toolchain that referenced this pull request Jul 6, 2026
…et features (#205113)

If inlining is unsound due to incompatible target feature attributes, we
should not inline the call even if alwaysinline is set. This will likely
result in a crash during instruction selection.

We tried this previously in
llvm/llvm-project@d6f994a,
but the change had to be reverted because the quality of our
areInlineCompatible() hooks was very bad at the time, which resulted in
inlining not happening in many cases where it was safe.

I think we're in a much better position now. Most notably, we now have a
default areInlineCompatible() implementation that actually does
something sensible (llvm/llvm-project#117493),
inlining compatibility for target features is now specified in TableGen
(llvm/llvm-project#205348). Various
target-specific issues have been fixed as well, e.g. ARM's overly strict
feature whitelist (llvm/llvm-project#205763) and
X86's overly conservative ABI compatibility checks
(llvm/llvm-project#205106).
llvm-sync Bot pushed a commit to arm/arm-toolchain that referenced this pull request Jul 6, 2026
…et features (#205113)

If inlining is unsound due to incompatible target feature attributes, we
should not inline the call even if alwaysinline is set. This will likely
result in a crash during instruction selection.

We tried this previously in
llvm/llvm-project@d6f994a,
but the change had to be reverted because the quality of our
areInlineCompatible() hooks was very bad at the time, which resulted in
inlining not happening in many cases where it was safe.

I think we're in a much better position now. Most notably, we now have a
default areInlineCompatible() implementation that actually does
something sensible (llvm/llvm-project#117493),
inlining compatibility for target features is now specified in TableGen
(llvm/llvm-project#205348). Various
target-specific issues have been fixed as well, e.g. ARM's overly strict
feature whitelist (llvm/llvm-project#205763) and
X86's overly conservative ABI compatibility checks
(llvm/llvm-project#205106).
llvm-upstream-sync Bot pushed a commit to sriyalamar/cpullvm-toolchain that referenced this pull request Jul 6, 2026
…et features (#205113)

If inlining is unsound due to incompatible target feature attributes, we
should not inline the call even if alwaysinline is set. This will likely
result in a crash during instruction selection.

We tried this previously in
llvm/llvm-project@d6f994a,
but the change had to be reverted because the quality of our
areInlineCompatible() hooks was very bad at the time, which resulted in
inlining not happening in many cases where it was safe.

I think we're in a much better position now. Most notably, we now have a
default areInlineCompatible() implementation that actually does
something sensible (llvm/llvm-project#117493),
inlining compatibility for target features is now specified in TableGen
(llvm/llvm-project#205348). Various
target-specific issues have been fixed as well, e.g. ARM's overly strict
feature whitelist (llvm/llvm-project#205763) and
X86's overly conservative ABI compatibility checks
(llvm/llvm-project#205106).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants