Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 927978
Collapse All | Expand All

(-)a/llvm/lib/CodeGen/PrologEpilogInserter.cpp (-2 / +7 lines)
Lines 1285-1290 void PEI::insertZeroCallUsedRegs(MachineFunction &MF) { Link Here
1285
          continue;
1285
          continue;
1286
1286
1287
        MCRegister Reg = MO.getReg();
1287
        MCRegister Reg = MO.getReg();
1288
        if (!Reg)
1289
          continue;
1288
1290
1289
        // This picks up sibling registers (e.q. %al -> %ah).
1291
        // This picks up sibling registers (e.q. %al -> %ah).
1290
        for (MCRegUnit Unit : TRI.regunits(Reg))
1292
        for (MCRegUnit Unit : TRI.regunits(Reg))
Lines 1308-1315 void PEI::insertZeroCallUsedRegs(MachineFunction &MF) { Link Here
1308
        if (!MO.isReg())
1310
        if (!MO.isReg())
1309
          continue;
1311
          continue;
1310
1312
1311
        for (const MCPhysReg &Reg :
1313
        MCRegister Reg = MO.getReg();
1312
             TRI.sub_and_superregs_inclusive(MO.getReg()))
1314
        if (!Reg)
1315
          continue;
1316
1317
        for (const MCPhysReg Reg : TRI.sub_and_superregs_inclusive(Reg))
1313
          RegsToZero.reset(Reg);
1318
          RegsToZero.reset(Reg);
1314
      }
1319
      }
1315
    }
1320
    }
(-)a/llvm/test/CodeGen/X86/zero-call-used-regs.ll (+14 lines)
Lines 241-246 entry: Link Here
241
  ret i32 %x
241
  ret i32 %x
242
}
242
}
243
243
244
define dso_local void @tailcall(ptr %p) local_unnamed_addr #0 "zero-call-used-regs"="used-gpr" {
245
; I386-LABEL: tailcall:
246
; I386:       # %bb.0:
247
; I386-NEXT:    movl {{[0-9]+}}(%esp), %eax
248
; I386-NEXT:    jmpl *(%eax) # TAILCALL
249
;
250
; X86-64-LABEL: tailcall:
251
; X86-64:       # %bb.0:
252
; X86-64-NEXT:    jmpq *(%rdi) # TAILCALL
253
  %c = load ptr, ptr %p
254
  tail call void %c()
255
  ret void
256
}
257
244
; Don't emit zeroing registers in "main" function.
258
; Don't emit zeroing registers in "main" function.
245
define dso_local i32 @main() local_unnamed_addr #1 {
259
define dso_local i32 @main() local_unnamed_addr #1 {
246
; I386-LABEL: main:
260
; I386-LABEL: main:

Return to bug 927978