File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -1298,6 +1298,8 @@ void PEI::insertZeroCallUsedRegs(MachineFunction &MF) {
1298
1298
continue ;
1299
1299
1300
1300
MCRegister Reg = MO.getReg ();
1301
+ if (!Reg)
1302
+ continue ;
1301
1303
1302
1304
// This picks up sibling registers (e.q. %al -> %ah).
1303
1305
for (MCRegUnit Unit : TRI.regunits (Reg))
@@ -1321,8 +1323,11 @@ void PEI::insertZeroCallUsedRegs(MachineFunction &MF) {
1321
1323
if (!MO.isReg ())
1322
1324
continue ;
1323
1325
1324
- for (const MCPhysReg &Reg :
1325
- TRI.sub_and_superregs_inclusive (MO.getReg ()))
1326
+ MCRegister Reg = MO.getReg ();
1327
+ if (!Reg)
1328
+ continue ;
1329
+
1330
+ for (const MCPhysReg Reg : TRI.sub_and_superregs_inclusive (Reg))
1326
1331
RegsToZero.reset (Reg);
1327
1332
}
1328
1333
}
Original file line number Diff line number Diff line change @@ -241,6 +241,20 @@ entry:
241
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
258
; Don't emit zeroing registers in "main" function.
245
259
define dso_local i32 @main () local_unnamed_addr #1 {
246
260
; I386-LABEL: main:
You can’t perform that action at this time.
0 commit comments