[llvm] r358030 - [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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 12:23:37 PDT 2019


Author: ctopper
Date: Tue Apr  9 12:23:37 2019
New Revision: 358030

URL: http://llvm.org/viewvc/llvm-project?rev=358030&view=rev
Log:
[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.

Modified:
    llvm/trunk/test/CodeGen/AArch64/tbz-tbnz.ll

Modified: llvm/trunk/test/CodeGen/AArch64/tbz-tbnz.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/tbz-tbnz.ll?rev=358030&r1=358029&r2=358030&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/tbz-tbnz.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/tbz-tbnz.ll Tue Apr  9 12:23:37 2019
@@ -359,3 +359,24 @@ then:
 end:
   ret void
 }
+
+define void @test20(i32 %in) {
+; CHECK-LABEL: @test20
+  %shl = shl i32 %in, 3
+  %zext = zext i32 %shl to i64
+  %and = and i64 %zext, 32
+  %cond = icmp eq i64 %and, 0
+  br i1 %cond, label %then, label %end
+
+; FIXME: Should be no lsl
+; CHECK: lsl w8, w0, #3
+; CHECK: tbnz w8, #5
+
+then:
+  call void @t()
+  br label %end
+
+end:
+  ret void
+}
+




More information about the llvm-commits mailing list