[llvm] [AIX] Support per global code model. (PR #79202)
Sean Fertile via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 24 20:36:17 PST 2024
================
@@ -561,6 +561,43 @@ static bool hasTocDataAttr(SDValue Val, unsigned PointerSize) {
return true;
}
+static CodeModel::Model getCodeModel(const PPCSubtarget &Subtarget,
+ const TargetMachine &TM,
+ const SDNode *Node) {
+ // If there isn't an attribute to override the module code model
+ // this will be the effective code model.
+ CodeModel::Model ModuleModel = TM.getCodeModel();
+
+ // Initially support per global code model for AIX only.
+ if (!Subtarget.isAIXABI())
+ return ModuleModel;
+
+ // If the operand is not a global address there is no
+ // GlobalVariable to query for an attribute.
+ SDValue Operand = Node->getOperand(0);
+ if (!isa<GlobalAddressSDNode>(Operand))
+ return ModuleModel;
+
+ GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(Operand);
+ if (!GA)
----------------
mandlebug wrote:
good point, I will remove the check.
https://github.com/llvm/llvm-project/pull/79202
More information about the llvm-commits
mailing list