llvm.org GIT mirror llvm / 236490d
Fix PR5410: LiveVariables lost subreg def: D0<def,dead> = ... ... = S0<use, kill> S0<def> = ... ... D0<def> = The first D0 def is correctly marked dead, however, livevariables should have added an implicit def of S0 or we end up with a use without a def. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88690 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 10 years ago
2 changed file(s) with 27 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
229229 /// implicit defs to a machine instruction if there was an earlier def of its
230230 /// super-register.
231231 void LiveVariables::HandlePhysRegUse(unsigned Reg, MachineInstr *MI) {
232 MachineInstr *LastDef = PhysRegDef[Reg];
232233 // If there was a previous use or a "full" def all is well.
233 if (!PhysRegDef[Reg] && !PhysRegUse[Reg]) {
234 if (!LastDef && !PhysRegUse[Reg]) {
234235 // Otherwise, the last sub-register def implicitly defines this register.
235236 // e.g.
236237 // AH =
264265 }
265266 }
266267 }
268 else if (LastDef && !PhysRegUse[Reg] &&
269 !LastDef->findRegisterDefOperand(Reg))
270 // Last def defines the super register, add an implicit def of reg.
271 LastDef->addOperand(MachineOperand::CreateReg(Reg,
272 true/*IsDef*/, true/*IsImp*/));
267273
268274 // Remember this use.
269275 PhysRegUse[Reg] = MI;
0 ; RUN: llc -mtriple=armv7-eabi -mcpu=cortex-a8 < %s
1 ; PR5410
2
3 %0 = type { float, float, float, float }
4 %pln = type { %vec, float }
5 %vec = type { [4 x float] }
6
7 define arm_aapcs_vfpcc float @aaa(%vec* nocapture %ustart, %vec* nocapture %udir, %vec* nocapture %vstart, %vec* nocapture %vdir, %vec* %upoint, %vec* %vpoint) {
8 entry:
9 br i1 undef, label %bb81, label %bb48
10
11 bb48: ; preds = %entry
12 %0 = call arm_aapcs_vfpcc %0 @bbb(%pln* undef, %vec* %vstart, %vec* undef) nounwind ; <%0> [#uses=0]
13 ret float 0.000000e+00
14
15 bb81: ; preds = %entry
16 ret float 0.000000e+00
17 }
18
19 declare arm_aapcs_vfpcc %0 @bbb(%pln* nocapture, %vec* nocapture, %vec* nocapture) nounwind