[llvm-dev] wasm: Bad codegen for i8 comparison

Dan Gohman via llvm-dev llvm-dev at lists.llvm.org
Thu Jan 11 09:53:33 PST 2018


Hello,

Can you check whether your build includes r317710
<https://llvm.org/svn/llvm-project/llvm/trunk@317710>?

Thanks,

Dan


On Thu, Jan 11, 2018 at 12:51 AM, Carlo Kok via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> (Currently using a build from november but I didn't see any commit that
> could fix this for wasm); With the wasm backend,
>
>
>  %2 = icmp sgt i8 %0, -1
>
> becomes:
>         i32.const       $4=, 255
>         i32.const       $2=, 255
>         i32.and         $3=, $0, $2
>         i32.const       $5=, 255
>         i32.and         $6=, $4, $5
>         i32.gt_s        $7=, $3, $6
>
> Which essentially does (arg & 0xff) > (0xff & 0xff) (if I read it
> correctly) and seems to always result in false.
>
> Full testcase:
> https://gist.github.com/carlokok/579b7793465cd0299cf4c609c569f559
> _______________________________________________
> 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/20180111/c929cb7a/attachment.html>


More information about the llvm-dev mailing list