Storing and loading of i1


I am looking for the canonical way to store i1 values (results from
compares) to memory and load them back in another function. Is a zext to
i8 before the store and a trunc to i1 after the load of the stored i8 a
safe approach?

Michael Haidl

Hi Michael,

When in doubt about the canonical way to do something, try writing a
small C/C++ snippet and seeing what clang lowers it to, like so
Compiler Explorer .

-- Sanjoy