Allow crucible_alloc_aligned
to specify less alignment than default for type
#647
Labels
subsystem: crucible-llvm
Issues related to LLVM bitcode verification with crucible-llvm
Currently
crucible_alloc_aligned
can only be used to specify a stronger alignment constraint than the default alignment for the type of the memory region. For example, a pointer toi32
has a default alignment of 4 bytes;crucible_alloc_aligned
can be used to specify a stronger 8-byte alignment, but trying to specify ani32
pointer with 1- or 2-byte alignment will yield an error message.We should relax this check, and allow things like
crucible_alloc_aligned 1 i32
to specify a pointer to 32-bit integer with only 1-byte alignment.LLVM allows us to write functions using unaligned read and write instructions. For example, we can have a function that takes an argument pointer of type
i32*
and then uses it with load statements that only assert 1-byte alignment (which might compile to special unaligned-read instructions on some architectures). Relaxing the minimum alignment check allows us to write accurate SAW specifications of such functions.The text was updated successfully, but these errors were encountered: