forked from OSchip/llvm-project
[MIPS] Allow i1 values for 'r' constraint in inline-asm
The bug was reported in the issue #52638.
This commit is contained in:
parent
fb6b103daa
commit
2de9338587
|
@ -4121,7 +4121,7 @@ MipsTargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
|
|||
case 'd': // Address register. Same as 'r' unless generating MIPS16 code.
|
||||
case 'y': // Same as 'r'. Exists for compatibility.
|
||||
case 'r':
|
||||
if (VT == MVT::i32 || VT == MVT::i16 || VT == MVT::i8) {
|
||||
if (VT == MVT::i32 || VT == MVT::i16 || VT == MVT::i8 || VT == MVT::i1) {
|
||||
if (Subtarget.inMips16Mode())
|
||||
return std::make_pair(0U, &Mips::CPU16RegsRegClass);
|
||||
return std::make_pair(0U, &Mips::GPR32RegClass);
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
; RUN: llc -mtriple=mips < %s | FileCheck %s
|
||||
|
||||
@a = global i8 0, align 1
|
||||
|
||||
define void @b() {
|
||||
entry:
|
||||
%0 = load i8, i8* @a, align 1
|
||||
%tobool = trunc i8 %0 to i1
|
||||
call void asm sideeffect "", "Jr,~{$1}"(i1 %tobool)
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: lui $1, %hi(a)
|
||||
; CHECK-NEXT: lbu $2, %lo(a)($1)
|
Loading…
Reference in New Issue