Carlo Kok via llvm-dev
2018-Jan-11 08:51 UTC
[llvm-dev] wasm: Bad codegen for i8 comparison
(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
Dan Gohman via llvm-dev
2018-Jan-11 17:53 UTC
[llvm-dev] wasm: Bad codegen for i8 comparison
Hello, Can you check whether your build includes r317710 <https://llvm.org/svn/llvm-project/llvm/trunk at 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>
Carlo Kok via llvm-dev
2018-Jan-11 18:19 UTC
[llvm-dev] wasm: Bad codegen for i8 comparison
On 2018-01-11 18:53, Dan Gohman wrote:> Hello, > > Can you check whether your build includes r317710 [3]? > > Thanks, > > Dan >Hi, thanks I missed that one. I'll update and see if that fixes it.
Carlo Kok via llvm-dev
2018-Jan-12 13:49 UTC
[llvm-dev] wasm: Bad codegen for i8 comparison
Op 11-1-2018 om 18:53 schreef Dan Gohman:> Hello, > > Can you check whether your build includes r317710 <https://llvm.org/svn/llvm-project/llvm/trunk at 317710>? > > Thanks, > > DanThis completely fixes it. Thanks!