1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/CodeGen/Mips/Fast-ISel/icmpi1.ll
Petar Jovanovic f7dc37138e [Mips][FastISel] Fix handling of icmp with i1 type
The Mips FastISel back-end does not extend i1 values while lowering icmp.
Ensure that we bail into DAG ISel when handling this case.

Patch by Dragan Mladjenovic.

Differential Revision: https://reviews.llvm.org/D49290

llvm-svn: 337288
2018-07-17 14:57:46 +00:00

15 lines
442 B
LLVM

; RUN: llc -march=mipsel -relocation-model=pic -O0 -fast-isel=true -mcpu=mips32r2 \
; RUN: < %s -verify-machineinstrs | FileCheck %s
define zeroext i1 @foo(i8* nocapture readonly) {
; CHECK-LABEL: foo
; CHECK: lbu $[[REG0:[0-9]+]], 0($4)
; CHECK-NEXT: xori $[[REG1:[0-9]+]], $[[REG0]], 1
; CHECK-NEXT: andi $2, $[[REG1]], 1
%2 = load i8, i8* %0, align 1
%3 = trunc i8 %2 to i1
%4 = icmp ne i1 %3, true
ret i1 %4
}