Remove unused function attributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179476 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nadav Rotem 2013-04-14 05:47:04 +00:00
parent ab105ae95f
commit 1f098af364
9 changed files with 46 additions and 74 deletions

View File

@ -6,35 +6,27 @@ target triple = "x86_64-apple-macosx10.8.0"
;CHECK: @foo
;CHECK: store <4 x i32>
;CHECK: ret
define i32 @foo(i32* nocapture %A, i32 %n) #0 {
define i32 @foo(i32* nocapture %A, i32 %n) {
entry:
%call = tail call i32 (...)* @bar() #2
%mul = mul nsw i32 %n, 5
%add = add nsw i32 %mul, 9
store i32 %add, i32* %A, align 4, !tbaa !0
store i32 %add, i32* %A, align 4
%mul1 = mul nsw i32 %n, 9
%add2 = add nsw i32 %mul1, 9
%arrayidx3 = getelementptr inbounds i32* %A, i64 1
store i32 %add2, i32* %arrayidx3, align 4, !tbaa !0
store i32 %add2, i32* %arrayidx3, align 4
%mul4 = shl i32 %n, 3
%add5 = add nsw i32 %mul4, 9
%arrayidx6 = getelementptr inbounds i32* %A, i64 2
store i32 %add5, i32* %arrayidx6, align 4, !tbaa !0
store i32 %add5, i32* %arrayidx6, align 4
%mul7 = mul nsw i32 %n, 10
%add8 = add nsw i32 %mul7, 9
%arrayidx9 = getelementptr inbounds i32* %A, i64 3
store i32 %add8, i32* %arrayidx9, align 4, !tbaa !0
store i32 %add8, i32* %arrayidx9, align 4
ret i32 undef
}
; We can still vectorize the stores below.
declare i32 @bar(...) #1
attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind }
!0 = metadata !{metadata !"int", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}
declare i32 @bar(...)

View File

@ -18,25 +18,25 @@ target triple = "x86_64-apple-macosx10.8.0"
; CHECK: ret
define i32 @foo(i32* noalias nocapture %B, i32* noalias nocapture %A, i32 %n, i32 %m) #0 {
entry:
%0 = load i32* %A, align 4, !tbaa !0
%0 = load i32* %A, align 4
%mul238 = add i32 %m, %n
%add = mul i32 %0, %mul238
store i32 %add, i32* %B, align 4, !tbaa !0
store i32 %add, i32* %B, align 4
%arrayidx4 = getelementptr inbounds i32* %A, i64 1
%1 = load i32* %arrayidx4, align 4, !tbaa !0
%1 = load i32* %arrayidx4, align 4
%add8 = mul i32 %1, %mul238
%arrayidx9 = getelementptr inbounds i32* %B, i64 1
store i32 %add8, i32* %arrayidx9, align 4, !tbaa !0
store i32 %add8, i32* %arrayidx9, align 4
%arrayidx10 = getelementptr inbounds i32* %A, i64 2
%2 = load i32* %arrayidx10, align 4, !tbaa !0
%2 = load i32* %arrayidx10, align 4
%add14 = mul i32 %2, %mul238
%arrayidx15 = getelementptr inbounds i32* %B, i64 2
store i32 %add14, i32* %arrayidx15, align 4, !tbaa !0
store i32 %add14, i32* %arrayidx15, align 4
%arrayidx16 = getelementptr inbounds i32* %A, i64 3
%3 = load i32* %arrayidx16, align 4, !tbaa !0
%3 = load i32* %arrayidx16, align 4
%add20 = mul i32 %3, %mul238
%arrayidx21 = getelementptr inbounds i32* %B, i64 3
store i32 %add20, i32* %arrayidx21, align 4, !tbaa !0
store i32 %add20, i32* %arrayidx21, align 4
ret i32 0
}
@ -52,32 +52,27 @@ entry:
; CHECK: @foo_fail
; CHECK-NOT: load <4 x i32>
; CHECK: ret
define i32 @foo_fail(i32* noalias nocapture %B, i32* noalias nocapture %A, i32 %n, i32 %m) #0 {
define i32 @foo_fail(i32* noalias nocapture %B, i32* noalias nocapture %A, i32 %n, i32 %m) {
entry:
%0 = load i32* %A, align 4, !tbaa !0
%0 = load i32* %A, align 4
%mul238 = add i32 %m, %n
%add = mul i32 %0, %mul238
store i32 %add, i32* %B, align 4, !tbaa !0
store i32 %add, i32* %B, align 4
%arrayidx4 = getelementptr inbounds i32* %A, i64 1
%1 = load i32* %arrayidx4, align 4, !tbaa !0
%1 = load i32* %arrayidx4, align 4
%add8 = mul i32 %1, %mul238
%arrayidx9 = getelementptr inbounds i32* %B, i64 1
store i32 %add8, i32* %arrayidx9, align 4, !tbaa !0
store i32 %add8, i32* %arrayidx9, align 4
%arrayidx10 = getelementptr inbounds i32* %A, i64 2
%2 = load i32* %arrayidx10, align 4, !tbaa !0
%2 = load i32* %arrayidx10, align 4
%add14 = mul i32 %2, %mul238
%arrayidx15 = getelementptr inbounds i32* %B, i64 2
store i32 %add14, i32* %arrayidx15, align 4, !tbaa !0
store i32 %add14, i32* %arrayidx15, align 4
%arrayidx16 = getelementptr inbounds i32* %A, i64 3
%3 = load i32* %arrayidx16, align 4, !tbaa !0
%3 = load i32* %arrayidx16, align 4
%add20 = mul i32 %3, %mul238
%arrayidx21 = getelementptr inbounds i32* %B, i64 3
store i32 %add20, i32* %arrayidx21, align 4, !tbaa !0
store i32 %add20, i32* %arrayidx21, align 4
ret i32 %0 ;<--------- This value has multiple users and can't be vectorized.
}
attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"int", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}

View File

@ -8,7 +8,7 @@ target triple = "x86_64-apple-macosx10.8.0"
;CHECK-NOT:load <4 x i32>
;CHECK: ret
define i32 @rollable(i32* noalias nocapture %in, i32* noalias nocapture %out, i64 %n) nounwind ssp uwtable {
define i32 @rollable(i32* noalias nocapture %in, i32* noalias nocapture %out, i64 %n) {
%1 = icmp eq i64 %n, 0
br i1 %1, label %._crit_edge, label %.lr.ph

View File

@ -17,7 +17,7 @@ target triple = "x86_64-apple-macosx10.7.0"
;CHECK: add <4 x i32>
;CHECK: store <4 x i32>
;CHECK: ret
define i32 @foo(i32* nocapture %A, i32 %n) nounwind ssp uwtable {
define i32 @foo(i32* nocapture %A, i32 %n) {
%1 = mul nsw i32 %n, 5
%2 = add nsw i32 %1, 7
%3 = load i32* %A, align 4

View File

@ -14,7 +14,7 @@ target triple = "i386-apple-macosx10.8.0"
;CHECK: load <2 x double>
;CHECK: fmul <2 x double>
;CHECK: ret
define i32 @reduce(double* nocapture %A, i32 %n, i32 %m) #0 {
define i32 @reduce(double* nocapture %A, i32 %n, i32 %m) {
entry:
%cmp13 = icmp sgt i32 %n, 0
br i1 %cmp13, label %for.body, label %for.end
@ -24,11 +24,11 @@ for.body: ; preds = %entry, %for.body
%sum.014 = phi double [ %add6, %for.body ], [ 0.000000e+00, %entry ]
%mul = shl nsw i32 %i.015, 1
%arrayidx = getelementptr inbounds double* %A, i32 %mul
%0 = load double* %arrayidx, align 4, !tbaa !0
%0 = load double* %arrayidx, align 4
%mul1 = fmul double %0, 7.000000e+00
%add12 = or i32 %mul, 1
%arrayidx3 = getelementptr inbounds double* %A, i32 %add12
%1 = load double* %arrayidx3, align 4, !tbaa !0
%1 = load double* %arrayidx3, align 4
%mul4 = fmul double %1, 7.000000e+00
%add5 = fadd double %mul1, %mul4
%add6 = fadd double %sum.014, %add5
@ -45,8 +45,3 @@ for.end: ; preds = %for.cond.for.end_cr
ret i32 %sum.0.lcssa
}
attributes #0 = { nounwind readonly ssp "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"double", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}

View File

@ -6,7 +6,7 @@ target triple = "i386-apple-macosx10.8.0"
;CHECK: @foo
;CHECK: load <2 x double>
;CHECK: ret
define double @foo(double* nocapture %D) #0 {
define double @foo(double* nocapture %D) {
br label %1
; <label>:1 ; preds = %1, %0
@ -14,11 +14,11 @@ define double @foo(double* nocapture %D) #0 {
%sum.01 = phi double [ 0.000000e+00, %0 ], [ %9, %1 ]
%2 = shl nsw i32 %i.02, 1
%3 = getelementptr inbounds double* %D, i32 %2
%4 = load double* %3, align 4, !tbaa !0
%4 = load double* %3, align 4
%A4 = fmul double %4, %4
%5 = or i32 %2, 1
%6 = getelementptr inbounds double* %D, i32 %5
%7 = load double* %6, align 4, !tbaa !0
%7 = load double* %6, align 4
%A7 = fmul double %7, %7
%8 = fadd double %A4, %A7
%9 = fadd double %sum.01, %8
@ -30,8 +30,3 @@ define double @foo(double* nocapture %D) #0 {
ret double %9
}
attributes #0 = { nounwind readonly ssp "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"double", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}

View File

@ -8,43 +8,38 @@ target triple = "x86_64-apple-macosx10.8.0"
;CHECK: mul <4 x i32>
;CHECK: ret
define void @SAXPY(i32* noalias nocapture %x, i32* noalias nocapture %y, i32 %a, i64 %i) #0 {
define void @SAXPY(i32* noalias nocapture %x, i32* noalias nocapture %y, i32 %a, i64 %i) {
%1 = getelementptr inbounds i32* %x, i64 %i
%2 = load i32* %1, align 4, !tbaa !0
%2 = load i32* %1, align 4
%3 = mul nsw i32 %2, %a
%4 = getelementptr inbounds i32* %y, i64 %i
%5 = load i32* %4, align 4, !tbaa !0
%5 = load i32* %4, align 4
%6 = add nsw i32 %3, %5
store i32 %6, i32* %1, align 4, !tbaa !0
store i32 %6, i32* %1, align 4
%7 = add i64 %i, 1
%8 = getelementptr inbounds i32* %x, i64 %7
%9 = load i32* %8, align 4, !tbaa !0
%9 = load i32* %8, align 4
%10 = mul nsw i32 %9, %a
%11 = getelementptr inbounds i32* %y, i64 %7
%12 = load i32* %11, align 4, !tbaa !0
%12 = load i32* %11, align 4
%13 = add nsw i32 %10, %12
store i32 %13, i32* %8, align 4, !tbaa !0
store i32 %13, i32* %8, align 4
%14 = add i64 %i, 2
%15 = getelementptr inbounds i32* %x, i64 %14
%16 = load i32* %15, align 4, !tbaa !0
%16 = load i32* %15, align 4
%17 = mul nsw i32 %16, %a
%18 = getelementptr inbounds i32* %y, i64 %14
%19 = load i32* %18, align 4, !tbaa !0
%19 = load i32* %18, align 4
%20 = add nsw i32 %17, %19
store i32 %20, i32* %15, align 4, !tbaa !0
store i32 %20, i32* %15, align 4
%21 = add i64 %i, 3
%22 = getelementptr inbounds i32* %x, i64 %21
%23 = load i32* %22, align 4, !tbaa !0
%23 = load i32* %22, align 4
%24 = mul nsw i32 %23, %a
%25 = getelementptr inbounds i32* %y, i64 %21
%26 = load i32* %25, align 4, !tbaa !0
%26 = load i32* %25, align 4
%27 = add nsw i32 %24, %26
store i32 %27, i32* %22, align 4, !tbaa !0
store i32 %27, i32* %22, align 4
ret void
}
attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"int", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}

View File

@ -4,7 +4,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
target triple = "x86_64-apple-macosx10.8.0"
;CHECK:rollable
define i32 @rollable(i32* noalias nocapture %in, i32* noalias nocapture %out, i64 %n) nounwind ssp uwtable {
define i32 @rollable(i32* noalias nocapture %in, i32* noalias nocapture %out, i64 %n) {
%1 = icmp eq i64 %n, 0
br i1 %1, label %._crit_edge, label %.lr.ph

View File

@ -7,7 +7,7 @@ target triple = "x86_64-apple-macosx10.8.0"
; CHECK: test1
; CHECK: store <2 x double>
; CHECK: ret
define void @test1(double* %a, double* %b, double* %c) nounwind uwtable readonly {
define void @test1(double* %a, double* %b, double* %c) {
entry:
%i0 = load double* %a, align 8
%i1 = load double* %b, align 8