Skip to content

Commit 55de8b2

Browse files
committed
[ARM] Simplify ADJCALLSTACKUP and ADJCALLSTACKDOWN on ARM
A call sequence does not have any unmodeled side effects in of itself. ADJCALLSTACKUP and ADJCALLSTACKDOWN do, however, so the attribute should be there. Finally, make ADJCALLSTACKUP and ADJCALLSTACKDOWN codegen only.
1 parent 662636e commit 55de8b2

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

llvm/lib/Target/ARM/ARMInstrInfo.td

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,9 @@ def ARMWrapperPIC : SDNode<"ARMISD::WrapperPIC", SDTIntUnaryOp>;
164164
def ARMWrapperJT : SDNode<"ARMISD::WrapperJT", SDTIntUnaryOp>;
165165

166166
def ARMcallseq_start : SDNode<"ISD::CALLSEQ_START", SDT_ARMCallSeqStart,
167-
[SDNPHasChain, SDNPSideEffect, SDNPOutGlue]>;
167+
[SDNPHasChain, SDNPOutGlue]>;
168168
def ARMcallseq_end : SDNode<"ISD::CALLSEQ_END", SDT_ARMCallSeqEnd,
169-
[SDNPHasChain, SDNPSideEffect,
170-
SDNPOptInGlue, SDNPOutGlue]>;
169+
[SDNPHasChain, SDNPOptInGlue, SDNPOutGlue]>;
171170
def ARMcopystructbyval : SDNode<"ARMISD::COPY_STRUCT_BYVAL" ,
172171
SDT_ARMStructByVal,
173172
[SDNPHasChain, SDNPInGlue, SDNPOutGlue,
@@ -2203,11 +2202,7 @@ def JUMPTABLE_TBH :
22032202
PseudoInst<(outs), (ins cpinst_operand:$instid, cpinst_operand:$cpidx,
22042203
i32imm:$size), NoItinerary, []>;
22052204

2206-
2207-
// FIXME: Marking these as hasSideEffects is necessary to prevent machine DCE
2208-
// from removing one half of the matched pairs. That breaks PEI, which assumes
2209-
// these will always be in pairs, and asserts if it finds otherwise. Better way?
2210-
let Defs = [SP], Uses = [SP], hasSideEffects = 1 in {
2205+
let Defs = [SP], Uses = [SP], hasSideEffects = 1, isCodeGenOnly = 1 in {
22112206
def ADJCALLSTACKUP :
22122207
PseudoInst<(outs), (ins i32imm:$amt1, i32imm:$amt2, pred:$p), NoItinerary,
22132208
[(ARMcallseq_end timm:$amt1, timm:$amt2)]>;

llvm/lib/Target/ARM/ARMInstrThumb.td

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,7 @@ def non_imm32 : PatLeaf<(i32 GPR), [{ return !isa<ConstantSDNode>(N); }]>;
297297
// Miscellaneous Instructions.
298298
//
299299

300-
// FIXME: Marking these as hasSideEffects is necessary to prevent machine DCE
301-
// from removing one half of the matched pairs. That breaks PEI, which assumes
302-
// these will always be in pairs, and asserts if it finds otherwise. Better way?
303-
let Defs = [SP], Uses = [SP], hasSideEffects = 1 in {
300+
let Defs = [SP], Uses = [SP], hasSideEffects = 1, isCodeGenOnly = 1 in {
304301
def tADJCALLSTACKUP :
305302
PseudoInst<(outs), (ins i32imm:$amt1, i32imm:$amt2), NoItinerary,
306303
[(ARMcallseq_end imm:$amt1, imm:$amt2)]>,

0 commit comments

Comments
 (0)