SuccessChanges

Summary

  1. [X86] Fold bitcast(logic(bitcast(X), Y)) --> logic'(X, bitcast(Y)) for int-int bitcasts (details)
  2. [X86][AVX] Fold concat(extract_subvector(v0,c0), extract_subvector(v1,c1)) -> vperm2x128 (details)
Commit 2885d1251f29f3676b2c99b4b3c19d6907272cc1 by llvm-dev
[X86] Fold bitcast(logic(bitcast(X), Y)) --> logic'(X, bitcast(Y)) for int-int bitcasts

Extend the existing combine that handles bitcasting for fp-logic ops to also help remove logic ops across bitcasts to/from the same integer types.

This helps improve AVX512 predicate handling for D/Q logic ops and also allows DAGCombine's scalarizeExtractedBinop to remove some annoying gpr->simd->gpr transfers.

The concat_vectors regression in pr40891.ll will be addressed in a followup commit on this patch.

Differential Revision: https://reviews.llvm.org/D96206
The file was modifiedllvm/test/CodeGen/X86/merge-consecutive-loads-512.ll
The file was modifiedllvm/test/CodeGen/X86/vector-reduce-and-cmp.ll
The file was modifiedllvm/test/CodeGen/X86/vec_ssubo.ll
The file was modifiedllvm/test/CodeGen/X86/vec_saddo.ll
The file was modifiedllvm/test/CodeGen/X86/vector-reduce-and.ll
The file was modifiedllvm/test/CodeGen/X86/vector-reduce-xor.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/X86/avx512-logic.ll
The file was modifiedllvm/test/CodeGen/X86/pr40891.ll
The file was modifiedllvm/test/CodeGen/X86/sse2.ll
The file was modifiedllvm/test/CodeGen/X86/vector-trunc-packus.ll
The file was modifiedllvm/test/CodeGen/X86/memcmp-pgso.ll
The file was modifiedllvm/test/CodeGen/X86/memcmp-more-load-pairs.ll
The file was modifiedllvm/test/CodeGen/X86/memcmp-optsize.ll
The file was modifiedllvm/test/CodeGen/X86/known-signbits-vector.ll
The file was modifiedllvm/test/CodeGen/X86/vector-reduce-or.ll
The file was modifiedllvm/test/CodeGen/X86/widen_cast-5.ll
The file was modifiedllvm/test/CodeGen/X86/xor.ll
The file was modifiedllvm/test/CodeGen/X86/vector-idiv-v2i32.ll
The file was modifiedllvm/test/CodeGen/X86/memcmp.ll
Commit a6a258f1da37a678867bd29f7125417944bdecb2 by llvm-dev
[X86][AVX] Fold concat(extract_subvector(v0,c0), extract_subvector(v1,c1)) -> vperm2x128

Fixes regression exposed by removing bitcasts across logic-ops in D96206.

Differential Revision: https://reviews.llvm.org/D96206
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/X86/pr40891.ll