@@ -212,6 +212,8 @@ def HasMicroMips64r6 : Predicate<"Subtarget->inMicroMips64r6Mode()">,
212
212
AssemblerPredicate<"FeatureMicroMips,FeatureMips64r6">;
213
213
def InMips16Mode : Predicate<"Subtarget->inMips16Mode()">,
214
214
AssemblerPredicate<"FeatureMips16">;
215
+ def NotInMips16Mode : Predicate<"!Subtarget->inMips16Mode()">,
216
+ AssemblerPredicate<"!FeatureMips16">;
215
217
def HasCnMips : Predicate<"Subtarget->hasCnMips()">,
216
218
AssemblerPredicate<"FeatureCnMips">;
217
219
def NotCnMips : Predicate<"!Subtarget->hasCnMips()">,
@@ -1544,7 +1546,7 @@ let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1, hasDelaySlot = 1,
1544
1546
PseudoInstExpansion<(JumpInst Opnd:$target)>;
1545
1547
1546
1548
class TailCallReg<RegisterOperand RO> :
1547
- MipsPseudo <(outs), (ins RO:$rs), [(MipsTailCall RO:$rs)], II_JR>;
1549
+ PseudoSE <(outs), (ins RO:$rs), [(MipsTailCall RO:$rs)], II_JR>;
1548
1550
}
1549
1551
1550
1552
class BAL_BR_Pseudo<Instruction RealInst> :
@@ -2087,7 +2089,7 @@ def BLTZALL : MMRel, BGEZAL_FT<"bltzall", brtarget, GPR32Opnd>,
2087
2089
BGEZAL_FM<0x12>, ISA_MIPS2_NOT_32R6_64R6;
2088
2090
def BAL_BR : BAL_BR_Pseudo<BGEZAL>;
2089
2091
2090
- let Predicates = [NotInMicroMips] in {
2092
+ let AdditionalPredicates = [NotInMips16Mode, NotInMicroMips] in {
2091
2093
def TAILCALL : TailCall<J, jmptarget>;
2092
2094
}
2093
2095
@@ -2104,6 +2106,7 @@ class PseudoIndirectBranchBase<RegisterOperand RO> :
2104
2106
let isBranch = 1;
2105
2107
let isIndirectBranch = 1;
2106
2108
bit isCTI = 1;
2109
+ let Predicates = [NotInMips16Mode];
2107
2110
}
2108
2111
2109
2112
def PseudoIndirectBranch : PseudoIndirectBranchBase<GPR32Opnd>;
@@ -2777,10 +2780,12 @@ def : MipsPat<(MipsJmpLink (i32 texternalsym:$dst)),
2777
2780
// (JALR GPR32:$dst)>;
2778
2781
2779
2782
// Tail call
2780
- def : MipsPat<(MipsTailCall (iPTR tglobaladdr:$dst)),
2781
- (TAILCALL tglobaladdr:$dst)>;
2782
- def : MipsPat<(MipsTailCall (iPTR texternalsym:$dst)),
2783
- (TAILCALL texternalsym:$dst)>;
2783
+ let AdditionalPredicates = [NotInMicroMips] in {
2784
+ def : MipsPat<(MipsTailCall (iPTR tglobaladdr:$dst)),
2785
+ (TAILCALL tglobaladdr:$dst)>;
2786
+ def : MipsPat<(MipsTailCall (iPTR texternalsym:$dst)),
2787
+ (TAILCALL texternalsym:$dst)>;
2788
+ }
2784
2789
// hi/lo relocs
2785
2790
multiclass MipsHiLoRelocs<Instruction Lui, Instruction Addiu,
2786
2791
Register ZeroReg, RegisterOperand GPROpnd> {
0 commit comments