mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
compiler: let escape analysis look across bitcasts
This is necessary to avoid memory allocation in the math packages in some functions.
This commit is contained in:
@@ -207,6 +207,11 @@ func (c *Compiler) doesEscape(value llvm.Value) bool {
|
||||
if c.doesEscape(use) {
|
||||
return true
|
||||
}
|
||||
} else if use.IsABitCastInst() != nilValue {
|
||||
// A bitcast escapes if the casted-to value escapes.
|
||||
if c.doesEscape(use) {
|
||||
return true
|
||||
}
|
||||
} else if use.IsALoadInst() != nilValue {
|
||||
// Load does not escape.
|
||||
} else if use.IsAStoreInst() != nilValue {
|
||||
|
||||
Reference in New Issue
Block a user