[llvm] r259381 - [SystemZ] Fix wrong-code generation for certain always-false conditions

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 5 14:13:25 PST 2016



Hi Hans,

and one more that would be good to see in 3.8; this one didn't show up in
the test suites, but caused a miscompile of the swift compiler.

>Author: uweigand
>Date: Mon Feb  1 12:31:19 2016
>New Revision: 259381
>
>URL: http://llvm.org/viewvc/llvm-project?rev=259381&view=rev
>Log:
>[SystemZ] Fix wrong-code generation for certain always-false conditions
>
>We've found another bug in the code generation logic conditions for a
>certain class of always-false conditions, those of the form
>   if ((a & 1) < 0)
>
>These only reach the back end when compiling without optimization.
>
>The bug was introduced by the choice of using TEST UNDER MASK
>to implement a check for
>   if ((a & MASK) < VAL)
>as
>   if ((a & MASK) == 0)
>
>where VAL is less than the the lowest bit of MASK.  This is correct
>in all cases except for VAL == 0, in which case the original
>condition is always false, but the replacement isn't.
>
>Fixed by excluding that particular case.
>
>
>Added:
>    llvm/trunk/test/CodeGen/SystemZ/int-cmp-53.ll
>Modified:
>    llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp


Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand | Phone: +49-7031/16-3727
  STSM, GNU/Linux compilers and toolchain
  IBM Deutschland Research & Development GmbH
  Vorsitzende des Aufsichtsrats: Martina Koederitz | Geschäftsführung: Dirk
Wittkopp
  Sitz der Gesellschaft: Böblingen | Registergericht: Amtsgericht
Stuttgart, HRB 243294
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160205/811564ae/attachment.html>


More information about the llvm-commits mailing list