llvm.org GIT mirror llvm / e809889
Merging r196493. Simple conflict due to change API of updated function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@196717 91177308-0d34-0410-b5e6-96231b3b80d8 Tim Northover 6 years ago
2 changed file(s) with 30 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
379379 if (NumBytes != 0)
380380 emitSPUpdate(isARM, MBB, MBBI, dl, TII, NumBytes);
381381 } else {
382 MachineBasicBlock::iterator FirstPop = MBBI;
383
384382 // Unwind MBBI to point to first LDR / VLDRD.
385383 const uint16_t *CSRegs = RegInfo->getCalleeSavedRegs(&MF);
386384 if (MBBI != MBB.begin()) {
387385 do {
388 if (isPopOpcode(MBBI->getOpcode()))
389 FirstPop = MBBI;
390
391386 --MBBI;
392387 } while (MBBI != MBB.begin() && isCSRestore(MBBI, TII, CSRegs));
393388 if (!isCSRestore(MBBI, TII, CSRegs))
433428 ARM::SP)
434429 .addReg(FramePtr));
435430 }
436 } else if (NumBytes && !tryFoldSPUpdateIntoPushPop(MF, FirstPop, NumBytes))
431 } else if (NumBytes && !tryFoldSPUpdateIntoPushPop(MF, MBBI, NumBytes))
437432 emitSPUpdate(isARM, MBB, MBBI, dl, TII, NumBytes);
438433
439434 // Increment past our save areas.
123123
124124 ret double 1.0
125125 }
126
127 @dbl = global double 0.0
128
129 ; PR18136: there was a bug determining where the first eligible pop in a
130 ; basic-block was when the entire block was epilogue code.
131 define void @test_fold_point(i1 %tst) minsize {
132 ; CHECK-LABEL: test_fold_point:
133
134 ; Important to check for beginning of basic block, because if it gets
135 ; if-converted the test is probably no longer checking what it should.
136 ; CHECK: {{LBB[0-9]+_2}}:
137 ; CHECK-NEXT: vpop {d7, d8}
138 ; CHECK-NEXT: pop {r4, pc}
139 ; We want some memory so there's a stack adjustment to fold...
140 %var = alloca i8, i32 8
141
142 ; We want a long-lived floating register so that a callee-saved dN is used and
143 ; there's both a vpop and a pop.
144 %live_val = load double* @dbl
145 br i1 %tst, label %true, label %end
146 true:
147 call void @bar(i8* %var)
148 store double %live_val, double* @dbl
149 br label %end
150 end:
151 ; We want the epilogue to be the only thing in a basic block so that we hit
152 ; the correct edge-case (first inst in block is correct one to adjust).
153 ret void
154 }