Skip to content

Conversation

@abhishek-kaushik22
Copy link
Contributor

After 69bec0a was merged, this test was failing.

After 69bec0a was merged, this test was failing.
@llvmbot
Copy link
Member

llvmbot commented Aug 3, 2025

@llvm/pr-subscribers-backend-x86

Author: Abhishek Kaushik (abhishek-kaushik22)

Changes

After 69bec0a was merged, this test was failing.


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

1 Files Affected:

  • (modified) llvm/test/CodeGen/X86/large-displacements.ll (+2)
diff --git a/llvm/test/CodeGen/X86/large-displacements.ll b/llvm/test/CodeGen/X86/large-displacements.ll
index 8935ec07bb3fa..cc6395d7b7fd0 100644
--- a/llvm/test/CodeGen/X86/large-displacements.ll
+++ b/llvm/test/CodeGen/X86/large-displacements.ll
@@ -6,6 +6,7 @@
 
 define i32 @main() #0 {
 ; ERR-i686: error: <unknown>:0:0: 64-bit offset calculated but target is 32-bit
+; ERR-i686: warning: <unknown>:0:0: stack frame size (4294967324) exceeds limit (4294967295) in function 'main'
 ;
 ; x86_64-LABEL: main:
 ; x86_64:       # %bb.0: # %entry
@@ -44,6 +45,7 @@ entry:
 ; Same test as above but for an anonymous function.
 define i32 @0() #0 {
 ; ERR-i686: error: <unknown>:0:0: 64-bit offset calculated but target is 32-bit
+; ERR-i686: warning: <unknown>:0:0: stack frame size (4294967324) exceeds limit (4294967295) in function '@0'
 ;
 ; x86_64-LABEL: __unnamed_1:
 ; x86_64:       # %bb.0: # %entry

; Same test as above but for an anonymous function.
define i32 @0() #0 {
; ERR-i686: error: <unknown>:0:0: 64-bit offset calculated but target is 32-bit
; ERR-i686: warning: <unknown>:0:0: stack frame size (4294967324) exceeds limit (4294967295) in function '@0'
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this emitting both an error and a warning

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The warning was always there and was probably missed by @wesleywiser? It is coming from llvm/lib/CodeGen/PrologEpilogInserter.cpp:L315

https://godbolt.org/z/G4W48jcb6

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please can you confirm that this works with builds with EXPENSIVE_CHECKS enabled and disabled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked with a debug build and EXPENSIVE_CHECKS on and it was still failing with a fatal_error in MachineVerifier. I've used --verify-machineinstrs=0 to fix this for now, but probably we need to check the return code in PEIImpl::replaceFrameIndices to stop codegen after the error?

      // If this instruction has a FrameIndex operand, we need to
      // use that target machine register info object to eliminate
      // it.
      TRI.eliminateFrameIndex(MI, SPAdj, i, RS);

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm sorry but it looks like we need to revert #123872 and address the problem properly (and when we recommit the tests will need -verify-machineinstr set)

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.

4 participants