llvm.org GIT mirror llvm / 7a1e872
Update LocalRewriter::DistanceMap when inserting stack loads. In the included test case, a stack load was not included in DistanceMap. That caused TransferDeadness to ignore the instruction, leading to a scavenger assert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79090 91177308-0d34-0410-b5e6-96231b3b80d8 Jakob Stoklund Olesen 10 years ago
2 changed file(s) with 28 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
15861586 MachineInstr *LoadMI = prior(InsertLoc);
15871587 VRM.addSpillSlotUse(SS, LoadMI);
15881588 ++NumPSpills;
1589 DistanceMap.insert(std::make_pair(LoadMI, Dist++));
15891590 }
15901591 NextMII = next(MII);
15911592 }
16771678 MachineInstr *LoadMI = prior(InsertLoc);
16781679 VRM.addSpillSlotUse(SSorRMId, LoadMI);
16791680 ++NumLoads;
1681 DistanceMap.insert(std::make_pair(LoadMI, Dist++));
16801682 }
16811683
16821684 // This invalidates Phys.
19761978 MachineInstr *LoadMI = prior(InsertLoc);
19771979 VRM.addSpillSlotUse(SSorRMId, LoadMI);
19781980 ++NumLoads;
1981 DistanceMap.insert(std::make_pair(LoadMI, Dist++));
19791982 }
19801983 // This invalidates PhysReg.
19811984 Spills.ClobberPhysReg(PhysReg);
0 ; RUN: llvm-as < %s | llc -march=bfin -verify-machineinstrs
1
2 ; LocalRewriter can forget to transfer a flag when setting up call
3 ; argument registers. This then causes register scavenger asserts.
4
5 declare i32 @printf(i8*, i32, float)
6
7 define i32 @testissue(i32 %i, float %x, float %y) {
8 br label %bb1
9
10 bb1: ; preds = %bb1, %0
11 %x2 = fmul float %x, 5.000000e-01 ; [#uses=1]
12 %y2 = fmul float %y, 0x3FECCCCCC0000000 ; [#uses=1]
13 %z2 = fadd float %x2, %y2 ; [#uses=1]
14 %z3 = fadd float undef, %z2 ; [#uses=1]
15 %i1 = shl i32 %i, 3 ; [#uses=1]
16 %j1 = add i32 %i, 7 ; [#uses=1]
17 %m1 = add i32 %i1, %j1 ; [#uses=2]
18 %b = icmp sle i32 %m1, 6 ; [#uses=1]
19 br i1 %b, label %bb1, label %bb2
20
21 bb2: ; preds = %bb1
22 %1 = call i32 @printf(i8* undef, i32 %m1, float %z3); [#uses=0]
23 ret i32 0
24 }