[PATCH] D58475: [X86] Improve detection of unneeded shift amount masking to also handle the case that the LHS has known zeroes in it

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 6 09:19:06 PST 2020


craig.topper marked an inline comment as done.
craig.topper added inline comments.


================
Comment at: llvm/trunk/lib/Target/X86/X86InstrCompiler.td:1803
   // (shift x (and y, 63)) ==> (shift x, y)
-  def : Pat<(frag GR64:$src1, GR64:$src2, (and CL, immShift64)),
+  def : Pat<(frag GR64:$src1, GR64:$src2, (shiftMask32 CL)),
             (!cast<Instruction>(name # "64rrCL") GR64:$src1, GR64:$src2)>;
----------------
RKSimon wrote:
> @craig.topper This looks like a typo - shouldn't it be ShiftMask64 for the GR64 case?
Yeah that does look like a typo. Must have copy/pasted too much.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58475/new/

https://reviews.llvm.org/D58475





More information about the llvm-commits mailing list