[all-commits] [llvm/llvm-project] 86779d: [VectorCombine] Fold "(or (zext (bitcast X)), (shl...
Simon Pilgrim via All-commits
all-commits at lists.llvm.org
Thu Dec 12 05:45:32 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 86779da52be6c6900a57fbba243f6894b19bb9b1
https://github.com/llvm/llvm-project/commit/86779da52be6c6900a57fbba243f6894b19bb9b1
Author: Simon Pilgrim <llvm-dev at redking.me.uk>
Date: 2024-12-12 (Thu, 12 Dec 2024)
Changed paths:
M llvm/lib/Transforms/Vectorize/VectorCombine.cpp
M llvm/test/Transforms/VectorCombine/X86/concat-boolmasks.ll
Log Message:
-----------
[VectorCombine] Fold "(or (zext (bitcast X)), (shl (zext (bitcast Y)), C))" -> "(bitcast (concat X, Y))" MOVMSK bool mask style patterns (#119695)
Mask/Bool vectors are often bitcast to/from scalar integers, in particular when concatenating mask results, often this is due to the difficulties of working with vector of bools on C/C++. On x86 this typically involves the MOVMSK/KMOV instructions.
To concatenate bool masks, these are typically cast to scalars, which are then zero-extended, shifted and OR'd together.
This patch attempts to match these scalar concatenation patterns and convert them to vector shuffles instead. This in turn often assists with further vector combines, depending on the cost model.
Reapplied patch from #119559 - fixed use after free issue.
Fixes #111431
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list