-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[PowerPC] Remove custom original type tracking (NFCI) #154090
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
Conversation
The OrigTy is passed to CC lowering nowadays, so use it directly instead of custom pre-analysis.
|
@llvm/pr-subscribers-backend-powerpc Author: Nikita Popov (nikic) ChangesThe OrigTy is passed to CC lowering nowadays, so use it directly instead of custom pre-analysis. Full diff: https://github.com/llvm/llvm-project/pull/154090.diff 6 Files Affected:
diff --git a/llvm/lib/Target/PowerPC/CMakeLists.txt b/llvm/lib/Target/PowerPC/CMakeLists.txt
index 3808a26a0b92a..1e39f01fd7aa5 100644
--- a/llvm/lib/Target/PowerPC/CMakeLists.txt
+++ b/llvm/lib/Target/PowerPC/CMakeLists.txt
@@ -25,7 +25,6 @@ add_llvm_target(PowerPCCodeGen
PPCBranchSelector.cpp
PPCBranchCoalescing.cpp
PPCCallingConv.cpp
- PPCCCState.cpp
PPCCTRLoops.cpp
PPCCTRLoopsVerify.cpp
PPCExpandAtomicPseudoInsts.cpp
diff --git a/llvm/lib/Target/PowerPC/PPCCCState.cpp b/llvm/lib/Target/PowerPC/PPCCCState.cpp
deleted file mode 100644
index e08aaf89e8dbe..0000000000000
--- a/llvm/lib/Target/PowerPC/PPCCCState.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===---- PPCCCState.cpp - CCState with PowerPC specific extensions ---------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "PPCCCState.h"
-using namespace llvm;
-
-// Identify lowered values that originated from ppcf128 arguments and record
-// this.
-void PPCCCState::PreAnalyzeCallOperands(
- const SmallVectorImpl<ISD::OutputArg> &Outs) {
- for (const auto &I : Outs) {
- if (I.ArgVT == llvm::MVT::ppcf128)
- OriginalArgWasPPCF128.push_back(true);
- else
- OriginalArgWasPPCF128.push_back(false);
- }
-}
-
-void PPCCCState::PreAnalyzeFormalArguments(
- const SmallVectorImpl<ISD::InputArg> &Ins) {
- for (const auto &I : Ins) {
- if (I.ArgVT == llvm::MVT::ppcf128) {
- OriginalArgWasPPCF128.push_back(true);
- } else {
- OriginalArgWasPPCF128.push_back(false);
- }
- }
-}
diff --git a/llvm/lib/Target/PowerPC/PPCCCState.h b/llvm/lib/Target/PowerPC/PPCCCState.h
deleted file mode 100644
index feab9c58e650a..0000000000000
--- a/llvm/lib/Target/PowerPC/PPCCCState.h
+++ /dev/null
@@ -1,43 +0,0 @@
-//===---- PPCCCState.h - CCState with PowerPC specific extensions -----------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef PPCCCSTATE_H
-#define PPCCCSTATE_H
-
-#include "PPCISelLowering.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/CodeGen/CallingConvLower.h"
-
-namespace llvm {
-
-class PPCCCState : public CCState {
-public:
-
- void
- PreAnalyzeCallOperands(const SmallVectorImpl<ISD::OutputArg> &Outs);
- void
- PreAnalyzeFormalArguments(const SmallVectorImpl<ISD::InputArg> &Ins);
-
-private:
-
- // Records whether the value has been lowered from an ppcf128.
- SmallVector<bool, 4> OriginalArgWasPPCF128;
-
-public:
- PPCCCState(CallingConv::ID CC, bool isVarArg, MachineFunction &MF,
- SmallVectorImpl<CCValAssign> &locs, LLVMContext &C)
- : CCState(CC, isVarArg, MF, locs, C) {}
-
- bool WasOriginalArgPPCF128(unsigned ValNo) { return OriginalArgWasPPCF128[ValNo]; }
- void clearWasPPCF128() { OriginalArgWasPPCF128.clear(); }
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/llvm/lib/Target/PowerPC/PPCCallingConv.cpp b/llvm/lib/Target/PowerPC/PPCCallingConv.cpp
index b00d70bbe263b..332b5e07d3d5d 100644
--- a/llvm/lib/Target/PowerPC/PPCCallingConv.cpp
+++ b/llvm/lib/Target/PowerPC/PPCCallingConv.cpp
@@ -8,7 +8,6 @@
#include "PPCCallingConv.h"
#include "PPCSubtarget.h"
-#include "PPCCCState.h"
using namespace llvm;
inline bool CC_PPC_AnyReg_Error(unsigned &, MVT &, MVT &,
diff --git a/llvm/lib/Target/PowerPC/PPCCallingConv.td b/llvm/lib/Target/PowerPC/PPCCallingConv.td
index 899326ad46656..5d4fe06ebdddd 100644
--- a/llvm/lib/Target/PowerPC/PPCCallingConv.td
+++ b/llvm/lib/Target/PowerPC/PPCCallingConv.td
@@ -21,11 +21,9 @@ class CCIfNotSubtarget<string F, CCAction A>
F),
A>;
class CCIfOrigArgWasNotPPCF128<CCAction A>
- : CCIf<"!static_cast<PPCCCState *>(&State)->WasOriginalArgPPCF128(ValNo)",
- A>;
+ : CCIf<"!OrigTy->isPPC_FP128Ty()", A>;
class CCIfOrigArgWasPPCF128<CCAction A>
- : CCIf<"static_cast<PPCCCState *>(&State)->WasOriginalArgPPCF128(ValNo)",
- A>;
+ : CCIf<"OrigTy->isPPC_FP128Ty()", A>;
//===----------------------------------------------------------------------===//
// Return Value Calling Convention
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index b97d0e235c019..87a6b262c47ff 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -14,7 +14,6 @@
#include "MCTargetDesc/PPCMCTargetDesc.h"
#include "MCTargetDesc/PPCPredicates.h"
#include "PPC.h"
-#include "PPCCCState.h"
#include "PPCCallingConv.h"
#include "PPCFrameLowering.h"
#include "PPCInstrInfo.h"
@@ -4330,17 +4329,13 @@ SDValue PPCTargetLowering::LowerFormalArguments_32SVR4(
// Assign locations to all of the incoming arguments.
SmallVector<CCValAssign, 16> ArgLocs;
- PPCCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
*DAG.getContext());
// Reserve space for the linkage area on the stack.
unsigned LinkageSize = Subtarget.getFrameLowering()->getLinkageSize();
CCInfo.AllocateStack(LinkageSize, PtrAlign);
- if (useSoftFloat())
- CCInfo.PreAnalyzeFormalArguments(Ins);
-
CCInfo.AnalyzeFormalArguments(Ins, CC_PPC32_SVR4);
- CCInfo.clearWasPPCF128();
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
CCValAssign &VA = ArgLocs[i];
@@ -6062,13 +6057,11 @@ SDValue PPCTargetLowering::LowerCall_32SVR4(
// Assign locations to all of the outgoing arguments.
SmallVector<CCValAssign, 16> ArgLocs;
- PPCCCState CCInfo(CallConv, IsVarArg, MF, ArgLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, IsVarArg, MF, ArgLocs, *DAG.getContext());
// Reserve space for the linkage area on the stack.
CCInfo.AllocateStack(Subtarget.getFrameLowering()->getLinkageSize(),
PtrAlign);
- if (useSoftFloat())
- CCInfo.PreAnalyzeCallOperands(Outs);
if (IsVarArg) {
// Handle fixed and variable vector arguments differently.
@@ -6101,7 +6094,6 @@ SDValue PPCTargetLowering::LowerCall_32SVR4(
// All arguments are treated the same.
CCInfo.AnalyzeCallOperands(Outs, CC_PPC32_SVR4);
}
- CCInfo.clearWasPPCF128();
// Assign locations to all of the outgoing aggregate by value arguments.
SmallVector<CCValAssign, 16> ByValArgLocs;
|
s-barannikov
left a comment
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
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/22926 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/42/builds/5868 Here is the relevant piece of the build log for the reference |
The OrigTy is passed to CC lowering nowadays, so use it directly instead of custom pre-analysis.