llvm.org GIT mirror llvm / fcfee17
[PowerPC] Convert a README.txt entry into a better test We now produce the desired code as noted in the README.txt file (no spurious or). Remove the README entry and improve the regression test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225214 91177308-0d34-0410-b5e6-96231b3b80d8 Hal Finkel 5 years ago
2 changed file(s) with 7 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
490490 addic r3,r3,-1
491491 subfe r3,r3,r3
492492 blr
493
494 ===-------------------------------------------------------------------------===
495
496 test/CodeGen/PowerPC/2007-03-24-cntlzd.ll compiles to:
497
498 __ZNK4llvm5APInt17countLeadingZerosEv:
499 ld r2, 0(r3)
500 cntlzd r2, r2
501 or r2, r2, r2 <<-- silly.
502 addi r3, r2, -64
503 blr
504
505 The dead or is a 'truncate' from 64- to 32-bits.
506493
507494 ===-------------------------------------------------------------------------===
508495
None ; RUN: llc < %s -march=ppc64 -mcpu=g5 | grep cntlzd
0 ; RUN: llc < %s -march=ppc64 -mcpu=g5 | FileCheck %s
11
22 define i32 @_ZNK4llvm5APInt17countLeadingZerosEv(i64 *%t) nounwind {
33 %tmp19 = load i64* %t
66 %tmp89 = add i32 %tmp23, -64 ; [#uses=1]
77 %tmp90 = add i32 %tmp89, 0 ; [#uses=1]
88 ret i32 %tmp90
9
10 ; CHECK-LABEL: @_ZNK4llvm5APInt17countLeadingZerosEv
11 ; CHECK: ld [[REG1:[0-9]+]], 0(3)
12 ; CHECK-NEXT: cntlzd [[REG2:[0-9]+]], [[REG1]]
13 ; CHECK-NEXT: addi 3, [[REG2]], -64
14 ; CHECK-NEXT: blr
915 }
1016
1117 declare i64 @llvm.ctlz.i64(i64, i1)