Issue |
54743
|
Summary |
[X86] Vector "shifted mask" immediate materialization
|
Labels |
backend:X86
|
Assignees |
|
Reporter |
LebedevRI
|
Currently, we only special-case all-zeros and all-ones constants,
because both of them can be materialized by a single dep-breaking instruction,
and all-zeros may even be a zero-cycle instruction.
But for the other constants, we e.g. fallback to broadcast load from constant pool.
Is that always optimal? For example, to materialize a "shifted mask" constant
(https://github.com/llvm/llvm-project/blob/c2a8a104ec320c8bed39c3632eae2fb37f53487b/llvm/include/llvm/Support/MathExtras.h#L477-L481) by materializing all-ones constant + one or two shifts:
https://godbolt.org/z/beWjqrq6f
Wouldn't that be better?
(inverse shifted mask would also require an `not`, but not sure if that will be profitable anymore.)
CC @RKSimon @topperc @spatel-gh
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs