aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Target
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-05-22 17:29:55 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-06-22 18:22:43 +0000
commita324c34037ef2e1101962fca4ad0c021253288e1 (patch)
tree4d216bfdc5ef785e97600ad015767f96044e2d6f /contrib/llvm-project/llvm/lib/Target
parentcbe9438cfe07adfbcdeafe8e363614f83b03a055 (diff)
parent791701a7dc6225242c41502cb3ed6874623c1785 (diff)
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Target')
-rw-r--r--contrib/llvm-project/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp6
-rw-r--r--contrib/llvm-project/llvm/lib/Target/X86/X86FrameLowering.cpp14
2 files changed, 17 insertions, 3 deletions
diff --git a/contrib/llvm-project/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
index 5dca792dc89a..0b3059df124e 100644
--- a/contrib/llvm-project/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
+++ b/contrib/llvm-project/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
@@ -8488,11 +8488,13 @@ SystemZTargetLowering::emitMemMemWrapper(MachineInstr &MI,
.addReg(RemSrcReg).addImm(SrcDisp);
MBB->addSuccessor(AllDoneMBB);
MBB = AllDoneMBB;
- if (EndMBB) {
+ if (Opcode != SystemZ::MVC) {
EXRL_MIB.addReg(SystemZ::CC, RegState::ImplicitDefine);
- MBB->addLiveIn(SystemZ::CC);
+ if (EndMBB)
+ MBB->addLiveIn(SystemZ::CC);
}
}
+ MF.getProperties().reset(MachineFunctionProperties::Property::NoPHIs);
}
// Handle any remaining bytes with straight-line code.
diff --git a/contrib/llvm-project/llvm/lib/Target/X86/X86FrameLowering.cpp b/contrib/llvm-project/llvm/lib/Target/X86/X86FrameLowering.cpp
index 1606413c382b..df9aaddd5729 100644
--- a/contrib/llvm-project/llvm/lib/Target/X86/X86FrameLowering.cpp
+++ b/contrib/llvm-project/llvm/lib/Target/X86/X86FrameLowering.cpp
@@ -1557,7 +1557,19 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF,
Fn.arg_size() == 2) {
StackSize += 8;
MFI.setStackSize(StackSize);
- emitSPUpdate(MBB, MBBI, DL, -8, /*InEpilogue=*/false);
+
+ // Update the stack pointer by pushing a register. This is the instruction
+ // emitted that would be end up being emitted by a call to `emitSPUpdate`.
+ // Hard-coding the update to a push avoids emitting a second
+ // `STACKALLOC_W_PROBING` instruction in the save block: We know that stack
+ // probing isn't needed anyways for an 8-byte update.
+ // Pushing a register leaves us in a similar situation to a regular
+ // function call where we know that the address at (rsp-8) is writeable.
+ // That way we avoid any off-by-ones with stack probing for additional
+ // stack pointer updates later on.
+ BuildMI(MBB, MBBI, DL, TII.get(X86::PUSH64r))
+ .addReg(X86::RAX, RegState::Undef)
+ .setMIFlag(MachineInstr::FrameSetup);
}
// If this is x86-64 and the Red Zone is not disabled, if we are a leaf