mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 03:56:08 +00:00
[SystemZ] Bugfix of CC liveness in emitMemMemWrapper (CLC).
If DoneMBB becomes empty it must have CC added to its live-in list, since it will fall-through into EndMBB. This happens when the CLC loop does the complete range. Review: Ulrich Weigand llvm-svn: 327834
This commit is contained in:
parent
fcefdb877c
commit
a6216ec4cc
@ -6626,6 +6626,10 @@ MachineBasicBlock *SystemZTargetLowering::emitMemMemWrapper(
|
|||||||
DestBase = MachineOperand::CreateReg(NextDestReg, false);
|
DestBase = MachineOperand::CreateReg(NextDestReg, false);
|
||||||
SrcBase = MachineOperand::CreateReg(NextSrcReg, false);
|
SrcBase = MachineOperand::CreateReg(NextSrcReg, false);
|
||||||
Length &= 255;
|
Length &= 255;
|
||||||
|
if (EndMBB && !Length)
|
||||||
|
// If the loop handled the whole CLC range, DoneMBB will be empty with
|
||||||
|
// CC live-through into EndMBB, so add it as live-in.
|
||||||
|
DoneMBB->addLiveIn(SystemZ::CC);
|
||||||
MBB = DoneMBB;
|
MBB = DoneMBB;
|
||||||
}
|
}
|
||||||
// Handle any remaining bytes with straight-line code.
|
// Handle any remaining bytes with straight-line code.
|
||||||
|
20
llvm/test/CodeGen/SystemZ/memcmp-02.ll
Normal file
20
llvm/test/CodeGen/SystemZ/memcmp-02.ll
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
; Test memcmp using CLC. In this test case the CLC loop will do all the work
|
||||||
|
; and the DoneMBB becomes empty. It will not pass the mischeduling verifiers
|
||||||
|
; if DoneMBB does not have CC in its live-in list.
|
||||||
|
|
||||||
|
; RUN: llc < %s -mtriple=s390x-linux-gnu -misched=shuffle | FileCheck %s
|
||||||
|
|
||||||
|
declare i32 @memcmp(i8* nocapture, i8* nocapture, i64)
|
||||||
|
|
||||||
|
define i32 @fun() {
|
||||||
|
; CHECK-LABEL: fun
|
||||||
|
%call = call signext i32 @memcmp(i8* nonnull undef, i8* nonnull undef, i64 2048)
|
||||||
|
%cmp = icmp eq i32 %call, 0
|
||||||
|
br i1 %cmp, label %labT, label %labF
|
||||||
|
|
||||||
|
labT:
|
||||||
|
ret i32 0
|
||||||
|
|
||||||
|
labF:
|
||||||
|
ret i32 1
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user