Open zhengyang92 opened 6 months ago
Similar issue: https://github.com/llvm/llvm-project/pull/84645
It may be a SLP issue. @zhengyang92 Could you please provide the IR before SLP?
cc @alexey-bataev
Instcombine already does something similar for binops in InstCombinerImpl::foldVectorBinop, so we probably need to try to add an InstCombinerImpl::foldVectorUnaryop equivalent
Hi!
This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
test/
create fine-grained testing targets, so you can e.g. use make check-clang-ast
to only run Clang's AST tests.git clang-format HEAD~1
to format your changes.If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.
@llvm/issue-subscribers-good-first-issue
Author: Zhengyang Liu (zhengyang92)
Hi, I'm new to instcombine. Am I right for thinking this implies the following:
foldVectorUnaryop(UnaryOperator &Inst)
.visitFNeg
, add the new foldVectorUnaryop(
call.
I'm interested in implementing this.%2 = shufflevector <2 x float> %0, <2 x float> poison, <2 x i32> <i32 1, i32 poison> %4 = shufflevector <2 x float> %2, <2 x float> %3, <2 x i32> <i32 0, i32 3> %sv = shufflevector <2 x float> %0, <2 x float> %2, <2 x i32> <i32 1, i32 3>
@RKSimon Is it safe to change the mask?
Hey there! I'm new to llvm and I'd like for this task to be assigned to me.
@RKSimon Could you explain more on this topic? I don't understand the relation of this optimization with InstCombinerImpl::foldVectorUnaryop, or does this optimization related to https://github.com/llvm/llvm-project/blob/ed1cfffe9b2b2d3cc9279ff83400ace156b317a2/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp#L2454
Sorry - you're better off with somebody who understands all the InstCombine folds, there might be something already present that almost does this that I'm not aware of
Is anybody still looking at this?
I could take a look; I'll try to work on this.
@juanarbol are you still working on this? If not I'd like to take it up.
https://godbolt.org/z/T4sTh8W87 https://alive2.llvm.org/ce/z/fh2VmQ
@dtcxzyw @regehr @RKSimon