From 9878ef3abd2a48fcfb81357d581dac292b52ddb3 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Fri, 18 Jul 2025 13:33:46 -0700 Subject: CodeGen: Respect function align attribute if less than preferred alignment. Reviewers: arsenm, efriedma-quic Reviewed By: arsenm Pull Request: https://github.com/llvm/llvm-project/pull/149444 --- llvm/lib/CodeGen/MachineFunction.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/MachineFunction.cpp') diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 38ad582ba923..429a17a9113d 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -211,9 +211,8 @@ void MachineFunction::init() { ConstantPool = new (Allocator) MachineConstantPool(getDataLayout()); Alignment = STI->getTargetLowering()->getMinFunctionAlignment(); - // FIXME: Shouldn't use pref alignment if explicit alignment is set on F. // FIXME: Use Function::hasOptSize(). - if (!F.hasFnAttribute(Attribute::OptimizeForSize)) + if (!F.getAlign() && !F.hasFnAttribute(Attribute::OptimizeForSize)) Alignment = std::max(Alignment, STI->getTargetLowering()->getPrefFunctionAlignment()); -- cgit v1.2.3 From 7baf4bdd164cad61f8f3e34ed833a695c4033250 Mon Sep 17 00:00:00 2001 From: Prabhu Rajasekaran Date: Wed, 23 Jul 2025 10:11:20 -0700 Subject: [llvm] Add CalleeTypeIds field to CallSiteInfo Introducing `EnableCallGraphSection` target option to add CalleeTypeIds field in CallSiteInfo. Read the callee type ids in and out by the MIR parser/printer. Reviewers: ilovepi Reviewed By: ilovepi Pull Request: https://github.com/llvm/llvm-project/pull/87574 --- llvm/lib/CodeGen/MachineFunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/MachineFunction.cpp') diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 429a17a9113d..468849c76a2c 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -920,7 +920,7 @@ MachineFunction::getCallSiteInfo(const MachineInstr *MI) { assert(MI->isCandidateForAdditionalCallInfo() && "Call site info refers only to call (MI) candidates"); - if (!Target.Options.EmitCallSiteInfo) + if (!Target.Options.EmitCallSiteInfo && !Target.Options.EmitCallGraphSection) return CallSitesInfo.end(); return CallSitesInfo.find(MI); } -- cgit v1.2.3 From 05e08cdb3e576cc0887d1507ebd2f756460c7db7 Mon Sep 17 00:00:00 2001 From: Haowei Date: Wed, 23 Jul 2025 15:45:43 -0700 Subject: Revert "[llvm] Add CalleeTypeIds field to CallSiteInfo" (#150335) Reverts llvm/llvm-project#87574, which breaks LLVM :: CodeGen/MIR/X86/call-site-info-ambiguous-indirect-call-typeid.mir tests on linux-arm64 builders. --- llvm/lib/CodeGen/MachineFunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/MachineFunction.cpp') diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 468849c76a2c..429a17a9113d 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -920,7 +920,7 @@ MachineFunction::getCallSiteInfo(const MachineInstr *MI) { assert(MI->isCandidateForAdditionalCallInfo() && "Call site info refers only to call (MI) candidates"); - if (!Target.Options.EmitCallSiteInfo && !Target.Options.EmitCallGraphSection) + if (!Target.Options.EmitCallSiteInfo) return CallSitesInfo.end(); return CallSitesInfo.find(MI); } -- cgit v1.2.3