Skip to content

Memory Allocation Intrinsics #73

@agle

Description

@agle
  1. Introduce an IR instrinsic function to represent zeroing and nonzeroin memory allocation (calloc and malloc) (use IntrinCall stmt), probably make the set of intrinsics an ADT or polymorphic variant.
  2. Introduce a transform pass that soundly replaces calls to external procedures named malloc and calloc with calls to this intrinsic. Be careful of the detail of which registers are preserved or clobbered across the call. Most likely assume an IR with parameter form, and assume the ABI is adhered to.

The goal here is to avoid analyses having to ever match on procedure names and apply a specific semantics; if we do this we need to introduce an intrinsic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions