Skip to content

Commit

Permalink
[饾榾饾椊饾椏] changes introduced through rebase
Browse files Browse the repository at this point in the history
Created using spr 1.3.4

[skip ci]
  • Loading branch information
jroelofs committed Nov 28, 2023
1 parent 802e1c6 commit de74c62
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
1 change: 0 additions & 1 deletion llvm/include/llvm/CodeGen/AsmPrinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,6 @@ class AsmPrinter : public MachineFunctionPass {
virtual void emitGlobalIFunc(Module &M, const GlobalIFunc &GI);

private:

/// This method decides whether the specified basic block requires a label.
bool shouldEmitLabelForBasicBlock(const MachineBasicBlock &MBB) const;

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/IR/Verifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,6 @@ void Verifier::visitGlobalIFunc(const GlobalIFunc &GI) {
GlobalIFunc::getResolverFunctionType(GI.getValueType());
Check(ResolverTy == ResolverFuncTy->getPointerTo(GI.getAddressSpace()),
"IFunc resolver has incorrect type", &GI);

}

void Verifier::visitNamedMDNode(const NamedMDNode &NMD) {
Expand Down Expand Up @@ -2240,7 +2239,8 @@ void Verifier::verifyFunctionAttrs(FunctionType *FT, AttributeList Attrs,
}

// Check EVEX512 feature.
if (MaxParameterWidth >= 512 && Attrs.hasFnAttr("target-features") && TT.isX86()) {
if (MaxParameterWidth >= 512 && Attrs.hasFnAttr("target-features") &&
TT.isX86()) {
StringRef TF = Attrs.getFnAttr("target-features").getValueAsString();
Check(!TF.contains("+avx512f") || !TF.contains("-evex512"),
"512-bit vector arguments require 'evex512' for AVX512", V);
Expand Down
25 changes: 16 additions & 9 deletions llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,15 @@ using namespace llvm;

namespace {

enum class IFuncLowering { SymbolResolverIfSupported, SymbolResolverAlways, SymbolResolverNever };
enum class IFuncLowering {
SymbolResolverIfSupported,
SymbolResolverAlways,
SymbolResolverNever
};

static cl::opt<IFuncLowering> PreferredIFuncLowering(
"arm64-darwin-ifunc-symbol_resolver", cl::init(IFuncLowering::SymbolResolverNever),
"arm64-darwin-ifunc-symbol_resolver",
cl::init(IFuncLowering::SymbolResolverNever),
cl::desc("Pick the lowering for ifuncs on darwin platforms"), cl::Hidden,
cl::values(
clEnumValN(
Expand Down Expand Up @@ -1853,8 +1858,8 @@ void AArch64AsmPrinter::emitLinkerSymbolResolver(Module &M,
OutStreamer->emitSymbolAttribute(Name, MCSA_SymbolResolver);
emitVisibility(Name, GI.getVisibility());

// ld-prime does not seem to support aliases of symbol resolvers, so we have to
// tail call the resolver manually.
// ld-prime does not seem to support aliases of symbol resolvers, so we have
// to tail call the resolver manually.
OutStreamer->emitInstruction(
MCInstBuilder(AArch64::B)
.addOperand(MCOperand::createExpr(lowerConstant(GI.getResolver()))),
Expand Down Expand Up @@ -1887,8 +1892,9 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module &M,
assert(GI.hasLocalLinkage() && "Invalid ifunc linkage");
};

MCSymbol *LazyPointer = TM.getObjFileLowering()->getContext().getOrCreateSymbol(
"_" + GI.getName() + ".lazy_pointer");
MCSymbol *LazyPointer =
TM.getObjFileLowering()->getContext().getOrCreateSymbol(
"_" + GI.getName() + ".lazy_pointer");
MCSymbol *StubHelper =
TM.getObjFileLowering()->getContext().getOrCreateSymbol(
"_" + GI.getName() + ".stub_helper");
Expand Down Expand Up @@ -1943,9 +1949,10 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module &M,
}

OutStreamer->emitInstruction(MCInstBuilder(AArch64::LDRXui)
.addReg(AArch64::X16)
.addReg(AArch64::X16)
.addImm(0), *STI);
.addReg(AArch64::X16)
.addReg(AArch64::X16)
.addImm(0),
*STI);

OutStreamer->emitInstruction(MCInstBuilder(TM.getTargetTriple().isArm64e()
? AArch64::BRAAZ
Expand Down
2 changes: 2 additions & 0 deletions llvm/lib/Target/X86/X86AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,8 @@ void X86AsmPrinter::emitGlobalIFunc(Module &M, const GlobalIFunc &GI) {
JMP.setOpcode(X86::JMP_4);
JMP.addOperand(MCOperand::createExpr(lowerConstant(GI.getResolver())));
OutStreamer->emitInstruction(JMP, *Subtarget);

// FIXME: do the manual .symbol_resolver lowering that we did in AArch64AsmPrinter.
}

static bool printAsmMRegister(const X86AsmPrinter &P, const MachineOperand &MO,
Expand Down

0 comments on commit de74c62

Please sign in to comment.