From: Sanjay Patel Date: Thu, 8 Jun 2017 17:09:18 +0000 (+0000) Subject: [PowerPC] add memcmp test with nobuiltin attr; NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=06abfee96e7955b9a458ffc6c48442636d6fa641;p=llvm [PowerPC] add memcmp test with nobuiltin attr; NFC In SDAG, we don't expand libcalls with a nobuiltin attribute. It's not clear if that's correct from the existing code comment: "Don't do the check if marked as nobuiltin for some reason." ...adding a test here either way to show that there is currently a different behavior implemented in the CGP-based expansion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304991 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/PowerPC/memCmpUsedInZeroEqualityComparison.ll b/test/CodeGen/PowerPC/memCmpUsedInZeroEqualityComparison.ll index e2c842f25b9..d6ce5688c66 100644 --- a/test/CodeGen/PowerPC/memCmpUsedInZeroEqualityComparison.ll +++ b/test/CodeGen/PowerPC/memCmpUsedInZeroEqualityComparison.ll @@ -196,3 +196,18 @@ define signext i32 @zeroEqualityTest06() { ret i32 %cond } +define i1 @length2_eq_nobuiltin_attr(i8* %X, i8* %Y) { +; CHECK-LABEL: length2_eq_nobuiltin_attr: +; CHECK: # BB#0: +; CHECK-NEXT: lhz 3, 0(3) +; CHECK-NEXT: lhz 4, 0(4) +; CHECK-NEXT: li 5, 0 +; CHECK-NEXT: li 12, 1 +; CHECK-NEXT: cmpw 3, 4 +; CHECK-NEXT: isel 3, 12, 5, 2 +; CHECK-NEXT: blr + %m = tail call signext i32 @memcmp(i8* %X, i8* %Y, i64 2) nobuiltin + %c = icmp eq i32 %m, 0 + ret i1 %c +} +