blob: 2e69a3b9be539e29c4d86dd8bf8aeacc419c146e [file] [log] [blame]
James Y Knightd966fb62015-08-19 14:47:04 +00001; RUN: llc -march=sparc < %s
2
3;; getBooleanContents on Sparc used to claim that no bits mattered
4;; other than the first for SELECT. Thus, the 'trunc' got eliminated
5;; as redundant. But, cmp does NOT ignore the other bits!
6
Hans Wennborg4a613702015-08-31 21:10:35 +00007; CHECK-LABEL: select_mask:
James Y Knightd966fb62015-08-19 14:47:04 +00008; CHECK: ldub [%o0], [[R:%[goli][0-7]]]
9; CHECK: and [[R]], 1, [[V:%[goli][0-7]]]
10; CHECK: cmp [[V]], 0
11define i32 @select_mask(i8* %this) {
12entry:
13 %bf.load2 = load i8, i8* %this, align 4
14 %bf.cast5 = trunc i8 %bf.load2 to i1
15 %cond = select i1 %bf.cast5, i32 2, i32 0
16 ret i32 %cond
17}