[PATCH] D52177: [InstCombine] Fold ~A - Min/Max(~A, O) -> Max/Min(A, ~O) - A
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 11 15:38:18 PDT 2018
craig.topper added a comment.
Goldmont does have SSE4.2 so shoudl support 128-bit vectors. Not sure why we didn't vectorize. Here's the IR for the loop that changed
for.body8.us: ; preds = %for.body8.us, %for.body.us
%EritePtr.0134.us = phi i8* [ %call.i7, %for.body.us ], [ %incdec.ptr58.us, %for.body8.us ]
%ReadPtr.0133.us = phi i8* [ %phi.call3.i, %for.body.us ], [ %incdec.ptr10.us, %for.body8.us ]
%i.0132.us = phi i32 [ 0, %for.body.us ], [ %inc.us, %for.body8.us ]
%incdec.ptr.us = getelementptr inbounds i8, i8* %ReadPtr.0133.us, i32 1
%44 = load i8, i8* %ReadPtr.0133.us, align 1, !tbaa !14
%incdec.ptr9.us = getelementptr inbounds i8, i8* %ReadPtr.0133.us, i32 2
%45 = load i8, i8* %incdec.ptr.us, align 1, !tbaa !14
%incdec.ptr10.us = getelementptr inbounds i8, i8* %ReadPtr.0133.us, i32 3
%46 = load i8, i8* %incdec.ptr9.us, align 1, !tbaa !14
%47 = icmp ugt i8 %44, %46
%48 = select i1 %47, i8 %44, i8 %46
%49 = icmp ugt i8 %48, %45
%50 = select i1 %49, i8 %48, i8 %45
%51 = xor i8 %50, -1
%sub45.us = sub i8 %50, %44
%sub49.us = sub i8 %50, %45
%sub53.us = sub i8 %50, %46
%incdec.ptr55.us = getelementptr inbounds i8, i8* %EritePtr.0134.us, i32 1
store i8 %sub45.us, i8* %EritePtr.0134.us, align 1, !tbaa !14
%incdec.ptr56.us = getelementptr inbounds i8, i8* %EritePtr.0134.us, i32 2
store i8 %sub49.us, i8* %incdec.ptr55.us, align 1, !tbaa !14
%incdec.ptr57.us = getelementptr inbounds i8, i8* %EritePtr.0134.us, i32 3
store i8 %sub53.us, i8* %incdec.ptr56.us, align 1, !tbaa !14
%incdec.ptr58.us = getelementptr inbounds i8, i8* %EritePtr.0134.us, i32 4
store i8 %51, i8* %incdec.ptr57.us, align 1, !tbaa !14
%inc.us = add nuw i32 %i.0132.us, 1
%exitcond138 = icmp eq i32 %inc.us, %mul
br i1 %exitcond138, label %for.cond5.for.end_crit_edge.us, label %for.body8.us
Repository:
rL LLVM
https://reviews.llvm.org/D52177
More information about the llvm-commits
mailing list