forked from OSchip/llvm-project
Expand the mask capability for deciding which functions are mips16 and mips32
so it can be better used for general interoperability testing between mips32 and mips16. llvm-svn: 190762
This commit is contained in:
parent
43cc98a78d
commit
655531521e
|
@ -103,8 +103,9 @@ bool MipsOs16::runOnModule(Module &M) {
|
||||||
if (F->isDeclaration()) continue;
|
if (F->isDeclaration()) continue;
|
||||||
DEBUG(dbgs() << "Working on " << F->getName() << "\n");
|
DEBUG(dbgs() << "Working on " << F->getName() << "\n");
|
||||||
if (usingMask) {
|
if (usingMask) {
|
||||||
if ((functionIndex < Mips32FunctionMask.length()) &&
|
if (functionIndex == Mips32FunctionMask.length())
|
||||||
(Mips32FunctionMask[functionIndex] == '1')) {
|
functionIndex = 0;
|
||||||
|
if (Mips32FunctionMask[functionIndex] == '1') {
|
||||||
DEBUG(dbgs() << "mask forced mips32: " << F->getName() << "\n");
|
DEBUG(dbgs() << "mask forced mips32: " << F->getName() << "\n");
|
||||||
F->addFnAttr("nomips16");
|
F->addFnAttr("nomips16");
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,73 @@
|
||||||
|
; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips16 -soft-float -mips16-hard-float -relocation-model=static -mips32-function-mask=10 -mips-os16 < %s | FileCheck %s -check-prefix=fmask1
|
||||||
|
|
||||||
|
; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips16 -soft-float -mips16-hard-float -relocation-model=static -mips32-function-mask=01 -mips-os16 < %s | FileCheck %s -check-prefix=fmask2
|
||||||
|
|
||||||
|
; Function Attrs: nounwind optsize readnone
|
||||||
|
define void @foo1() {
|
||||||
|
entry:
|
||||||
|
ret void
|
||||||
|
; fmask1: .ent foo1
|
||||||
|
; fmask1: .set noreorder
|
||||||
|
; fmask1: .set nomacro
|
||||||
|
; fmask1: .set noat
|
||||||
|
; fmask1: .set at
|
||||||
|
; fmask1: .set macro
|
||||||
|
; fmask1: .set reorder
|
||||||
|
; fmask1: .end foo1
|
||||||
|
; fmask2: .ent foo1
|
||||||
|
; fmask2: save {{.*}}
|
||||||
|
; fmask2: .end foo1
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nounwind optsize readnone
|
||||||
|
define void @foo2() {
|
||||||
|
entry:
|
||||||
|
ret void
|
||||||
|
; fmask2: .ent foo2
|
||||||
|
; fmask2: .set noreorder
|
||||||
|
; fmask2: .set nomacro
|
||||||
|
; fmask2: .set noat
|
||||||
|
; fmask2: .set at
|
||||||
|
; fmask2: .set macro
|
||||||
|
; fmask2: .set reorder
|
||||||
|
; fmask2: .end foo2
|
||||||
|
; fmask1: .ent foo2
|
||||||
|
; fmask1: save {{.*}}
|
||||||
|
; fmask1: .end foo2
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nounwind optsize readnone
|
||||||
|
define void @foo3() {
|
||||||
|
entry:
|
||||||
|
ret void
|
||||||
|
; fmask1: .ent foo3
|
||||||
|
; fmask1: .set noreorder
|
||||||
|
; fmask1: .set nomacro
|
||||||
|
; fmask1: .set noat
|
||||||
|
; fmask1: .set at
|
||||||
|
; fmask1: .set macro
|
||||||
|
; fmask1: .set reorder
|
||||||
|
; fmask1: .end foo3
|
||||||
|
; fmask2: .ent foo3
|
||||||
|
; fmask2: save {{.*}}
|
||||||
|
; fmask2: .end foo3
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nounwind optsize readnone
|
||||||
|
define void @foo4() {
|
||||||
|
entry:
|
||||||
|
ret void
|
||||||
|
; fmask2: .ent foo4
|
||||||
|
; fmask2: .set noreorder
|
||||||
|
; fmask2: .set nomacro
|
||||||
|
; fmask2: .set noat
|
||||||
|
; fmask2: .set at
|
||||||
|
; fmask2: .set macro
|
||||||
|
; fmask2: .set reorder
|
||||||
|
; fmask2: .end foo4
|
||||||
|
; fmask1: .ent foo4
|
||||||
|
; fmask1: save {{.*}}
|
||||||
|
; fmask1: .end foo4
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue