[llvm] [AArch64] Implement -fno-plt for SelectionDAG/GlobalISel (PR #78890)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 14:27:45 PST 2024


================
@@ -144,9 +144,16 @@ bool CallLowering::lowerCall(MachineIRBuilder &MIRBuilder, const CallBase &CB,
   // Try looking through a bitcast from one function type to another.
   // Commonly happens with calls to objc_msgSend().
   const Value *CalleeV = CB.getCalledOperand()->stripPointerCasts();
-  if (const Function *F = dyn_cast<Function>(CalleeV))
-    Info.Callee = MachineOperand::CreateGA(F, 0);
-  else if (isa<GlobalIFunc>(CalleeV) || isa<GlobalAlias>(CalleeV)) {
+  if (const Function *F = dyn_cast<Function>(CalleeV)) {
+    if (F->hasFnAttribute(Attribute::NonLazyBind)) {
+      auto Reg =
+          MRI.createGenericVirtualRegister(getLLTForType(*F->getType(), DL));
+      MIRBuilder.buildGlobalValue(Reg, F);
----------------
MaskRay wrote:

Done in de93d8643072ee080aa26ecd9e952500cb39ab00 !

https://github.com/llvm/llvm-project/pull/78890


More information about the llvm-commits mailing list