We encounter a performance drop caused by
6997f4d07fa4b462dd3a02838a2cfed45db9c8a0
We should not try fold allof(cmpeq(x,y)) -> ptest(sub(x,y)) if the cmpeq has other users.
I meet the problem from following case:
// The cmp result has another user at llvm.cttz.i32 %427 = load <32 x i8>, <32 x i8>* %426, align 1 %428 = load <32 x i8>, <32 x i8>* %424, align 1 %**429 **= icmp ne <32 x i8> %427, %428 %**430 **= bitcast <32 x i1> %**429 **to i32 %431 = icmp eq i32 %430, 0 br i1 %431, label %436, label %432 432: ; preds = %421 %433 = call i32 @llvm.cttz.i32(i32 %**430**, i1 true), !dbg !13967, !range !12902
I'm struggling to get a test case for the any-of pattern (the PTEST fold only occurs for all-of) - have you seen anything?