diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h b/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h --- a/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h @@ -438,22 +438,22 @@ bool matchConstantSelectCmp(MachineInstr &MI, unsigned &OpIdx); /// Replace an instruction with a G_FCONSTANT with value \p C. - bool replaceInstWithFConstant(MachineInstr &MI, double C); + void replaceInstWithFConstant(MachineInstr &MI, double C); /// Replace an instruction with a G_CONSTANT with value \p C. - bool replaceInstWithConstant(MachineInstr &MI, int64_t C); + void replaceInstWithConstant(MachineInstr &MI, int64_t C); /// Replace an instruction with a G_CONSTANT with value \p C. - bool replaceInstWithConstant(MachineInstr &MI, APInt C); + void replaceInstWithConstant(MachineInstr &MI, APInt C); /// Replace an instruction with a G_IMPLICIT_DEF. - bool replaceInstWithUndef(MachineInstr &MI); + void replaceInstWithUndef(MachineInstr &MI); /// Delete \p MI and replace all of its uses with its \p OpIdx-th operand. - bool replaceSingleDefInstWithOperand(MachineInstr &MI, unsigned OpIdx); + void replaceSingleDefInstWithOperand(MachineInstr &MI, unsigned OpIdx); /// Delete \p MI and replace all of its uses with \p Replacement. - bool replaceSingleDefInstWithReg(MachineInstr &MI, Register Replacement); + void replaceSingleDefInstWithReg(MachineInstr &MI, Register Replacement); /// Return true if \p MOP1 and \p MOP2 are register operands are defined by /// equivalent instructions. @@ -479,7 +479,7 @@ bool matchOperandIsKnownToBeAPowerOfTwo(MachineInstr &MI, unsigned OpIdx); /// Erase \p MI - bool eraseInst(MachineInstr &MI); + void eraseInst(MachineInstr &MI); /// Return true if MI is a G_ADD which can be simplified to a G_SUB. bool matchSimplifyAddToSub(MachineInstr &MI, @@ -550,7 +550,7 @@ /// binop (select cond, K0, K1), K2 -> /// select cond, (binop K0, K2), (binop K1, K2) bool matchFoldBinOpIntoSelect(MachineInstr &MI, unsigned &SelectOpNo); - bool applyFoldBinOpIntoSelect(MachineInstr &MI, const unsigned &SelectOpNo); + void applyFoldBinOpIntoSelect(MachineInstr &MI, const unsigned &SelectOpNo); bool matchCombineInsertVecElts(MachineInstr &MI, SmallVectorImpl &MatchInfo); diff --git a/llvm/include/llvm/Target/GlobalISel/Combine.td b/llvm/include/llvm/Target/GlobalISel/Combine.td --- a/llvm/include/llvm/Target/GlobalISel/Combine.td +++ b/llvm/include/llvm/Target/GlobalISel/Combine.td @@ -181,7 +181,6 @@ Helper.getBuilder().setInstrAndDebugLoc(*${root}); Helper.getBuilder().buildZExtInReg(${dst}, ${src}, ${imm}.getImm()); ${root}->eraseFromParent(); - return true; }]) >; @@ -329,7 +328,7 @@ (defs root:$root), (match (wip_match_opcode G_SELECT):$root, [{ return Helper.matchSelectSameVal(*${root}); }]), - (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 2); }]) + (apply [{ Helper.replaceSingleDefInstWithOperand(*${root}, 2); }]) >; // Fold (undef ? x : y) -> y @@ -337,7 +336,7 @@ (defs root:$root), (match (wip_match_opcode G_SELECT):$root, [{ return Helper.matchUndefSelectCmp(*${root}); }]), - (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 2); }]) + (apply [{ Helper.replaceSingleDefInstWithOperand(*${root}, 2); }]) >; // Fold (true ? x : y) -> x @@ -347,7 +346,7 @@ (defs root:$root, select_constant_cmp_matchdata:$matchinfo), (match (wip_match_opcode G_SELECT):$root, [{ return Helper.matchConstantSelectCmp(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, ${matchinfo}); }]) + (apply [{ Helper.replaceSingleDefInstWithOperand(*${root}, ${matchinfo}); }]) >; def select_to_logical : GICombineRule< @@ -381,7 +380,7 @@ (match (wip_match_opcode G_SUB, G_ADD, G_OR, G_XOR, G_SHL, G_ASHR, G_LSHR, G_PTR_ADD, G_ROTL, G_ROTR):$root, [{ return Helper.matchConstantOp(${root}->getOperand(2), 0); }]), - (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 1); }]) + (apply [{ Helper.replaceSingleDefInstWithOperand(*${root}, 1); }]) >; // Fold x op 1 -> x @@ -389,7 +388,7 @@ (defs root:$root), (match (wip_match_opcode G_MUL):$root, [{ return Helper.matchConstantOp(${root}->getOperand(2), 1); }]), - (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 1); }]) + (apply [{ Helper.replaceSingleDefInstWithOperand(*${root}, 1); }]) >; // Fold (x op x) - > x @@ -397,7 +396,7 @@ (defs root:$root), (match (wip_match_opcode G_AND, G_OR):$root, [{ return Helper.matchBinOpSameVal(*${root}); }]), - (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 1); }]) + (apply [{ Helper.replaceSingleDefInstWithOperand(*${root}, 1); }]) >; // Fold (0 op x) - > 0 @@ -405,7 +404,7 @@ (defs root:$root), (match (wip_match_opcode G_SDIV, G_UDIV, G_SREM, G_UREM):$root, [{ return Helper.matchOperandIsZero(*${root}, 1); }]), - (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 1); }]) + (apply [{ Helper.replaceSingleDefInstWithOperand(*${root}, 1); }]) >; def urem_pow2_to_mask : GICombineRule< @@ -432,7 +431,7 @@ G_FMUL, G_FADD, G_FSUB, G_FDIV, G_FREM, G_FMINNUM, G_FMAXNUM, G_FMINIMUM, G_FMAXIMUM):$root, [{ return Helper.matchFoldBinOpIntoSelect(*${root}, ${select_op_no}); }]), - (apply [{ return Helper.applyFoldBinOpIntoSelect(*${root}, ${select_op_no}); }]) + (apply [{ Helper.applyFoldBinOpIntoSelect(*${root}, ${select_op_no}); }]) >; // Transform d = [su]div(x, y) and r = [su]rem(x, y) - > d, r = [su]divrem(x, y) @@ -449,7 +448,7 @@ (defs root:$root), (match (wip_match_opcode G_MUL):$root, [{ return Helper.matchOperandIsZero(*${root}, 2); }]), - (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 2); }]) + (apply [{ Helper.replaceSingleDefInstWithOperand(*${root}, 2); }]) >; // Erase stores of undef values. @@ -457,7 +456,7 @@ (defs root:$root), (match (wip_match_opcode G_STORE):$root, [{ return Helper.matchUndefStore(*${root}); }]), - (apply [{ return Helper.eraseInst(*${root}); }]) + (apply [{ Helper.eraseInst(*${root}); }]) >; def simplify_add_to_sub_matchinfo: GIDefMatchData<"std::tuple">; @@ -554,7 +553,7 @@ (defs root:$root, register_matchinfo:$matchinfo), (match (wip_match_opcode G_AND):$root, [{ return Helper.matchRedundantAnd(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }]) + (apply [{ Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }]) >; // Fold (x | y) -> x or (x | y) -> y when (x | y) is known to equal x or equal y. @@ -562,7 +561,7 @@ (defs root:$root, register_matchinfo:$matchinfo), (match (wip_match_opcode G_OR):$root, [{ return Helper.matchRedundantOr(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }]) + (apply [{ Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }]) >; // If the input is already sign extended, just drop the extension. @@ -572,7 +571,7 @@ (defs root:$root), (match (wip_match_opcode G_SEXT_INREG):$root, [{ return Helper.matchRedundantSExtInReg(*${root}); }]), - (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 1); }]) + (apply [{ Helper.replaceSingleDefInstWithOperand(*${root}, 1); }]) >; // Fold (anyext (trunc x)) -> x if the source type is same as @@ -581,7 +580,7 @@ (defs root:$root, register_matchinfo:$matchinfo), (match (wip_match_opcode G_ANYEXT):$root, [{ return Helper.matchCombineAnyExtTrunc(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }]) + (apply [{ Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }]) >; // Fold (zext (trunc x)) -> x if the source type is same as the destination type @@ -591,7 +590,7 @@ (defs root:$root, zext_trunc_fold_matchinfo:$matchinfo), (match (wip_match_opcode G_ZEXT):$root, [{ return Helper.matchCombineZextTrunc(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }]) + (apply [{ Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }]) >; // Fold ([asz]ext ([asz]ext x)) -> ([asz]ext x). @@ -617,7 +616,7 @@ (match (G_FNEG $t, $src), (G_FNEG $dst, $t):$mi, [{ ${matchinfo} = ${src}.getReg(); }]), - (apply [{ return Helper.replaceSingleDefInstWithReg(*${mi}, ${matchinfo}); }]) + (apply [{ Helper.replaceSingleDefInstWithReg(*${mi}, ${matchinfo}); }]) >; // Fold (unmerge(merge x, y, z)) -> z, y, z. @@ -1016,7 +1015,7 @@ (defs root:$root, register_matchinfo:$matchinfo), (match (wip_match_opcode G_ADD):$root, [{ return Helper.matchAddSubSameReg(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.replaceSingleDefInstWithReg(*${root}, + (apply [{ Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }])>; def buildvector_identity_fold : GICombineRule< diff --git a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp --- a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp @@ -2472,10 +2472,7 @@ return true; } -bool CombinerHelper::eraseInst(MachineInstr &MI) { - MI.eraseFromParent(); - return true; -} +void CombinerHelper::eraseInst(MachineInstr &MI) { MI.eraseFromParent(); } bool CombinerHelper::matchEqualDefs(const MachineOperand &MOP1, const MachineOperand &MOP2) { @@ -2583,7 +2580,7 @@ MaybeCst->getSExtValue() == C; } -bool CombinerHelper::replaceSingleDefInstWithOperand(MachineInstr &MI, +void CombinerHelper::replaceSingleDefInstWithOperand(MachineInstr &MI, unsigned OpIdx) { assert(MI.getNumExplicitDefs() == 1 && "Expected one explicit def?"); Register OldReg = MI.getOperand(0).getReg(); @@ -2591,17 +2588,15 @@ assert(canReplaceReg(OldReg, Replacement, MRI) && "Cannot replace register?"); MI.eraseFromParent(); replaceRegWith(MRI, OldReg, Replacement); - return true; } -bool CombinerHelper::replaceSingleDefInstWithReg(MachineInstr &MI, +void CombinerHelper::replaceSingleDefInstWithReg(MachineInstr &MI, Register Replacement) { assert(MI.getNumExplicitDefs() == 1 && "Expected one explicit def?"); Register OldReg = MI.getOperand(0).getReg(); assert(canReplaceReg(OldReg, Replacement, MRI) && "Cannot replace register?"); MI.eraseFromParent(); replaceRegWith(MRI, OldReg, Replacement); - return true; } bool CombinerHelper::matchSelectSameVal(MachineInstr &MI) { @@ -2636,36 +2631,32 @@ return isKnownToBeAPowerOfTwo(MO.getReg(), MRI, KB); } -bool CombinerHelper::replaceInstWithFConstant(MachineInstr &MI, double C) { +void CombinerHelper::replaceInstWithFConstant(MachineInstr &MI, double C) { assert(MI.getNumDefs() == 1 && "Expected only one def?"); Builder.setInstr(MI); Builder.buildFConstant(MI.getOperand(0), C); MI.eraseFromParent(); - return true; } -bool CombinerHelper::replaceInstWithConstant(MachineInstr &MI, int64_t C) { +void CombinerHelper::replaceInstWithConstant(MachineInstr &MI, int64_t C) { assert(MI.getNumDefs() == 1 && "Expected only one def?"); Builder.setInstr(MI); Builder.buildConstant(MI.getOperand(0), C); MI.eraseFromParent(); - return true; } -bool CombinerHelper::replaceInstWithConstant(MachineInstr &MI, APInt C) { +void CombinerHelper::replaceInstWithConstant(MachineInstr &MI, APInt C) { assert(MI.getNumDefs() == 1 && "Expected only one def?"); Builder.setInstr(MI); Builder.buildConstant(MI.getOperand(0), C); MI.eraseFromParent(); - return true; } -bool CombinerHelper::replaceInstWithUndef(MachineInstr &MI) { +void CombinerHelper::replaceInstWithUndef(MachineInstr &MI) { assert(MI.getNumDefs() == 1 && "Expected only one def?"); Builder.setInstr(MI); Builder.buildUndef(MI.getOperand(0)); MI.eraseFromParent(); - return true; } bool CombinerHelper::matchSimplifyAddToSub( @@ -3274,7 +3265,7 @@ /// \p SelectOperand is the operand in binary operator \p MI that is the select /// to fold. -bool CombinerHelper::applyFoldBinOpIntoSelect(MachineInstr &MI, +void CombinerHelper::applyFoldBinOpIntoSelect(MachineInstr &MI, const unsigned &SelectOperand) { Builder.setInstrAndDebugLoc(MI); @@ -3310,8 +3301,6 @@ Builder.buildSelect(Dst, SelectCond, FoldTrue, FoldFalse, MI.getFlags()); MI.eraseFromParent(); - - return true; } std::optional> diff --git a/llvm/lib/Target/AArch64/AArch64Combine.td b/llvm/lib/Target/AArch64/AArch64Combine.td --- a/llvm/lib/Target/AArch64/AArch64Combine.td +++ b/llvm/lib/Target/AArch64/AArch64Combine.td @@ -30,7 +30,7 @@ (defs root:$root, fold_global_offset_matchdata:$matchinfo), (match (wip_match_opcode G_GLOBAL_VALUE):$root, [{ return matchFoldGlobalOffset(*${root}, MRI, ${matchinfo}); }]), - (apply [{ return applyFoldGlobalOffset(*${root}, MRI, B, Observer, ${matchinfo});}]) + (apply [{ applyFoldGlobalOffset(*${root}, MRI, B, Observer, ${matchinfo});}]) >; def AArch64PreLegalizerCombinerHelper: GICombinerHelper< @@ -101,7 +101,7 @@ (defs root:$root, shuf_to_ins_matchdata:$matchinfo), (match (wip_match_opcode G_SHUFFLE_VECTOR):$root, [{ return matchINS(*${root}, MRI, ${matchinfo}); }]), - (apply [{ return applyINS(*${root}, MRI, B, ${matchinfo}); }]) + (apply [{ applyINS(*${root}, MRI, B, ${matchinfo}); }]) >; def vashr_vlshr_imm_matchdata : GIDefMatchData<"int64_t">; @@ -163,7 +163,7 @@ (defs root:$root), (match (wip_match_opcode G_BUILD_VECTOR):$root, [{ return matchBuildVectorToDup(*${root}, MRI); }]), - (apply [{ return applyBuildVectorToDup(*${root}, MRI, B); }]) + (apply [{ applyBuildVectorToDup(*${root}, MRI, B); }]) >; def build_vector_lowering : GICombineGroup<[build_vector_to_dup]>; diff --git a/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp b/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp --- a/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp +++ b/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp @@ -93,7 +93,7 @@ return false; } -bool applyExtractVecEltPairwiseAdd( +void applyExtractVecEltPairwiseAdd( MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &B, std::tuple &MatchInfo) { unsigned Opc = std::get<0>(MatchInfo); @@ -107,7 +107,6 @@ auto Elt1 = B.buildExtractVectorElement(Ty, Src, B.buildConstant(s64, 1)); B.buildInstr(Opc, {MI.getOperand(0).getReg()}, {Elt0, Elt1}); MI.eraseFromParent(); - return true; } static bool isSignExtended(Register R, MachineRegisterInfo &MRI) { @@ -234,13 +233,12 @@ return true; } -bool applyAArch64MulConstCombine( +void applyAArch64MulConstCombine( MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &B, std::function &ApplyFn) { B.setInstrAndDebugLoc(MI); ApplyFn(B, MI.getOperand(0).getReg()); MI.eraseFromParent(); - return true; } /// Try to fold a G_MERGE_VALUES of 2 s32 sources, where the second source diff --git a/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp b/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp --- a/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp +++ b/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp @@ -435,18 +435,17 @@ /// Replace a G_SHUFFLE_VECTOR instruction with a pseudo. /// \p Opc is the opcode to use. \p MI is the G_SHUFFLE_VECTOR. -static bool applyShuffleVectorPseudo(MachineInstr &MI, +static void applyShuffleVectorPseudo(MachineInstr &MI, ShuffleVectorPseudo &MatchInfo) { MachineIRBuilder MIRBuilder(MI); MIRBuilder.buildInstr(MatchInfo.Opc, {MatchInfo.Dst}, MatchInfo.SrcOps); MI.eraseFromParent(); - return true; } /// Replace a G_SHUFFLE_VECTOR instruction with G_EXT. /// Special-cased because the constant operand must be emitted as a G_CONSTANT /// for the imported tablegen patterns to work. -static bool applyEXT(MachineInstr &MI, ShuffleVectorPseudo &MatchInfo) { +static void applyEXT(MachineInstr &MI, ShuffleVectorPseudo &MatchInfo) { MachineIRBuilder MIRBuilder(MI); // Tablegen patterns expect an i32 G_CONSTANT as the final op. auto Cst = @@ -454,7 +453,6 @@ MIRBuilder.buildInstr(MatchInfo.Opc, {MatchInfo.Dst}, {MatchInfo.SrcOps[0], MatchInfo.SrcOps[1], Cst}); MI.eraseFromParent(); - return true; } /// Match a G_SHUFFLE_VECTOR with a mask which corresponds to a @@ -495,7 +493,7 @@ return true; } -static bool applyINS(MachineInstr &MI, MachineRegisterInfo &MRI, +static void applyINS(MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &Builder, std::tuple &MatchInfo) { Builder.setInstrAndDebugLoc(MI); @@ -509,7 +507,6 @@ auto DstCst = Builder.buildConstant(LLT::scalar(64), DstLane); Builder.buildInsertVectorElement(Dst, DstVec, Extract, DstCst); MI.eraseFromParent(); - return true; } /// isVShiftRImm - Check if this is a valid vector for the immediate @@ -538,7 +535,7 @@ return isVShiftRImm(MI.getOperand(2).getReg(), MRI, Ty, Imm); } -static bool applyVAshrLshrImm(MachineInstr &MI, MachineRegisterInfo &MRI, +static void applyVAshrLshrImm(MachineInstr &MI, MachineRegisterInfo &MRI, int64_t &Imm) { unsigned Opc = MI.getOpcode(); assert(Opc == TargetOpcode::G_ASHR || Opc == TargetOpcode::G_LSHR); @@ -548,7 +545,6 @@ auto ImmDef = MIB.buildConstant(LLT::scalar(32), Imm); MIB.buildInstr(NewOpc, {MI.getOperand(0)}, {MI.getOperand(1), ImmDef}); MI.eraseFromParent(); - return true; } /// Determine if it is possible to modify the \p RHS and predicate \p P of a @@ -668,7 +664,7 @@ return false; } -bool applyAdjustICmpImmAndPred( +void applyAdjustICmpImmAndPred( MachineInstr &MI, std::pair &MatchInfo, MachineIRBuilder &MIB, GISelChangeObserver &Observer) { MIB.setInstrAndDebugLoc(MI); @@ -680,7 +676,6 @@ RHS.setReg(Cst->getOperand(0).getReg()); MI.getOperand(1).setPredicate(MatchInfo.second); Observer.changedInstr(MI); - return true; } bool matchDupLane(MachineInstr &MI, MachineRegisterInfo &MRI, @@ -735,7 +730,7 @@ return true; } -bool applyDupLane(MachineInstr &MI, MachineRegisterInfo &MRI, +void applyDupLane(MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &B, std::pair &MatchInfo) { assert(MI.getOpcode() == TargetOpcode::G_SHUFFLE_VECTOR); Register Src1Reg = MI.getOperand(1).getReg(); @@ -758,7 +753,6 @@ } B.buildInstr(MatchInfo.first, {MI.getOperand(0).getReg()}, {DupSrc, Lane}); MI.eraseFromParent(); - return true; } static bool matchBuildVectorToDup(MachineInstr &MI, MachineRegisterInfo &MRI) { @@ -775,13 +769,12 @@ return (Cst != 0 && Cst != -1); } -static bool applyBuildVectorToDup(MachineInstr &MI, MachineRegisterInfo &MRI, +static void applyBuildVectorToDup(MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &B) { B.setInstrAndDebugLoc(MI); B.buildInstr(AArch64::G_DUP, {MI.getOperand(0).getReg()}, {MI.getOperand(1).getReg()}); MI.eraseFromParent(); - return true; } /// \returns how many instructions would be saved by folding a G_ICMP's shift @@ -878,8 +871,8 @@ getCmpOperandFoldingProfit(TheRHS, MRI)); } -static bool applySwapICmpOperands(MachineInstr &MI, - GISelChangeObserver &Observer) { +static void applySwapICmpOperands(MachineInstr &MI, + GISelChangeObserver &Observer) { auto Pred = static_cast(MI.getOperand(1).getPredicate()); Register LHS = MI.getOperand(2).getReg(); Register RHS = MI.getOperand(3).getReg(); @@ -888,7 +881,6 @@ MI.getOperand(2).setReg(RHS); MI.getOperand(3).setReg(LHS); Observer.changedInstr(MI); - return true; } /// \returns a function which builds a vector floating point compare instruction @@ -1019,7 +1011,7 @@ return MRI.getType(SrcReg).getSizeInBits() <= 64; } -static bool applyFormTruncstore(MachineInstr &MI, MachineRegisterInfo &MRI, +static void applyFormTruncstore(MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &B, GISelChangeObserver &Observer, Register &SrcReg) { @@ -1027,7 +1019,6 @@ Observer.changingInstr(MI); MI.getOperand(0).setReg(SrcReg); Observer.changedInstr(MI); - return true; } // Lower vector G_SEXT_INREG back to shifts for selection. We allowed them to diff --git a/llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp b/llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp --- a/llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp +++ b/llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp @@ -91,7 +91,7 @@ return true; } -static bool applyICmpRedundantTrunc(MachineInstr &MI, MachineRegisterInfo &MRI, +static void applyICmpRedundantTrunc(MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &Builder, GISelChangeObserver &Observer, Register &WideReg) { @@ -106,7 +106,6 @@ MI.getOperand(2).setReg(WideReg); MI.getOperand(3).setReg(WideZero.getReg(0)); Observer.changedInstr(MI); - return true; } /// \returns true if it is possible to fold a constant into a G_GLOBAL_VALUE. @@ -181,7 +180,7 @@ return true; } -static bool applyFoldGlobalOffset(MachineInstr &MI, MachineRegisterInfo &MRI, +static void applyFoldGlobalOffset(MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &B, GISelChangeObserver &Observer, std::pair &MatchInfo) { @@ -219,7 +218,6 @@ B.buildPtrAdd( Dst, NewGVDst, B.buildConstant(LLT::scalar(64), -static_cast(MinOffset))); - return true; } static bool tryToSimplifyUADDO(MachineInstr &MI, MachineIRBuilder &B,