~ubuntu-branches/ubuntu/quantal/llvm-3.1/quantal

« back to all changes in this revision

Viewing changes to test/Transforms/InstSimplify/AndOrXor.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-03-29 19:09:51 UTC
  • Revision ID: package-import@ubuntu.com-20120329190951-aq83ivog4cg8bxun
Tags: upstream-3.1~svn153643
ImportĀ upstreamĀ versionĀ 3.1~svn153643

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; RUN: opt < %s -instsimplify -S | FileCheck %s
 
2
 
 
3
define i64 @pow2(i32 %x) {
 
4
; CHECK: @pow2
 
5
  %negx = sub i32 0, %x
 
6
  %x2 = and i32 %x, %negx
 
7
  %e = zext i32 %x2 to i64
 
8
  %nege = sub i64 0, %e
 
9
  %e2 = and i64 %e, %nege
 
10
  ret i64 %e2
 
11
; CHECK: ret i64 %e
 
12
}
 
13
 
 
14
define i64 @pow2b(i32 %x) {
 
15
; CHECK: @pow2b
 
16
  %sh = shl i32 2, %x
 
17
  %e = zext i32 %sh to i64
 
18
  %nege = sub i64 0, %e
 
19
  %e2 = and i64 %e, %nege
 
20
  ret i64 %e2
 
21
; CHECK: ret i64 %e
 
22
}