[X86][SSE] Fix typo + infinite-loop in HOP(HOP'(X,X),HOP'(Y,Y)) fold (PR52040)
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 2 Oct 2021 14:30:58 +0000 (15:30 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 2 Oct 2021 14:31:12 +0000 (15:31 +0100)
commit9452ec722ce0ba356a5ad178b0b1964ba8efb534
tree299488d83836c22c1e530fac0486a0fedabeb281
parent3d209c76ddb56db73def474450532813e39d95fa
[X86][SSE] Fix typo + infinite-loop in HOP(HOP'(X,X),HOP'(Y,Y)) fold (PR52040)

PR52040 identified several issues with the HOP(HOP'(X,X),HOP'(Y,Y)) -> HOP(PERMUTE(HOP'(X,Y)),PERMUTE(HOP'(X,Y)) slow-HOP fold.

Not only was there a copy+paste typo when accessing the inner HOP operands, but the (unnecessary) ReplaceAllUsesOfValueWith call was missing one use checks.

Now that we have better shuffle combines of HOPs we can just return a new HOP() sequence and not use ReplaceAllUsesOfValueWith at all - this actually improved pair_sum_v8i32_v4i32 codegen as it kicks off further shuffle combines.
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/horizontal-shuffle-2.ll
llvm/test/CodeGen/X86/horizontal-sum.ll