2016-10-15 04:52:43 +08:00
|
|
|
; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s
|
|
|
|
|
|
|
|
; PR30660 - https://llvm.org/bugs/show_bug.cgi?id=30660
|
|
|
|
|
|
|
|
define i32 @select_i32_neg1_or_0(i1 %a) {
|
|
|
|
; CHECK-LABEL: select_i32_neg1_or_0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK-NEXT: @ %bb.0:
|
2016-10-20 00:58:59 +08:00
|
|
|
; CHECK-NEXT: and r0, r0, #1
|
|
|
|
; CHECK-NEXT: rsb r0, r0, #0
|
2016-10-15 04:52:43 +08:00
|
|
|
; CHECK-NEXT: mov pc, lr
|
|
|
|
;
|
|
|
|
%b = sext i1 %a to i32
|
|
|
|
ret i32 %b
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @select_i32_neg1_or_0_zeroext(i1 zeroext %a) {
|
|
|
|
; CHECK-LABEL: select_i32_neg1_or_0_zeroext:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK-NEXT: @ %bb.0:
|
2016-10-20 00:58:59 +08:00
|
|
|
; CHECK-NEXT: rsb r0, r0, #0
|
2016-10-15 04:52:43 +08:00
|
|
|
; CHECK-NEXT: mov pc, lr
|
|
|
|
;
|
|
|
|
%b = sext i1 %a to i32
|
|
|
|
ret i32 %b
|
|
|
|
}
|
|
|
|
|