[all-commits] [llvm/llvm-project] 67e915: [x86] try harder to use shift instead of test if i...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Thu Mar 17 06:14:35 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 67e91510963a5307814aaf8463222635bddf1644
      https://github.com/llvm/llvm-project/commit/67e91510963a5307814aaf8463222635bddf1644
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-03-17 (Thu, 17 Mar 2022)

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

  Log Message:
  -----------
  [x86] try harder to use shift instead of test if it can save some immediate bytes

We favor 'and' and 'test' in earlier phases of optimization,
and that's usually the better option, but we can save a few
instruction bytes by converting a mask constant to a shift here.

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




More information about the All-commits mailing list