[PATCH] D113035: [InstCombine] enhance vector bitwise select matching

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 2 10:58:05 PDT 2021


spatel created this revision.
spatel added reviewers: lebedev.ri, RKSimon, nlopes.
Herald added subscribers: hiraditya, mcrosier.
spatel requested review of this revision.
Herald added a project: LLVM.

(Cond & C) | (~bitcast(Cond) & D) --> bitcast (select Cond, (bc C), (bc D))

This is part of fixing:
https://llvm.org/PR34047

That report shows a case where a bitcast is sitting between the select condition candidate and its 'not' value due to current cast canonicalization rules.
There's a restriction that might be violated in existing matching, but I still need to investigate if that is possible -
Alive2 shows we can only do this transform safely when the bitcast is from narrow to wide vector elements:
https://alive2.llvm.org/ce/z/Hf66qh


https://reviews.llvm.org/D113035

Files:
  llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  llvm/test/Transforms/InstCombine/logical-select.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113035.384158.patch
Type: text/x-patch
Size: 7323 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211102/af054cda/attachment.bin>


More information about the llvm-commits mailing list