OSDN Git Service

[x86] add CGP uaddo test with weird type; NFC
authorSanjay Patel <spatel@rotateright.com>
Sun, 3 Feb 2019 14:22:43 +0000 (14:22 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 3 Feb 2019 14:22:43 +0000 (14:22 +0000)
There's probably no reason to try this transform
for an obviously unsupported op.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352993 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/X86/codegen-prepare-uaddo.ll

index 1ac9eb2..dbf32f0 100644 (file)
@@ -249,4 +249,23 @@ define void @test_18446744073709551615(i64*, i64*) {
   ret void
 }
 
+define i1 @illegal_type(i17 %x, i17* %p) {
+; CHECK-LABEL: illegal_type:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    andl $131071, %edi # imm = 0x1FFFF
+; CHECK-NEXT:    addl $29, %edi
+; CHECK-NEXT:    movl %edi, %ecx
+; CHECK-NEXT:    andl $131071, %ecx # imm = 0x1FFFF
+; CHECK-NEXT:    cmpl %edi, %ecx
+; CHECK-NEXT:    setne %al
+; CHECK-NEXT:    movw %di, (%rsi)
+; CHECK-NEXT:    shrl $16, %ecx
+; CHECK-NEXT:    movb %cl, 2(%rsi)
+; CHECK-NEXT:    retq
+  %a = add i17 %x, 29
+  store i17 %a, i17* %p
+  %ov = icmp ult i17 %a, 29
+  ret i1 %ov
+}
+
 declare { i8, i64 } @llvm.x86.addcarry.64(i8, i64, i64)