[all-commits] [llvm/llvm-project] cc6d30: [X86] Fix a bug in TEST with immediate creation

Craig Topper via All-commits all-commits at lists.llvm.org
Fri Jul 23 09:04:10 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cc6d302c91baad2ecf3c9a75ce68d552df0a42b7
      https://github.com/llvm/llvm-project/commit/cc6d302c91baad2ecf3c9a75ce68d552df0a42b7
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2021-07-23 (Fri, 23 Jul 2021)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
    M llvm/test/CodeGen/X86/pr51175.ll

  Log Message:
  -----------
  [X86] Fix a bug in TEST with immediate creation

This code tries to form a TEST from CMP+AND with an optional
truncate in between. If we looked through the truncate, we may
have extra bits in the AND mask that shouldn't participate in
the checks. Normally SimplifyDemendedBits takes care of this, but
the AND may have another user. So manually mask out any extra bits.

Fixes PR51175.

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




More information about the All-commits mailing list