-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RISCV] Add correct Uses, Defs, isReturn to Zcmp #81039
Conversation
* they all do stack adjustments, so they all use and def x2. * popret and popretz also return * popretz also defines x10 This adds that to the TD file and updates the PushPopOptimizer to preserve the extra implicit operands added during frame lowering when converting to popret(z).
@llvm/pr-subscribers-backend-risc-v Author: Visoiu Mistrih Francis (francisvm) Changes
This adds that to the TD file and updates the PushPopOptimizer to preserve the extra implicit operands added during frame lowering when converting to popret(z). Full diff: https://github.com/llvm/llvm-project/pull/81039.diff 4 Files Affected:
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZc.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZc.td
index 3506204d6c255..a3ec2e5667ee5 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoZc.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZc.td
@@ -190,16 +190,19 @@ def CM_MVSA01 : RVInst16CA<0b101011, 0b01, 0b10, (outs SR07:$rs1, SR07:$rs2),
} // DecoderNamespace = "RVZcmp", Predicates = [HasStdExtZcmp]...
let DecoderNamespace = "RVZcmp", Predicates = [HasStdExtZcmp] in {
-let hasSideEffects = 0, mayLoad = 0, mayStore = 1 in
+let hasSideEffects = 0, mayLoad = 0, mayStore = 1, Uses = [X2], Defs = [X2] in
def CM_PUSH : RVInstZcCPPP<0b11000, "cm.push">;
-let hasSideEffects = 0, mayLoad = 1, mayStore = 0 in
+let hasSideEffects = 0, mayLoad = 1, mayStore = 0, isReturn = 1,
+ Uses = [X2], Defs = [X2] in
def CM_POPRET : RVInstZcCPPP<0b11110, "cm.popret">;
-let hasSideEffects = 0, mayLoad = 1, mayStore = 0 in
+let hasSideEffects = 0, mayLoad = 1, mayStore = 0, isReturn = 1,
+ Uses = [X2], Defs = [X2, X10] in
def CM_POPRETZ : RVInstZcCPPP<0b11100, "cm.popretz">;
-let hasSideEffects = 0, mayLoad = 1, mayStore = 0 in
+let hasSideEffects = 0, mayLoad = 1, mayStore = 0,
+ Uses = [X2], Defs = [X2] in
def CM_POP : RVInstZcCPPP<0b11010, "cm.pop">;
} // DecoderNamespace = "RVZcmp", Predicates = [HasStdExtZcmp]...
diff --git a/llvm/lib/Target/RISCV/RISCVPushPopOptimizer.cpp b/llvm/lib/Target/RISCV/RISCVPushPopOptimizer.cpp
index 009dcf57f46da..098e5bb5328bb 100644
--- a/llvm/lib/Target/RISCV/RISCVPushPopOptimizer.cpp
+++ b/llvm/lib/Target/RISCV/RISCVPushPopOptimizer.cpp
@@ -62,9 +62,19 @@ bool RISCVPushPopOpt::usePopRet(MachineBasicBlock::iterator &MBBI,
// this will detect all ret instruction.
DebugLoc DL = NextI->getDebugLoc();
unsigned Opc = IsReturnZero ? RISCV::CM_POPRETZ : RISCV::CM_POPRET;
- BuildMI(*NextI->getParent(), NextI, DL, TII->get(Opc))
- .add(MBBI->getOperand(0))
- .add(MBBI->getOperand(1));
+ MachineInstrBuilder PopRetBuilder =
+ BuildMI(*NextI->getParent(), NextI, DL, TII->get(Opc))
+ .add(MBBI->getOperand(0))
+ .add(MBBI->getOperand(1));
+
+ // Copy over the variable implicit uses and defs from the CM_POP. They depend
+ // on what register list has been picked during frame lowering.
+ const MCInstrDesc &PopDesc = MBBI->getDesc();
+ unsigned FirstNonDeclaredOp = PopDesc.getNumOperands() +
+ PopDesc.NumImplicitUses +
+ PopDesc.NumImplicitDefs;
+ for (unsigned i = FirstNonDeclaredOp; i < MBBI->getNumOperands(); ++i)
+ PopRetBuilder.add(MBBI->getOperand(i));
MBBI->eraseFromParent();
NextI->eraseFromParent();
diff --git a/llvm/test/CodeGen/RISCV/zcmp-cm-popretz.mir b/llvm/test/CodeGen/RISCV/zcmp-cm-popretz.mir
new file mode 100644
index 0000000000000..93931ff950a8c
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/zcmp-cm-popretz.mir
@@ -0,0 +1,186 @@
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
+# RUN: llc -mtriple=riscv32 -mattr=+zcmp -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
+# RUN: | FileCheck -check-prefixes=CHECK-ZCMP32 %s
+# RUN: llc -mtriple=riscv32 -mattr=+save-restore -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
+# RUN: | FileCheck -check-prefixes=CHECK-LIBCALL32 %s
+# RUN: llc -mtriple=riscv64 -mattr=+zcmp -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
+# RUN: | FileCheck -check-prefixes=CHECK-ZCMP64 %s
+# RUN: llc -mtriple=riscv64 -mattr=+save-restore -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
+# RUN: | FileCheck -check-prefixes=CHECK-LIBCALL64 %s
+# RUN: llc -mtriple=riscv32 -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
+# RUN: | FileCheck -check-prefixes=CHECK-NO-ZCMP32 %s
+# RUN: llc -mtriple=riscv64 -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
+# RUN: | FileCheck -check-prefixes=CHECK-NO-ZCMP64 %s
+---
+name: popret_rvlist5
+tracksRegLiveness: true
+body: |
+ bb.0:
+ ; CHECK-ZCMP32-LABEL: name: popret_rvlist5
+ ; CHECK-ZCMP32: liveins: $x1, $x8
+ ; CHECK-ZCMP32-NEXT: {{ $}}
+ ; CHECK-ZCMP32-NEXT: frame-setup CM_PUSH 5, 0, implicit-def $x2, implicit $x2, implicit $x1, implicit $x8
+ ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
+ ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
+ ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -4
+ ; CHECK-ZCMP32-NEXT: $x1 = IMPLICIT_DEF
+ ; CHECK-ZCMP32-NEXT: $x8 = IMPLICIT_DEF
+ ; CHECK-ZCMP32-NEXT: CM_POPRET 5, 0, implicit-def $x2, implicit $x2, implicit-def $x1, implicit-def $x8
+ ;
+ ; CHECK-LIBCALL32-LABEL: name: popret_rvlist5
+ ; CHECK-LIBCALL32: liveins: $x1, $x8
+ ; CHECK-LIBCALL32-NEXT: {{ $}}
+ ; CHECK-LIBCALL32-NEXT: $x5 = frame-setup PseudoCALLReg target-flags(riscv-call) &__riscv_save_1
+ ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
+ ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -4
+ ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
+ ; CHECK-LIBCALL32-NEXT: $x1 = IMPLICIT_DEF
+ ; CHECK-LIBCALL32-NEXT: $x8 = IMPLICIT_DEF
+ ; CHECK-LIBCALL32-NEXT: frame-destroy PseudoTAIL target-flags(riscv-call) &__riscv_restore_1, implicit $x2
+ ;
+ ; CHECK-ZCMP64-LABEL: name: popret_rvlist5
+ ; CHECK-ZCMP64: liveins: $x1, $x8
+ ; CHECK-ZCMP64-NEXT: {{ $}}
+ ; CHECK-ZCMP64-NEXT: frame-setup CM_PUSH 5, 0, implicit-def $x2, implicit $x2, implicit $x1, implicit $x8
+ ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
+ ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -16
+ ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
+ ; CHECK-ZCMP64-NEXT: $x1 = IMPLICIT_DEF
+ ; CHECK-ZCMP64-NEXT: $x8 = IMPLICIT_DEF
+ ; CHECK-ZCMP64-NEXT: CM_POPRET 5, 0, implicit-def $x2, implicit $x2, implicit-def $x1, implicit-def $x8
+ ;
+ ; CHECK-LIBCALL64-LABEL: name: popret_rvlist5
+ ; CHECK-LIBCALL64: liveins: $x1, $x8
+ ; CHECK-LIBCALL64-NEXT: {{ $}}
+ ; CHECK-LIBCALL64-NEXT: $x5 = frame-setup PseudoCALLReg target-flags(riscv-call) &__riscv_save_1
+ ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
+ ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
+ ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -16
+ ; CHECK-LIBCALL64-NEXT: $x1 = IMPLICIT_DEF
+ ; CHECK-LIBCALL64-NEXT: $x8 = IMPLICIT_DEF
+ ; CHECK-LIBCALL64-NEXT: frame-destroy PseudoTAIL target-flags(riscv-call) &__riscv_restore_1, implicit $x2
+ ;
+ ; CHECK-NO-ZCMP32-LABEL: name: popret_rvlist5
+ ; CHECK-NO-ZCMP32: liveins: $x1, $x8
+ ; CHECK-NO-ZCMP32-NEXT: {{ $}}
+ ; CHECK-NO-ZCMP32-NEXT: $x2 = frame-setup ADDI $x2, -16
+ ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
+ ; CHECK-NO-ZCMP32-NEXT: SW killed $x1, $x2, 12 :: (store (s32) into %stack.0)
+ ; CHECK-NO-ZCMP32-NEXT: SW killed $x8, $x2, 8 :: (store (s32) into %stack.1)
+ ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -4
+ ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
+ ; CHECK-NO-ZCMP32-NEXT: $x1 = IMPLICIT_DEF
+ ; CHECK-NO-ZCMP32-NEXT: $x8 = IMPLICIT_DEF
+ ; CHECK-NO-ZCMP32-NEXT: $x1 = LW $x2, 12 :: (load (s32) from %stack.0)
+ ; CHECK-NO-ZCMP32-NEXT: $x8 = LW $x2, 8 :: (load (s32) from %stack.1)
+ ; CHECK-NO-ZCMP32-NEXT: $x2 = frame-destroy ADDI $x2, 16
+ ; CHECK-NO-ZCMP32-NEXT: PseudoRET
+ ;
+ ; CHECK-NO-ZCMP64-LABEL: name: popret_rvlist5
+ ; CHECK-NO-ZCMP64: liveins: $x1, $x8
+ ; CHECK-NO-ZCMP64-NEXT: {{ $}}
+ ; CHECK-NO-ZCMP64-NEXT: $x2 = frame-setup ADDI $x2, -16
+ ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
+ ; CHECK-NO-ZCMP64-NEXT: SD killed $x1, $x2, 8 :: (store (s64) into %stack.0)
+ ; CHECK-NO-ZCMP64-NEXT: SD killed $x8, $x2, 0 :: (store (s64) into %stack.1)
+ ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
+ ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -16
+ ; CHECK-NO-ZCMP64-NEXT: $x1 = IMPLICIT_DEF
+ ; CHECK-NO-ZCMP64-NEXT: $x8 = IMPLICIT_DEF
+ ; CHECK-NO-ZCMP64-NEXT: $x1 = LD $x2, 8 :: (load (s64) from %stack.0)
+ ; CHECK-NO-ZCMP64-NEXT: $x8 = LD $x2, 0 :: (load (s64) from %stack.1)
+ ; CHECK-NO-ZCMP64-NEXT: $x2 = frame-destroy ADDI $x2, 16
+ ; CHECK-NO-ZCMP64-NEXT: PseudoRET
+ $x1 = IMPLICIT_DEF
+ $x8 = IMPLICIT_DEF
+ PseudoRET
+...
+---
+name: popretz_rvlist5
+tracksRegLiveness: true
+body: |
+ bb.0:
+ ; CHECK-ZCMP32-LABEL: name: popretz_rvlist5
+ ; CHECK-ZCMP32: liveins: $x1, $x8
+ ; CHECK-ZCMP32-NEXT: {{ $}}
+ ; CHECK-ZCMP32-NEXT: frame-setup CM_PUSH 5, 0, implicit-def $x2, implicit $x2, implicit $x1, implicit $x8
+ ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
+ ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
+ ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -4
+ ; CHECK-ZCMP32-NEXT: $x1 = IMPLICIT_DEF
+ ; CHECK-ZCMP32-NEXT: $x8 = IMPLICIT_DEF
+ ; CHECK-ZCMP32-NEXT: CM_POPRETZ 5, 0, implicit-def $x2, implicit-def $x10, implicit $x2, implicit-def $x1, implicit-def $x8
+ ;
+ ; CHECK-LIBCALL32-LABEL: name: popretz_rvlist5
+ ; CHECK-LIBCALL32: liveins: $x1, $x8
+ ; CHECK-LIBCALL32-NEXT: {{ $}}
+ ; CHECK-LIBCALL32-NEXT: $x5 = frame-setup PseudoCALLReg target-flags(riscv-call) &__riscv_save_1
+ ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
+ ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -4
+ ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
+ ; CHECK-LIBCALL32-NEXT: $x1 = IMPLICIT_DEF
+ ; CHECK-LIBCALL32-NEXT: $x8 = IMPLICIT_DEF
+ ; CHECK-LIBCALL32-NEXT: $x10 = ADDI $x0, 0
+ ; CHECK-LIBCALL32-NEXT: frame-destroy PseudoTAIL target-flags(riscv-call) &__riscv_restore_1, implicit $x2, implicit $x10
+ ;
+ ; CHECK-ZCMP64-LABEL: name: popretz_rvlist5
+ ; CHECK-ZCMP64: liveins: $x1, $x8
+ ; CHECK-ZCMP64-NEXT: {{ $}}
+ ; CHECK-ZCMP64-NEXT: frame-setup CM_PUSH 5, 0, implicit-def $x2, implicit $x2, implicit $x1, implicit $x8
+ ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
+ ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -16
+ ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
+ ; CHECK-ZCMP64-NEXT: $x1 = IMPLICIT_DEF
+ ; CHECK-ZCMP64-NEXT: $x8 = IMPLICIT_DEF
+ ; CHECK-ZCMP64-NEXT: CM_POPRETZ 5, 0, implicit-def $x2, implicit-def $x10, implicit $x2, implicit-def $x1, implicit-def $x8
+ ;
+ ; CHECK-LIBCALL64-LABEL: name: popretz_rvlist5
+ ; CHECK-LIBCALL64: liveins: $x1, $x8
+ ; CHECK-LIBCALL64-NEXT: {{ $}}
+ ; CHECK-LIBCALL64-NEXT: $x5 = frame-setup PseudoCALLReg target-flags(riscv-call) &__riscv_save_1
+ ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
+ ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
+ ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -16
+ ; CHECK-LIBCALL64-NEXT: $x1 = IMPLICIT_DEF
+ ; CHECK-LIBCALL64-NEXT: $x8 = IMPLICIT_DEF
+ ; CHECK-LIBCALL64-NEXT: $x10 = ADDI $x0, 0
+ ; CHECK-LIBCALL64-NEXT: frame-destroy PseudoTAIL target-flags(riscv-call) &__riscv_restore_1, implicit $x2, implicit $x10
+ ;
+ ; CHECK-NO-ZCMP32-LABEL: name: popretz_rvlist5
+ ; CHECK-NO-ZCMP32: liveins: $x1, $x8
+ ; CHECK-NO-ZCMP32-NEXT: {{ $}}
+ ; CHECK-NO-ZCMP32-NEXT: $x2 = frame-setup ADDI $x2, -16
+ ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
+ ; CHECK-NO-ZCMP32-NEXT: SW killed $x1, $x2, 12 :: (store (s32) into %stack.0)
+ ; CHECK-NO-ZCMP32-NEXT: SW killed $x8, $x2, 8 :: (store (s32) into %stack.1)
+ ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -4
+ ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
+ ; CHECK-NO-ZCMP32-NEXT: $x1 = IMPLICIT_DEF
+ ; CHECK-NO-ZCMP32-NEXT: $x8 = IMPLICIT_DEF
+ ; CHECK-NO-ZCMP32-NEXT: $x10 = ADDI $x0, 0
+ ; CHECK-NO-ZCMP32-NEXT: $x1 = LW $x2, 12 :: (load (s32) from %stack.0)
+ ; CHECK-NO-ZCMP32-NEXT: $x8 = LW $x2, 8 :: (load (s32) from %stack.1)
+ ; CHECK-NO-ZCMP32-NEXT: $x2 = frame-destroy ADDI $x2, 16
+ ; CHECK-NO-ZCMP32-NEXT: PseudoRET implicit $x10
+ ;
+ ; CHECK-NO-ZCMP64-LABEL: name: popretz_rvlist5
+ ; CHECK-NO-ZCMP64: liveins: $x1, $x8
+ ; CHECK-NO-ZCMP64-NEXT: {{ $}}
+ ; CHECK-NO-ZCMP64-NEXT: $x2 = frame-setup ADDI $x2, -16
+ ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
+ ; CHECK-NO-ZCMP64-NEXT: SD killed $x1, $x2, 8 :: (store (s64) into %stack.0)
+ ; CHECK-NO-ZCMP64-NEXT: SD killed $x8, $x2, 0 :: (store (s64) into %stack.1)
+ ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
+ ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -16
+ ; CHECK-NO-ZCMP64-NEXT: $x1 = IMPLICIT_DEF
+ ; CHECK-NO-ZCMP64-NEXT: $x8 = IMPLICIT_DEF
+ ; CHECK-NO-ZCMP64-NEXT: $x10 = ADDI $x0, 0
+ ; CHECK-NO-ZCMP64-NEXT: $x1 = LD $x2, 8 :: (load (s64) from %stack.0)
+ ; CHECK-NO-ZCMP64-NEXT: $x8 = LD $x2, 0 :: (load (s64) from %stack.1)
+ ; CHECK-NO-ZCMP64-NEXT: $x2 = frame-destroy ADDI $x2, 16
+ ; CHECK-NO-ZCMP64-NEXT: PseudoRET implicit $x10
+ $x1 = IMPLICIT_DEF
+ $x8 = IMPLICIT_DEF
+ $x10 = COPY $x0
+ PseudoRET implicit $x10
+...
diff --git a/llvm/test/CodeGen/RISCV/zcmp-cm-push-pop.mir b/llvm/test/CodeGen/RISCV/zcmp-cm-push-pop.mir
index d9ccb490cede0..db474b51432c7 100644
--- a/llvm/test/CodeGen/RISCV/zcmp-cm-push-pop.mir
+++ b/llvm/test/CodeGen/RISCV/zcmp-cm-push-pop.mir
@@ -19,7 +19,7 @@ body: |
; CHECK-ZCMP32-LABEL: name: push_rvlist15
; CHECK-ZCMP32: liveins: $x1, $x8, $x9, $x18, $x19, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27
; CHECK-ZCMP32-NEXT: {{ $}}
- ; CHECK-ZCMP32-NEXT: frame-setup CM_PUSH 15, 0, implicit $x1, implicit $x8, implicit $x9, implicit $x18, implicit $x19, implicit $x20, implicit $x21, implicit $x22, implicit $x23, implicit $x24, implicit $x25, implicit $x26, implicit $x27
+ ; CHECK-ZCMP32-NEXT: frame-setup CM_PUSH 15, 0, implicit-def $x2, implicit $x2, implicit $x1, implicit $x8, implicit $x9, implicit $x18, implicit $x19, implicit $x20, implicit $x21, implicit $x22, implicit $x23, implicit $x24, implicit $x25, implicit $x26, implicit $x27
; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 64
; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -52
; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -48
@@ -47,7 +47,7 @@ body: |
; CHECK-ZCMP32-NEXT: $x25 = IMPLICIT_DEF
; CHECK-ZCMP32-NEXT: $x26 = IMPLICIT_DEF
; CHECK-ZCMP32-NEXT: $x27 = IMPLICIT_DEF
- ; CHECK-ZCMP32-NEXT: frame-destroy CM_POP 15, 0, implicit-def $x1, implicit-def $x8, implicit-def $x9, implicit-def $x18, implicit-def $x19, implicit-def $x20, implicit-def $x21, implicit-def $x22, implicit-def $x23, implicit-def $x24, implicit-def $x25, implicit-def $x26, implicit-def $x27
+ ; CHECK-ZCMP32-NEXT: frame-destroy CM_POP 15, 0, implicit-def $x2, implicit $x2, implicit-def $x1, implicit-def $x8, implicit-def $x9, implicit-def $x18, implicit-def $x19, implicit-def $x20, implicit-def $x21, implicit-def $x22, implicit-def $x23, implicit-def $x24, implicit-def $x25, implicit-def $x26, implicit-def $x27
; CHECK-ZCMP32-NEXT: PseudoRET
;
; CHECK-LIBCALL32-LABEL: name: push_rvlist15
@@ -86,7 +86,7 @@ body: |
; CHECK-ZCMP64-LABEL: name: push_rvlist15
; CHECK-ZCMP64: liveins: $x1, $x8, $x9, $x18, $x19, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27
; CHECK-ZCMP64-NEXT: {{ $}}
- ; CHECK-ZCMP64-NEXT: frame-setup CM_PUSH 15, 0, implicit $x1, implicit $x8, implicit $x9, implicit $x18, implicit $x19, implicit $x20, implicit $x21, implicit $x22, implicit $x23, implicit $x24, implicit $x25, implicit $x26, implicit $x27
+ ; CHECK-ZCMP64-NEXT: frame-setup CM_PUSH 15, 0, implicit-def $x2, implicit $x2, implicit $x1, implicit $x8, implicit $x9, implicit $x18, implicit $x19, implicit $x20, implicit $x21, implicit $x22, implicit $x23, implicit $x24, implicit $x25, implicit $x26, implicit $x27
; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 112
; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -104
; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -96
@@ -114,7 +114,7 @@ body: |
; CHECK-ZCMP64-NEXT: $x25 = IMPLICIT_DEF
; CHECK-ZCMP64-NEXT: $x26 = IMPLICIT_DEF
; CHECK-ZCMP64-NEXT: $x27 = IMPLICIT_DEF
- ; CHECK-ZCMP64-NEXT: frame-destroy CM_POP 15, 0, implicit-def $x1, implicit-def $x8, implicit-def $x9, implicit-def $x18, implicit-def $x19, implicit-def $x20, implicit-def $x21, implicit-def $x22, implicit-def $x23, implicit-def $x24, implicit-def $x25, implicit-def $x26, implicit-def $x27
+ ; CHECK-ZCMP64-NEXT: frame-destroy CM_POP 15, 0, implicit-def $x2, implicit $x2, implicit-def $x1, implicit-def $x8, implicit-def $x9, implicit-def $x18, implicit-def $x19, implicit-def $x20, implicit-def $x21, implicit-def $x22, implicit-def $x23, implicit-def $x24, implicit-def $x25, implicit-def $x26, implicit-def $x27
; CHECK-ZCMP64-NEXT: PseudoRET
;
; CHECK-LIBCALL64-LABEL: name: push_rvlist15
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This adds that to the TD file and updates the PushPopOptimizer to preserve the extra implicit operands added during frame lowering when converting to popret(z).