2014-07-25 06:20:10 +08:00
|
|
|
; RUN: llc -O=2 < %s -mtriple=powerpc-netbsd | FileCheck %s
|
|
|
|
|
|
|
|
; CHECK-NOT: bl __lshrti3
|
|
|
|
|
|
|
|
; ModuleID = 'lshrti3-ppc32.c'
|
|
|
|
target datalayout = "E-m:e-p:32:32-i64:64-n32"
|
|
|
|
target triple = "powerpc--netbsd"
|
|
|
|
|
|
|
|
; Function Attrs: nounwind uwtable
|
|
|
|
define i32 @fn1() #0 {
|
|
|
|
entry:
|
|
|
|
%.promoted = load i72* inttoptr (i32 1 to i72*), align 4
|
|
|
|
br label %while.cond
|
|
|
|
|
|
|
|
while.cond: ; preds = %while.cond, %entry
|
|
|
|
%bf.set3 = phi i72 [ %bf.set, %while.cond ], [ %.promoted, %entry ]
|
|
|
|
%bf.lshr = lshr i72 %bf.set3, 40
|
|
|
|
%bf.lshr.tr = trunc i72 %bf.lshr to i32
|
|
|
|
%bf.cast = and i32 %bf.lshr.tr, 65535
|
|
|
|
%dec = add nsw i32 %bf.lshr.tr, 65535
|
|
|
|
%0 = zext i32 %dec to i72
|
|
|
|
%bf.value = shl nuw i72 %0, 40
|
|
|
|
%bf.shl = and i72 %bf.value, 72056494526300160
|
|
|
|
%bf.clear2 = and i72 %bf.set3, -72056494526300161
|
|
|
|
%bf.set = or i72 %bf.shl, %bf.clear2
|
|
|
|
%tobool = icmp eq i32 %bf.cast, 0
|
|
|
|
br i1 %tobool, label %while.end, label %while.cond
|
|
|
|
|
|
|
|
while.end: ; preds = %while.cond
|
|
|
|
%bf.set.lcssa = phi i72 [ %bf.set, %while.cond ]
|
|
|
|
store i72 %bf.set.lcssa, i72* inttoptr (i32 1 to i72*), align 4
|
|
|
|
ret i32 undef
|
|
|
|
}
|
|
|
|
|
|
|
|
attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
|
|
|
|
|
|
|
!llvm.ident = !{!0}
|
|
|
|
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!0 = !{!"clang version 3.5.0 (213754)"}
|