[llvm] d49c318 - [X86] emitEpilogue - silence implicit integer extension warning. (#127185)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 18 00:08:27 PST 2025
Author: Simon Pilgrim
Date: 2025-02-18T08:08:24Z
New Revision: d49c3181e68de20ebd5f8e9fc5f4ad3ce20cad6d
URL: https://github.com/llvm/llvm-project/commit/d49c3181e68de20ebd5f8e9fc5f4ad3ce20cad6d
DIFF: https://github.com/llvm/llvm-project/commit/d49c3181e68de20ebd5f8e9fc5f4ad3ce20cad6d.diff
LOG: [X86] emitEpilogue - silence implicit integer extension warning. (#127185)
Silence compiler warning introduced in #125007 - assign the address delta to int64_t, assert it is negative and negate it only as part of the mergeSPAdd call
Fixes #125825
Added:
Modified:
llvm/lib/Target/X86/X86FrameLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp
index 50c56c9dd08b3..10fb6994b51b6 100644
--- a/llvm/lib/Target/X86/X86FrameLowering.cpp
+++ b/llvm/lib/Target/X86/X86FrameLowering.cpp
@@ -2639,11 +2639,11 @@ void X86FrameLowering::emitEpilogue(MachineFunction &MF,
if (Terminator == MBB.end() || !isTailCallOpcode(Terminator->getOpcode())) {
// Add the return addr area delta back since we are not tail calling.
- int64_t Offset = -1 * X86FI->getTCReturnAddrDelta();
- assert(Offset >= 0 && "TCDelta should never be positive");
- if (Offset) {
+ int64_t Delta = X86FI->getTCReturnAddrDelta();
+ assert(Delta <= 0 && "TCDelta should never be positive");
+ if (Delta) {
// Check for possible merge with preceding ADD instruction.
- Offset = mergeSPAdd(MBB, Terminator, Offset, true);
+ int64_t Offset = mergeSPAdd(MBB, Terminator, -Delta, true);
emitSPUpdate(MBB, Terminator, DL, Offset, /*InEpilogue=*/true);
}
}
More information about the llvm-commits
mailing list