Skip to content

Rework Call's register clobbering#303

Merged
pjaaskel merged 3 commits intomainfrom
regmask
Feb 3, 2026
Merged

Rework Call's register clobbering#303
pjaaskel merged 3 commits intomainfrom
regmask

Conversation

@TopiLeppanen
Copy link
Contributor

Instead of defining all the registers as implicit defs, add the RegisterMask operand to Calls to pass the call-preserved registers to the compiler.

This works around the LLVM limitation of having a max of 255 implicit defs per instruction. Therefore, now our machines can again have larger number of registers.

Fixes #300

Instead of defining all the registers as implicit defs,
add the RegisterMask operand to Calls to pass the call-preserved
registers to the compiler.

This works around the LLVM limitation of having a max of 255 implicit
defs per instruction. Therefore, now our machines can again have large
number of registers.
This reverts commit 5688802.

Now that the backend generation is fixed to work with larger number of register,
re-enable the testing with a bigger machine.
Copy link
Contributor

@pjaaskel pjaaskel left a comment

Choose a reason for hiding this comment

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

Thanks. Can you add a test that specifically tests calls when there are more than 256 regs?

This tests call's regmask operand.
Vararray generates one call with fp and one without.
@TopiLeppanen
Copy link
Contributor Author

TopiLeppanen commented Feb 3, 2026

Added huge.adf to Scheduler tests vararray.c test. It has lots of registers, and the vararray.c generates one call that uses framepointer, and one without so it seems appropriate:
With --llvm-args="-print-after=finalize-isel", I can see that the regmask is there:

  CALL foo, <regmask $fp>, implicit-def dead $ires0, implicit $ires0, implicit-def $sp
  CALL bar, <regmask>, implicit-def dead $ires0, implicit $ires0, implicit-def $sp

This test with huge.adf fails before this patch, and works now.

@pjaaskel pjaaskel merged commit d5e57f2 into main Feb 3, 2026
1 check passed
@TopiLeppanen TopiLeppanen deleted the regmask branch February 5, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid instruction info when using large register files

2 participants