summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineCopyPropagation.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2025-05-08 16:27:08 -0700
committerGitHub <noreply@github.com>2025-05-08 16:27:08 -0700
commite4b4a939f8852b2d5aab0d5b999890c7ef85be18 (patch)
tree5b67a8e996bf8c3fbd67291b8be24b8d5ec21b3a /llvm/lib/CodeGen/MachineCopyPropagation.cpp
parenta25d38ddb74d6f7789daf2e7ead416054d2c6cd8 (diff)
[MCP] Disable BackwardCopyPropagateBlock for copies with implicit registers. (#137687)
If there's an implicit-def of a super register, the propagation must preserve this implicit-def. Knowing how and when to do this may require target specific knowledge so just disable it for now. Prior to 2def1c4, we checked that the copy had explicit 2 operands when that was removed we started allowing implicit operands through. This patch adds a check for implicit operands, but still allows extra explicit operands which was the goal of 2def1c4. Fixes #131478.
Diffstat (limited to 'llvm/lib/CodeGen/MachineCopyPropagation.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCopyPropagation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineCopyPropagation.cpp b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
index 224588b9d52e..6eab87c1292e 100644
--- a/llvm/lib/CodeGen/MachineCopyPropagation.cpp
+++ b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
@@ -1206,7 +1206,7 @@ void MachineCopyPropagation::BackwardCopyPropagateBlock(
// Ignore non-trivial COPYs.
std::optional<DestSourcePair> CopyOperands =
isCopyInstr(MI, *TII, UseCopyInstr);
- if (CopyOperands) {
+ if (CopyOperands && MI.getNumImplicitOperands() == 0) {
Register DefReg = CopyOperands->Destination->getReg();
Register SrcReg = CopyOperands->Source->getReg();