Skip to content

Commit ba55a40

Browse files
committedApr 9, 2019
[AArch64] Add test case to show missed opportunity to remove a shift before tbnz when the shift has been zero extended from i32 to i64. NFC
This pattern showed up in D60358 and it was suggested I had a test and fix that separately. llvm-svn: 358030
1 parent 8e2871c commit ba55a40

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
 

‎llvm/test/CodeGen/AArch64/tbz-tbnz.ll

+21
Original file line numberDiff line numberDiff line change
@@ -359,3 +359,24 @@ then:
359359
end:
360360
ret void
361361
}
362+
363+
define void @test20(i32 %in) {
364+
; CHECK-LABEL: @test20
365+
%shl = shl i32 %in, 3
366+
%zext = zext i32 %shl to i64
367+
%and = and i64 %zext, 32
368+
%cond = icmp eq i64 %and, 0
369+
br i1 %cond, label %then, label %end
370+
371+
; FIXME: Should be no lsl
372+
; CHECK: lsl w8, w0, #3
373+
; CHECK: tbnz w8, #5
374+
375+
then:
376+
call void @t()
377+
br label %end
378+
379+
end:
380+
ret void
381+
}
382+

0 commit comments

Comments
 (0)
Please sign in to comment.