File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -149,12 +149,16 @@ bool EVMFinalizeStackFrames::runOnModule(Module &M) {
149149 SmallVector<std::pair<MachineFunction *, uint64_t >, 8 > ToReplaceFI;
150150
151151 SmallVector<MachineFunction *> MFs;
152- for_each (M.getFunctionList (), [&MFs, &MMI](Function &F) {
153- if (MachineFunction *MF = MMI.getMachineFunction (F))
154- MFs.push_back (MF);
155- });
156-
157- if (!MFs.empty () &&
152+ bool ShouldSpillConstants = false ;
153+ for_each (M.getFunctionList (),
154+ [&MFs, &MMI, &ShouldSpillConstants](Function &F) {
155+ if (MachineFunction *MF = MMI.getMachineFunction (F)) {
156+ ShouldSpillConstants |= MF->getFrameInfo ().hasStackObjects ();
157+ MFs.push_back (MF);
158+ }
159+ });
160+
161+ if (ShouldSpillConstants &&
158162 MFs.front ()->getFunction ().hasFnAttribute (" evm-entry-function" )) {
159163 EVMConstantSpiller ConstSpiller (M, MMI);
160164 if (ConstSpiller.getSpillSize ()) {
You can’t perform that action at this time.
0 commit comments