Cranelift: disallow marking entry block 'cold'. (#4659)
This is a nonsensical constraint: the entry block must come first in the compiled code's layout, so it cannot also be sunk to the end of the function. This PR modifies the CLIF verifier to disallow this situation entirely. It also adds an assert during final block-order computation to catch the problem (and avoid a silent miscompile) even if the verifier is disabled. Fixes #4656.
This commit is contained in:
6
cranelift/filetests/filetests/verifier/cold_entry.clif
Normal file
6
cranelift/filetests/filetests/verifier/cold_entry.clif
Normal file
@@ -0,0 +1,6 @@
|
||||
test verifier
|
||||
|
||||
function %entry_block_not_cold() {
|
||||
block0 cold: ; error: entry block cannot be marked as cold
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user