[llvm-dev] Storing and loading of i1

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] Storing and loading of i1

Matthias Braun via llvm-dev
Hi,

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?

Cheers,
Michael Haidl
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Storing and loading of i1

Matthias Braun via llvm-dev
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
https://godbolt.org/g/4zAFjM .

-- Sanjoy

On Thu, Aug 17, 2017 at 5:21 AM, Haidl, Michael via llvm-dev
<[hidden email]> wrote:

> Hi,
>
> 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?
>
> Cheers,
> Michael Haidl
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev