]> granicus.if.org Git - llvm/commitdiff
[PowerPC] add memcmp test with nobuiltin attr; NFC
authorSanjay Patel <spatel@rotateright.com>
Thu, 8 Jun 2017 17:09:18 +0000 (17:09 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 8 Jun 2017 17:09:18 +0000 (17:09 +0000)
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

test/CodeGen/PowerPC/memCmpUsedInZeroEqualityComparison.ll

index e2c842f25b92ec903d04f479e721faba065d5e1e..d6ce5688c66de17c49d7d385a5423826dc25ab0e 100644 (file)
@@ -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
+}
+