forked from OSchip/llvm-project
[Hexagon] Remove incorrect pattern for swiz
The pattern had a couple of problems: - It was checking for loads of bytes in the reverse order to what it should have been looking for. - It would replace loads of bytes with a load of a word without making sure that the alignment was correct. Thanks to Eli Friedman for pointing it out. llvm-svn: 343514
This commit is contained in:
parent
54ff0df2dc
commit
6d569a2cc4
|
@ -1119,14 +1119,6 @@ def: Pat<(or (or (or (shl (Zext64 (and I32:$b, (i32 65535))), (i32 16)),
|
|||
(Combinew (A2_combine_ll I32:$d, I32:$c),
|
||||
(A2_combine_ll I32:$b, I32:$a))>;
|
||||
|
||||
def: Pat<(or (or (shl (or (shl (i32 (extloadi8 (add I32:$b, 3))),
|
||||
(i32 8)),
|
||||
(i32 (zextloadi8 (add I32:$b, 2)))),
|
||||
(i32 16)),
|
||||
(shl (i32 (zextloadi8 (add I32:$b, 1))), (i32 8))),
|
||||
(zextloadi8 I32:$b)),
|
||||
(A2_swiz (L2_loadri_io IntRegs:$b, 0))>;
|
||||
|
||||
let AddedComplexity = 200 in {
|
||||
def: Pat<(or (shl I32:$Rt, (i32 16)), (and I32:$Rs, (i32 65535))),
|
||||
(A2_combine_ll I32:$Rt, I32:$Rs)>;
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
; RUN: llc -march=hexagon < %s | FileCheck %s
|
||||
; CHECK: swiz
|
||||
|
||||
target triple = "hexagon"
|
||||
|
||||
%s.0 = type { [4 x i32], [2 x i32], [64 x i8] }
|
||||
|
||||
; Function Attrs: nounwind
|
||||
define void @f0(%s.0* nocapture %a0, i8* nocapture %a1, i32 %a2) #0 {
|
||||
b0:
|
||||
%v0 = getelementptr inbounds %s.0, %s.0* %a0, i32 0, i32 2, i32 0
|
||||
br label %b1
|
||||
|
||||
b1: ; preds = %b1, %b0
|
||||
%v1 = phi i16 [ 16, %b0 ], [ %v22, %b1 ]
|
||||
%v2 = phi i8* [ %v0, %b0 ], [ %v21, %b1 ]
|
||||
%v3 = getelementptr inbounds i8, i8* %v2, i32 3
|
||||
%v4 = load i8, i8* %v3, align 1, !tbaa !0
|
||||
%v5 = zext i8 %v4 to i32
|
||||
%v6 = shl nuw nsw i32 %v5, 8
|
||||
%v7 = getelementptr inbounds i8, i8* %v2, i32 2
|
||||
%v8 = load i8, i8* %v7, align 1, !tbaa !0
|
||||
%v9 = zext i8 %v8 to i32
|
||||
%v10 = or i32 %v6, %v9
|
||||
%v11 = shl nuw i32 %v10, 16
|
||||
%v12 = getelementptr inbounds i8, i8* %v2, i32 1
|
||||
%v13 = load i8, i8* %v12, align 1, !tbaa !0
|
||||
%v14 = zext i8 %v13 to i32
|
||||
%v15 = shl nuw nsw i32 %v14, 8
|
||||
%v16 = load i8, i8* %v2, align 1, !tbaa !0
|
||||
%v17 = zext i8 %v16 to i32
|
||||
%v18 = or i32 %v11, %v15
|
||||
%v19 = or i32 %v18, %v17
|
||||
%v20 = bitcast i8* %v2 to i32*
|
||||
store i32 %v19, i32* %v20, align 4, !tbaa !3
|
||||
%v21 = getelementptr inbounds i8, i8* %v2, i32 4
|
||||
%v22 = add i16 %v1, -1
|
||||
%v23 = icmp eq i16 %v22, 0
|
||||
br i1 %v23, label %b2, label %b1
|
||||
|
||||
b2: ; preds = %b1
|
||||
ret void
|
||||
}
|
||||
|
||||
attributes #0 = { nounwind }
|
||||
|
||||
!0 = !{!1, !1, i64 0}
|
||||
!1 = !{!"omnipotent char", !2}
|
||||
!2 = !{!"Simple C/C++ TBAA"}
|
||||
!3 = !{!4, !4, i64 0}
|
||||
!4 = !{!"int", !1}
|
Loading…
Reference in New Issue