[all-commits] [llvm/llvm-project] bc2c4f: [X86] combineAndnp - constant fold ANDNP(C, X) -> A...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Fri Jul 29 07:12:49 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bc2c4f6c8555040a74dd6cc03ae6367746329b52
      https://github.com/llvm/llvm-project/commit/bc2c4f6c8555040a74dd6cc03ae6367746329b52
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-07-29 (Fri, 29 Jul 2022)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/combine-udiv.ll
    M llvm/test/CodeGen/X86/insert-into-constant-vector.ll

  Log Message:
  -----------
  [X86] combineAndnp - constant fold ANDNP(C,X) -> AND(~C,X) (REAPPLIED)

If the LHS op has a single use then using the more general AND op is likely to allow commutation, load folding, generic folds etc.

Updated version - original version rG057db2002bb3 didn't correctly account for multiple uses of the mask that might be folding "OR(AND(X,C),AND(Y,~C)) -> OR(AND(X,C),ANDNP(C,Y))" in canonicalizeBitSelect




More information about the All-commits mailing list