[llvm-dev] How to get the value for casting in a bitcast instruction more efficiently?

Reid Kleckner via llvm-dev llvm-dev at lists.llvm.org
Thu Dec 15 13:18:27 PST 2016


If you want to look through bitcasts and other no-op pointer type changes,
use Value::stripPointerCasts.

On Wed, Dec 14, 2016 at 9:19 PM, Shen Liu via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi everyone,
>
> This is a simple question but is there an efficient way to get the value directly from a bitcast instruction?
>
> <result> = bitcast <ty> <value> to <ty2>
>
> For example, if i have
>
> MemAddr
> ...
> 0x3d61238   %key = alloca [16 x i8], align 16
> 0x3d612a8   %plain_text = alloca [64 x i8], align 16
> 0x3d61318   %key1 = bitcast [16 x i8]* %key to i8*
> ...
>
> The way i am using is processing all opcodes in %key1, and go back to find %key along the def-use chain. But is there a better way for doing this?
>
> Thanks very much!
>
>
> Best
>
> Shen
>
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161215/e2d9148e/attachment.html>


More information about the llvm-dev mailing list