[all-commits] [llvm/llvm-project] 1af51f: [TargetLowering] Add test for bit comparison fold

Sven van Haastregt via All-commits all-commits at lists.llvm.org
Wed Oct 21 03:48:42 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 1af51f077b003253ff50567022efd1e850b2ec54
      https://github.com/llvm/llvm-project/commit/1af51f077b003253ff50567022efd1e850b2ec54
  Author: Sven van Haastregt <sven.vanhaastregt at arm.com>
  Date:   2020-10-21 (Wed, 21 Oct 2020)

  Changed paths:
    A llvm/test/CodeGen/NVPTX/pow2_mask_cmp.ll

  Log Message:
  -----------
  [TargetLowering] Add test for bit comparison fold

This adds a test covering an issue in bit comparison folding.  The
issue will be addressed in the subsequent commit.

Patch by Erik Hogeman.

Differential Revision: https://reviews.llvm.org/D89390


  Commit: bfc961aeb2d0e5a05bca7a894cbc4370f5e79a6a
      https://github.com/llvm/llvm-project/commit/bfc961aeb2d0e5a05bca7a894cbc4370f5e79a6a
  Author: Sven van Haastregt <sven.vanhaastregt at arm.com>
  Date:   2020-10-21 (Wed, 21 Oct 2020)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    M llvm/test/CodeGen/NVPTX/pow2_mask_cmp.ll

  Log Message:
  -----------
  [TargetLowering] Check boolean content when folding bit compare

Updates an optimization that relies on boolean contents being either 0
or 1 to properly check for this before triggering.

The following:
  (X & 8) != 0 --> (X & 8) >> 3
Produces unexpected results when a boolean 'true' value is represented
by negative one.

Patch by Erik Hogeman.

Differential Revision: https://reviews.llvm.org/D89390


Compare: https://github.com/llvm/llvm-project/compare/5290f50e44b6...bfc961aeb2d0


More information about the All-commits mailing list