[PATCH] D150422: [ConstantFolding] fold integers whose bitwidth is greater than 63, and not multiplies of 8

Kohei Asano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 12 03:00:34 PDT 2023


khei4 added a comment.

@nikic Thank you for your review!

> We currently don't specify the precise memory contents for non-byte-sized integers, so it's not really possible to fold such cases now. (We only specify what happens if you store an i4 and load i4, but for example not what happens if you store i4 and then load i8.)

So, does it mean loading by different bit-width is undefined behavior? It sounds like we can fold it by the value by assuming a non-byte-size integer is allocated with a bigger byte-sized type! (but does it break something?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150422/new/

https://reviews.llvm.org/D150422



More information about the llvm-commits mailing list