[llvm] r374367 - [BPF] Remove relocation for patchable externs

Yonghong Song via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 10 08:33:09 PDT 2019


Author: yhs
Date: Thu Oct 10 08:33:09 2019
New Revision: 374367

URL: http://llvm.org/viewvc/llvm-project?rev=374367&view=rev
Log:
[BPF] Remove relocation for patchable externs

Previously, patchable extern relocations are introduced to patch
external variables used for multi versioning in
compile once, run everywhere use case. The load instruction
will be converted into a move with an patchable immediate
which can be changed by bpf loader on the host.

The kernel verifier has evolved and is able to load
and propagate constant values, so compiler relocation
becomes unnecessary. This patch removed codes related to this.

Differential Revision: https://reviews.llvm.org/D68760

Removed:
    llvm/trunk/test/CodeGen/BPF/CORE/patchable-extern-char.ll
    llvm/trunk/test/CodeGen/BPF/CORE/patchable-extern-uint.ll
    llvm/trunk/test/CodeGen/BPF/CORE/patchable-extern-ulonglong.ll
Modified:
    llvm/trunk/lib/Target/BPF/BPFAbstractMemberAccess.cpp
    llvm/trunk/lib/Target/BPF/BPFCORE.h
    llvm/trunk/lib/Target/BPF/BPFMISimplifyPatchable.cpp
    llvm/trunk/lib/Target/BPF/BTF.h
    llvm/trunk/lib/Target/BPF/BTFDebug.cpp
    llvm/trunk/lib/Target/BPF/BTFDebug.h
    llvm/trunk/test/CodeGen/BPF/BTF/binary-format.ll
    llvm/trunk/test/CodeGen/BPF/BTF/filename.ll
    llvm/trunk/test/CodeGen/BPF/BTF/func-func-ptr.ll
    llvm/trunk/test/CodeGen/BPF/BTF/func-non-void.ll
    llvm/trunk/test/CodeGen/BPF/BTF/func-source.ll
    llvm/trunk/test/CodeGen/BPF/BTF/func-typedef.ll
    llvm/trunk/test/CodeGen/BPF/BTF/func-unused-arg.ll
    llvm/trunk/test/CodeGen/BPF/BTF/func-void.ll
    llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-basic.ll
    llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll
    llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll
    llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll
    llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-union.ll

Modified: llvm/trunk/lib/Target/BPF/BPFAbstractMemberAccess.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/BPFAbstractMemberAccess.cpp?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/lib/Target/BPF/BPFAbstractMemberAccess.cpp (original)
+++ llvm/trunk/lib/Target/BPF/BPFAbstractMemberAccess.cpp Thu Oct 10 08:33:09 2019
@@ -93,8 +93,6 @@
 
 namespace llvm {
 const std::string BPFCoreSharedInfo::AmaAttr = "btf_ama";
-const std::string BPFCoreSharedInfo::PatchableExtSecName =
-    ".BPF.patchable_externs";
 } // namespace llvm
 
 using namespace llvm;

Modified: llvm/trunk/lib/Target/BPF/BPFCORE.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/BPFCORE.h?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/lib/Target/BPF/BPFCORE.h (original)
+++ llvm/trunk/lib/Target/BPF/BPFCORE.h Thu Oct 10 08:33:09 2019
@@ -23,10 +23,8 @@ public:
 
     MAX_FIELD_RELOC_KIND,
   };
-  /// The attribute attached to globals representing a member offset
+  /// The attribute attached to globals representing a field access
   static const std::string AmaAttr;
-  /// The section name to identify a patchable external global
-  static const std::string PatchableExtSecName;
 };
 
 } // namespace llvm

Modified: llvm/trunk/lib/Target/BPF/BPFMISimplifyPatchable.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/BPFMISimplifyPatchable.cpp?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/lib/Target/BPF/BPFMISimplifyPatchable.cpp (original)
+++ llvm/trunk/lib/Target/BPF/BPFMISimplifyPatchable.cpp Thu Oct 10 08:33:09 2019
@@ -11,19 +11,15 @@
 //    ldd r2, r1, 0
 //    add r3, struct_base_reg, r2
 //
-// Here @global should either present a AMA (abstruct member access) or
-// a patchable extern variable. And these two kinds of accesses
-// are subject to bpf load time patching. After this pass, the
+// Here @global should represent an AMA (abstruct member access).
+// Such an access is subject to bpf load time patching. After this pass, the
 // code becomes
 //    ld_imm64 r1, @global
 //    add r3, struct_base_reg, r1
 //
 // Eventually, at BTF output stage, a relocation record will be generated
 // for ld_imm64 which should be replaced later by bpf loader:
-//    r1 = <calculated offset> or <to_be_patched_extern_val>
-//    add r3, struct_base_reg, r1
-// or
-//    ld_imm64 r1, <to_be_patched_extern_val>
+//    r1 = <calculated field_info>
 //    add r3, struct_base_reg, r1
 //
 //===----------------------------------------------------------------------===//
@@ -120,15 +116,6 @@ bool BPFMISimplifyPatchable::removeLD()
             if (GVar->hasAttribute(BPFCoreSharedInfo::AmaAttr)) {
               assert(ImmVal == 0);
               IsCandidate = true;
-            } else if (!GVar->hasInitializer() && GVar->hasExternalLinkage() &&
-                       GVar->getSection() ==
-                           BPFCoreSharedInfo::PatchableExtSecName) {
-              if (ImmVal == 0)
-                IsCandidate = true;
-              else
-                errs() << "WARNING: unhandled patchable extern "
-                       << GVar->getName() << " with load offset " << ImmVal
-                       << "\n";
             }
           }
         }

Modified: llvm/trunk/lib/Target/BPF/BTF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/BTF.h?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/lib/Target/BPF/BTF.h (original)
+++ llvm/trunk/lib/Target/BPF/BTF.h Thu Oct 10 08:33:09 2019
@@ -39,13 +39,6 @@
 ///   struct SecFieldReloc for ELF section #2
 ///   A number of struct BPFFieldReloc for ELF section #2
 ///   ...
-/// The ExternReloc subsection is defined as below:
-///   BPFExternReloc Size
-///   struct SecExternReloc for ELF section #1
-///   A number of struct BPFExternReloc for ELF section #1
-///   struct SecExternReloc for ELF section #2
-///   A number of struct BPFExternReloc for ELF section #2
-///   ...
 ///
 /// The section formats are also defined at
 ///    https://github.com/torvalds/linux/blob/master/include/uapi/linux/btf.h
@@ -63,7 +56,7 @@ enum : uint32_t { MAGIC = 0xeB9F, VERSIO
 /// Sizes in bytes of various things in the BTF format.
 enum {
   HeaderSize = 24,
-  ExtHeaderSize = 40,
+  ExtHeaderSize = 32,
   CommonTypeSize = 12,
   BTFArraySize = 12,
   BTFEnumSize = 8,
@@ -73,11 +66,9 @@ enum {
   SecFuncInfoSize = 8,
   SecLineInfoSize = 8,
   SecFieldRelocSize = 8,
-  SecExternRelocSize = 8,
   BPFFuncInfoSize = 8,
   BPFLineInfoSize = 16,
   BPFFieldRelocSize = 16,
-  BPFExternRelocSize = 8,
 };
 
 /// The .BTF section header definition.
@@ -215,8 +206,6 @@ struct ExtHeader {
   uint32_t LineInfoLen;    ///< Length of line info section
   uint32_t FieldRelocOff; ///< Offset of offset reloc section
   uint32_t FieldRelocLen; ///< Length of offset reloc section
-  uint32_t ExternRelocOff; ///< Offset of extern reloc section
-  uint32_t ExternRelocLen; ///< Length of extern reloc section
 };
 
 /// Specifying one function info.
@@ -260,18 +249,6 @@ struct SecFieldReloc {
   uint32_t NumFieldReloc; ///< Number of offset reloc's in this section
 };
 
-/// Specifying one offset relocation.
-struct BPFExternReloc {
-  uint32_t InsnOffset;    ///< Byte offset in this section
-  uint32_t ExternNameOff; ///< The string for external variable
-};
-
-/// Specifying extern relocation's in one section.
-struct SecExternReloc {
-  uint32_t SecNameOff;     ///< Section name index in the .BTF string table
-  uint32_t NumExternReloc; ///< Number of extern reloc's in this section
-};
-
 } // End namespace BTF.
 } // End namespace llvm.
 

Modified: llvm/trunk/lib/Target/BPF/BTFDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/BTFDebug.cpp?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/lib/Target/BPF/BTFDebug.cpp (original)
+++ llvm/trunk/lib/Target/BPF/BTFDebug.cpp Thu Oct 10 08:33:09 2019
@@ -752,9 +752,10 @@ void BTFDebug::emitBTFSection() {
 }
 
 void BTFDebug::emitBTFExtSection() {
-  // Do not emit section if empty FuncInfoTable and LineInfoTable.
+  // Do not emit section if empty FuncInfoTable and LineInfoTable
+  // and FieldRelocTable.
   if (!FuncInfoTable.size() && !LineInfoTable.size() &&
-      !FieldRelocTable.size() && !ExternRelocTable.size())
+      !FieldRelocTable.size())
     return;
 
   MCContext &Ctx = OS.getContext();
@@ -766,8 +767,8 @@ void BTFDebug::emitBTFExtSection() {
 
   // Account for FuncInfo/LineInfo record size as well.
   uint32_t FuncLen = 4, LineLen = 4;
-  // Do not account for optional FieldReloc/ExternReloc.
-  uint32_t FieldRelocLen = 0, ExternRelocLen = 0;
+  // Do not account for optional FieldReloc.
+  uint32_t FieldRelocLen = 0;
   for (const auto &FuncSec : FuncInfoTable) {
     FuncLen += BTF::SecFuncInfoSize;
     FuncLen += FuncSec.second.size() * BTF::BPFFuncInfoSize;
@@ -780,15 +781,9 @@ void BTFDebug::emitBTFExtSection() {
     FieldRelocLen += BTF::SecFieldRelocSize;
     FieldRelocLen += FieldRelocSec.second.size() * BTF::BPFFieldRelocSize;
   }
-  for (const auto &ExternRelocSec : ExternRelocTable) {
-    ExternRelocLen += BTF::SecExternRelocSize;
-    ExternRelocLen += ExternRelocSec.second.size() * BTF::BPFExternRelocSize;
-  }
 
   if (FieldRelocLen)
     FieldRelocLen += 4;
-  if (ExternRelocLen)
-    ExternRelocLen += 4;
 
   OS.EmitIntValue(0, 4);
   OS.EmitIntValue(FuncLen, 4);
@@ -796,8 +791,6 @@ void BTFDebug::emitBTFExtSection() {
   OS.EmitIntValue(LineLen, 4);
   OS.EmitIntValue(FuncLen + LineLen, 4);
   OS.EmitIntValue(FieldRelocLen, 4);
-  OS.EmitIntValue(FuncLen + LineLen + FieldRelocLen, 4);
-  OS.EmitIntValue(ExternRelocLen, 4);
 
   // Emit func_info table.
   OS.AddComment("FuncInfo");
@@ -848,22 +841,6 @@ void BTFDebug::emitBTFExtSection() {
       }
     }
   }
-
-  // Emit extern reloc table.
-  if (ExternRelocLen) {
-    OS.AddComment("ExternReloc");
-    OS.EmitIntValue(BTF::BPFExternRelocSize, 4);
-    for (const auto &ExternRelocSec : ExternRelocTable) {
-      OS.AddComment("Extern reloc section string offset=" +
-                    std::to_string(ExternRelocSec.first));
-      OS.EmitIntValue(ExternRelocSec.first, 4);
-      OS.EmitIntValue(ExternRelocSec.second.size(), 4);
-      for (const auto &ExternRelocInfo : ExternRelocSec.second) {
-        Asm->EmitLabelReference(ExternRelocInfo.Label, 4);
-        OS.EmitIntValue(ExternRelocInfo.ExternNameOff, 4);
-      }
-    }
-  }
 }
 
 void BTFDebug::beginFunctionImpl(const MachineFunction *MF) {
@@ -1019,15 +996,6 @@ void BTFDebug::processLDimm64(const Mach
       MDNode *MDN = GVar->getMetadata(LLVMContext::MD_preserve_access_index);
       DIType *Ty = dyn_cast<DIType>(MDN);
       generateFieldReloc(MI, ORSym, Ty, GVar->getName());
-    } else if (GVar && !GVar->hasInitializer() && GVar->hasExternalLinkage() &&
-               GVar->getSection() == BPFCoreSharedInfo::PatchableExtSecName) {
-      MCSymbol *ORSym = OS.getContext().createTempSymbol();
-      OS.EmitLabel(ORSym);
-
-      BTFExternReloc ExternReloc;
-      ExternReloc.Label = ORSym;
-      ExternReloc.ExternNameOff = addString(GVar->getName());
-      ExternRelocTable[SecNameOff].push_back(ExternReloc);
     }
   }
 }
@@ -1165,20 +1133,6 @@ bool BTFDebug::InstLower(const MachineIn
         OutMI.addOperand(MCOperand::createReg(MI->getOperand(0).getReg()));
         OutMI.addOperand(MCOperand::createImm(Imm));
         return true;
-      } else if (GVar && !GVar->hasInitializer() &&
-                 GVar->hasExternalLinkage() &&
-                 GVar->getSection() == BPFCoreSharedInfo::PatchableExtSecName) {
-        const IntegerType *IntTy = dyn_cast<IntegerType>(GVar->getValueType());
-        assert(IntTy);
-        // For patchable externals, emit "LD_imm64, ri, 0" if the external
-        // variable is 64bit width, emit "mov ri, 0" otherwise.
-        if (IntTy->getBitWidth() == 64)
-          OutMI.setOpcode(BPF::LD_imm64);
-        else
-          OutMI.setOpcode(BPF::MOV_ri);
-        OutMI.addOperand(MCOperand::createReg(MI->getOperand(0).getReg()));
-        OutMI.addOperand(MCOperand::createImm(0));
-        return true;
       }
     }
   }

Modified: llvm/trunk/lib/Target/BPF/BTFDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/BTFDebug.h?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/lib/Target/BPF/BTFDebug.h (original)
+++ llvm/trunk/lib/Target/BPF/BTFDebug.h Thu Oct 10 08:33:09 2019
@@ -231,12 +231,6 @@ struct BTFFieldReloc {
   uint32_t RelocKind;     ///< What to patch the instruction
 };
 
-/// Represent one extern relocation.
-struct BTFExternReloc {
-  const MCSymbol *Label;  ///< MCSymbol identifying insn for the reloc
-  uint32_t ExternNameOff; ///< The extern variable name
-};
-
 /// Collect and emit BTF information.
 class BTFDebug : public DebugHandlerBase {
   MCStreamer &OS;
@@ -251,7 +245,6 @@ class BTFDebug : public DebugHandlerBase
   std::map<uint32_t, std::vector<BTFFuncInfo>> FuncInfoTable;
   std::map<uint32_t, std::vector<BTFLineInfo>> LineInfoTable;
   std::map<uint32_t, std::vector<BTFFieldReloc>> FieldRelocTable;
-  std::map<uint32_t, std::vector<BTFExternReloc>> ExternRelocTable;
   StringMap<std::vector<std::string>> FileContent;
   std::map<std::string, std::unique_ptr<BTFKindDataSec>> DataSecEntries;
   std::vector<BTFTypeStruct *> StructTypes;

Modified: llvm/trunk/test/CodeGen/BPF/BTF/binary-format.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/BPF/BTF/binary-format.ll?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/BPF/BTF/binary-format.ll (original)
+++ llvm/trunk/test/CodeGen/BPF/BTF/binary-format.ll Thu Oct 10 08:33:09 2019
@@ -28,20 +28,18 @@ entry:
 ; CHECK:    0x00000060 696e7420 6628696e 74206129 207b2072
 ; CHECK:    0x00000070 65747572 6e20613b 207d00
 ; CHECK:    '.BTF.ext'
-; CHECK-EL: 0x00000000 9feb0100 28000000 00000000 14000000
+; CHECK-EL: 0x00000000 9feb0100 20000000 00000000 14000000
 ; CHECK-EL: 0x00000010 14000000 2c000000 40000000 00000000
-; CHECK-EL: 0x00000020 40000000 00000000 08000000 09000000
-; CHECK-EL: 0x00000030 01000000 00000000 03000000 10000000
-; CHECK-EL: 0x00000040 09000000 02000000 00000000 0f000000
-; CHECK-EL: 0x00000050 18000000 00040000 08000000 0f000000
-; CHECK-EL: 0x00000060 18000000 10040000
-; CHECK-EB: 0x00000000 eb9f0100 00000028 00000000 00000014
+; CHECK-EL: 0x00000020 08000000 09000000 01000000 00000000
+; CHECK-EL: 0x00000030 03000000 10000000 09000000 02000000
+; CHECK-EL: 0x00000040 00000000 0f000000 18000000 00040000
+; CHECK-EL: 0x00000050 08000000 0f000000 18000000 10040000
+; CHECK-EB: 0x00000000 eb9f0100 00000020 00000000 00000014
 ; CHECK-EB: 0x00000010 00000014 0000002c 00000040 00000000
-; CHECK-EB: 0x00000020 00000040 00000000 00000008 00000009
-; CHECK-EB: 0x00000030 00000001 00000000 00000003 00000010
-; CHECK-EB: 0x00000040 00000009 00000002 00000000 0000000f
-; CHECK-EB: 0x00000050 00000018 00000400 00000008 0000000f
-; CHECK-EB: 0x00000060 00000018 00000410
+; CHECK-EB: 0x00000020 00000008 00000009 00000001 00000000
+; CHECK-EB: 0x00000030 00000003 00000010 00000009 00000002
+; CHECK-EB: 0x00000040 00000000 0000000f 00000018 00000400
+; CHECK-EB: 0x00000050 00000008 0000000f 00000018 00000410
 
 ; Function Attrs: nounwind readnone speculatable
 declare void @llvm.dbg.value(metadata, metadata, metadata) #1

Modified: llvm/trunk/test/CodeGen/BPF/BTF/filename.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/BPF/BTF/filename.ll?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/BPF/BTF/filename.ll (original)
+++ llvm/trunk/test/CodeGen/BPF/BTF/filename.ll Thu Oct 10 08:33:09 2019
@@ -43,15 +43,13 @@ define dso_local i32 @test() local_unnam
 ; CHECK-NEXT:        .short  60319                   # 0xeb9f
 ; CHECK-NEXT:        .byte   1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   40
+; CHECK-NEXT:        .long   32
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   28
 ; CHECK-NEXT:        .long   48
 ; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   48
-; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   8                       # FuncInfo
 ; CHECK-NEXT:        .long   10                      # FuncInfo section string offset=10
 ; CHECK-NEXT:        .long   1

Modified: llvm/trunk/test/CodeGen/BPF/BTF/func-func-ptr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/BPF/BTF/func-func-ptr.ll?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/BPF/BTF/func-func-ptr.ll (original)
+++ llvm/trunk/test/CodeGen/BPF/BTF/func-func-ptr.ll Thu Oct 10 08:33:09 2019
@@ -74,15 +74,13 @@ entry:
 ; CHECK-NEXT:        .short  60319                   # 0xeb9f
 ; CHECK-NEXT:        .byte   1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   40
+; CHECK-NEXT:        .long   32
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   28
 ; CHECK-NEXT:        .long   48
 ; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   48
-; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   8                       # FuncInfo
 ; CHECK-NEXT:        .long   11                      # FuncInfo section string offset=11
 ; CHECK-NEXT:        .long   1

Modified: llvm/trunk/test/CodeGen/BPF/BTF/func-non-void.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/BPF/BTF/func-non-void.ll?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/BPF/BTF/func-non-void.ll (original)
+++ llvm/trunk/test/CodeGen/BPF/BTF/func-non-void.ll Thu Oct 10 08:33:09 2019
@@ -48,15 +48,13 @@ define dso_local i32 @f1(i32 returned) l
 ; CHECK-NEXT:        .short  60319                   # 0xeb9f
 ; CHECK-NEXT:        .byte   1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   40
+; CHECK-NEXT:        .long   32
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   44
 ; CHECK-NEXT:        .long   64
 ; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   64
-; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   8                       # FuncInfo
 ; CHECK-NEXT:        .long   11                      # FuncInfo section string offset=11
 ; CHECK-NEXT:        .long   1

Modified: llvm/trunk/test/CodeGen/BPF/BTF/func-source.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/BPF/BTF/func-source.ll?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/BPF/BTF/func-source.ll (original)
+++ llvm/trunk/test/CodeGen/BPF/BTF/func-source.ll Thu Oct 10 08:33:09 2019
@@ -43,15 +43,13 @@ entry:
 ; CHECK-NEXT:        .short  60319                   # 0xeb9f
 ; CHECK-NEXT:        .byte   1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   40
+; CHECK-NEXT:        .long   32
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   28
 ; CHECK-NEXT:        .long   48
 ; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   48
-; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   8                       # FuncInfo
 ; CHECK-NEXT:        .long   3                       # FuncInfo section string offset=3
 ; CHECK-NEXT:        .long   1

Modified: llvm/trunk/test/CodeGen/BPF/BTF/func-typedef.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/BPF/BTF/func-typedef.ll?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/BPF/BTF/func-typedef.ll (original)
+++ llvm/trunk/test/CodeGen/BPF/BTF/func-typedef.ll Thu Oct 10 08:33:09 2019
@@ -61,15 +61,13 @@ entry:
 ; CHECK-NEXT:        .short  60319                   # 0xeb9f
 ; CHECK-NEXT:        .byte   1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   40
+; CHECK-NEXT:        .long   32
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   44
 ; CHECK-NEXT:        .long   64
 ; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   64
-; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   8                       # FuncInfo
 ; CHECK-NEXT:        .long   20                      # FuncInfo section string offset=20
 ; CHECK-NEXT:        .long   1

Modified: llvm/trunk/test/CodeGen/BPF/BTF/func-unused-arg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/BPF/BTF/func-unused-arg.ll?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/BPF/BTF/func-unused-arg.ll (original)
+++ llvm/trunk/test/CodeGen/BPF/BTF/func-unused-arg.ll Thu Oct 10 08:33:09 2019
@@ -48,15 +48,13 @@ define dso_local i32 @f1(i32) local_unna
 ; CHECK-NEXT:        .short  60319                   # 0xeb9f
 ; CHECK-NEXT:        .byte   1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   40
+; CHECK-NEXT:        .long   32
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   28
 ; CHECK-NEXT:        .long   48
 ; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   48
-; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   8                       # FuncInfo
 ; CHECK-NEXT:        .long   11                      # FuncInfo section string offset=11
 ; CHECK-NEXT:        .long   1

Modified: llvm/trunk/test/CodeGen/BPF/BTF/func-void.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/BPF/BTF/func-void.ll?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/BPF/BTF/func-void.ll (original)
+++ llvm/trunk/test/CodeGen/BPF/BTF/func-void.ll Thu Oct 10 08:33:09 2019
@@ -37,15 +37,13 @@ define dso_local void @f1() local_unname
 ; CHECK-NEXT:        .short  60319                   # 0xeb9f
 ; CHECK-NEXT:        .byte   1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   40
+; CHECK-NEXT:        .long   32
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   28
 ; CHECK-NEXT:        .long   48
 ; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   48
-; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   8                       # FuncInfo
 ; CHECK-NEXT:        .long   4                       # FuncInfo section string offset=4
 ; CHECK-NEXT:        .long   1

Modified: llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-basic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-basic.ll?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-basic.ll (original)
+++ llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-basic.ll Thu Oct 10 08:33:09 2019
@@ -103,21 +103,19 @@ define dso_local i32 @bpf_prog(%struct.s
 ; CHECK-NEXT:        .short  60319                   # 0xeb9f
 ; CHECK-NEXT:        .byte   1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   40
+; CHECK-NEXT:        .long   32
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   124
 ; CHECK-NEXT:        .long   144
 ; CHECK-NEXT:        .long   28
-; CHECK-NEXT:        .long   172
-; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   8                       # FuncInfo
 
 ; CHECK:             .long   16                      # FieldReloc
 ; CHECK-NEXT:        .long   43                      # Field reloc section string offset=43
 ; CHECK-NEXT:        .long   1
-; CHECK-NEXT:        .long   .Ltmp2
+; CHECK-NEXT:        .long   .Ltmp{{[0-9]+}}
 ; CHECK-NEXT:        .long   2
 ; CHECK-NEXT:        .long   86
 ; CHECK-NEXT:        .long   0

Modified: llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll (original)
+++ llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll Thu Oct 10 08:33:09 2019
@@ -111,21 +111,19 @@ define dso_local i32 @bpf_prog(%struct.s
 ; CHECK-NEXT:        .short  60319                   # 0xeb9f
 ; CHECK-NEXT:        .byte   1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   40
+; CHECK-NEXT:        .long   32
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   76
 ; CHECK-NEXT:        .long   96
 ; CHECK-NEXT:        .long   28
-; CHECK-NEXT:        .long   124
-; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   8                       # FuncInfo
 
 ; CHECK:             .long   16                      # FieldReloc
 ; CHECK-NEXT:        .long   57                      # Field reloc section string offset=57
 ; CHECK-NEXT:        .long   1
-; CHECK-NEXT:        .long   .Ltmp2
+; CHECK-NEXT:        .long   .Ltmp{{[0-9]+}}
 ; CHECK-NEXT:        .long   2
 ; CHECK-NEXT:        .long   100
 ; CHECK-NEXT:        .long   0

Modified: llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll (original)
+++ llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll Thu Oct 10 08:33:09 2019
@@ -121,15 +121,13 @@ define dso_local i32 @bpf_prog(%struct.s
 ; CHECK-NEXT:        .short  60319                   # 0xeb9f
 ; CHECK-NEXT:        .byte   1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   40
+; CHECK-NEXT:        .long   32
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   76
 ; CHECK-NEXT:        .long   96
 ; CHECK-NEXT:        .long   28
-; CHECK-NEXT:        .long   124
-; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   8                       # FuncInfo
 
 ; CHECK:             .long   16                      # FieldReloc

Modified: llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll (original)
+++ llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll Thu Oct 10 08:33:09 2019
@@ -124,21 +124,19 @@ define dso_local i32 @bpf_prog(%struct.s
 ; CHECK-NEXT:        .short  60319                   # 0xeb9f
 ; CHECK-NEXT:        .byte   1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   40
+; CHECK-NEXT:        .long   32
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   76
 ; CHECK-NEXT:        .long   96
 ; CHECK-NEXT:        .long   28
-; CHECK-NEXT:        .long   124
-; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   8                       # FuncInfo
 
 ; CHECK:             .long   16                      # FieldReloc
 ; CHECK-NEXT:        .long   77                      # Field reloc section string offset=77
 ; CHECK-NEXT:        .long   1
-; CHECK-NEXT:        .long   .Ltmp2
+; CHECK-NEXT:        .long   .Ltmp{{[0-9]+}}
 ; CHECK-NEXT:        .long   2
 ; CHECK-NEXT:        .long   120
 ; CHECK-NEXT:        .long   0

Modified: llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-union.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-union.ll?rev=374367&r1=374366&r2=374367&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-union.ll (original)
+++ llvm/trunk/test/CodeGen/BPF/CORE/offset-reloc-union.ll Thu Oct 10 08:33:09 2019
@@ -127,21 +127,19 @@ define dso_local i32 @bpf_prog(%union.sk
 ; CHECK-NEXT:        .short  60319                   # 0xeb9f
 ; CHECK-NEXT:        .byte   1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   40
+; CHECK-NEXT:        .long   32
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   20
 ; CHECK-NEXT:        .long   76
 ; CHECK-NEXT:        .long   96
 ; CHECK-NEXT:        .long   28
-; CHECK-NEXT:        .long   124
-; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   8                       # FuncInfo
 
 ; CHECK:             .long   16                      # FieldReloc
 ; CHECK-NEXT:        .long   54                      # Field reloc section string offset=54
 ; CHECK-NEXT:        .long   1
-; CHECK-NEXT:        .long   .Ltmp2
+; CHECK-NEXT:        .long   .Ltmp{{[0-9]+}}
 ; CHECK-NEXT:        .long   2
 ; CHECK-NEXT:        .long   97
 ; CHECK-NEXT:        .long   0

Removed: llvm/trunk/test/CodeGen/BPF/CORE/patchable-extern-char.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/BPF/CORE/patchable-extern-char.ll?rev=374366&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/BPF/CORE/patchable-extern-char.ll (original)
+++ llvm/trunk/test/CodeGen/BPF/CORE/patchable-extern-char.ll (removed)
@@ -1,107 +0,0 @@
-; RUN: llc -march=bpfel -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
-; RUN: llc -march=bpfeb -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
-; Source code:
-;   extern __attribute__((section(".BPF.patchable_externs"))) char a;
-;   int foo() { return a; }
-; Compilation flag:
-;   clang -target bpf -O2 -g -S -emit-llvm test.c
-
- at a = external dso_local local_unnamed_addr global i8, section ".BPF.patchable_externs", align 1
-
-; Function Attrs: norecurse nounwind readonly
-define dso_local i32 @foo() local_unnamed_addr #0 !dbg !7 {
-  %1 = load i8, i8* @a, align 1, !dbg !11, !tbaa !12
-  %2 = sext i8 %1 to i32, !dbg !11
-; CHECK:             r0 = 0
-; CHECK-NEXT:        r0 <<= 56
-; CHECK-NEXT:        r0 s>>= 56
-  ret i32 %2, !dbg !15
-}
-
-; CHECK:             .section        .BTF,"", at progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   40
-; CHECK-NEXT:        .long   40
-; CHECK-NEXT:        .long   54
-; CHECK-NEXT:        .long   0                       # BTF_KIND_FUNC_PROTO(id = 1)
-; CHECK-NEXT:        .long   218103808               # 0xd000000
-; CHECK-NEXT:        .long   2
-; CHECK-NEXT:        .long   1                       # BTF_KIND_INT(id = 2)
-; CHECK-NEXT:        .long   16777216                # 0x1000000
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   16777248                # 0x1000020
-; CHECK-NEXT:        .long   5                       # BTF_KIND_FUNC(id = 3)
-; CHECK-NEXT:        .long   201326592               # 0xc000000
-; CHECK-NEXT:        .long   1
-; CHECK-NEXT:        .byte   0                       # string offset=0
-; CHECK-NEXT:        .ascii  "int"                   # string offset=1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .ascii  "foo"                   # string offset=5
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .ascii  ".text"                 # string offset=9
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .byte   97                      # string offset=15
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .ascii  "/tmp/home/yhs/work/tests/llvm/test.c" # string offset=17
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"", at progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   40
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   20
-; CHECK-NEXT:        .long   20
-; CHECK-NEXT:        .long   44
-; CHECK-NEXT:        .long   64
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   64
-; CHECK-NEXT:        .long   20
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   9                       # FuncInfo section string offset=9
-; CHECK-NEXT:        .long   1
-; CHECK-NEXT:        .long   .Lfunc_begin0
-; CHECK-NEXT:        .long   3
-; CHECK-NEXT:        .long   16                      # LineInfo
-; CHECK-NEXT:        .long   9                       # LineInfo section string offset=9
-; CHECK-NEXT:        .long   2
-; CHECK-NEXT:        .long   .Ltmp{{[0-9]+}}
-; CHECK-NEXT:        .long   17
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   2068                    # Line 2 Col 20
-; CHECK-NEXT:        .long   .Ltmp{{[0-9]+}}
-; CHECK-NEXT:        .long   17
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   2061                    # Line 2 Col 13
-; CHECK-NEXT:        .long   8                       # ExternReloc
-; CHECK-NEXT:        .long   9                       # Extern reloc section string offset=9
-; CHECK-NEXT:        .long   1
-; CHECK-NEXT:        .long   .Ltmp{{[0-9]+}}
-; CHECK-NEXT:        .long   15
-
-attributes #0 = { norecurse nounwind readonly "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
-
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!3, !4, !5}
-!llvm.ident = !{!6}
-
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 8.0.20181009 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
-!1 = !DIFile(filename: "test.c", directory: "/tmp/home/yhs/work/tests/llvm")
-!2 = !{}
-!3 = !{i32 2, !"Dwarf Version", i32 4}
-!4 = !{i32 2, !"Debug Info Version", i32 3}
-!5 = !{i32 1, !"wchar_size", i32 4}
-!6 = !{!"clang version 8.0.20181009 "}
-!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: true, unit: !0, retainedNodes: !2)
-!8 = !DISubroutineType(types: !9)
-!9 = !{!10}
-!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-!11 = !DILocation(line: 2, column: 20, scope: !7)
-!12 = !{!13, !13, i64 0}
-!13 = !{!"omnipotent char", !14, i64 0}
-!14 = !{!"Simple C/C++ TBAA"}
-!15 = !DILocation(line: 2, column: 13, scope: !7)

Removed: llvm/trunk/test/CodeGen/BPF/CORE/patchable-extern-uint.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/BPF/CORE/patchable-extern-uint.ll?rev=374366&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/BPF/CORE/patchable-extern-uint.ll (original)
+++ llvm/trunk/test/CodeGen/BPF/CORE/patchable-extern-uint.ll (removed)
@@ -1,102 +0,0 @@
-; RUN: llc -march=bpfel -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
-; RUN: llc -march=bpfeb -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
-; Source code:
-;   extern __attribute__((section(".BPF.patchable_externs"))) unsigned a;
-;   int foo() { return a; }
-; Compilation flag:
-;   clang -target bpf -O2 -g -S -emit-llvm test.c
-
- at a = external dso_local local_unnamed_addr global i32, section ".BPF.patchable_externs", align 4
-
-; Function Attrs: norecurse nounwind readonly
-define dso_local i32 @foo() local_unnamed_addr #0 !dbg !7 {
-  %1 = load i32, i32* @a, align 4, !dbg !11, !tbaa !12
-; CHECK:             r0 = 0
-; CHECK-NEXT:        exit
-  ret i32 %1, !dbg !16
-}
-
-; CHECK:             .section        .BTF,"", at progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   40
-; CHECK-NEXT:        .long   40
-; CHECK-NEXT:        .long   49
-; CHECK-NEXT:        .long   0                       # BTF_KIND_FUNC_PROTO(id = 1)
-; CHECK-NEXT:        .long   218103808               # 0xd000000
-; CHECK-NEXT:        .long   2
-; CHECK-NEXT:        .long   1                       # BTF_KIND_INT(id = 2)
-; CHECK-NEXT:        .long   16777216                # 0x1000000
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   16777248                # 0x1000020
-; CHECK-NEXT:        .long   5                       # BTF_KIND_FUNC(id = 3)
-; CHECK-NEXT:        .long   201326592               # 0xc000000
-; CHECK-NEXT:        .long   1
-; CHECK-NEXT:        .byte   0                       # string offset=0
-; CHECK-NEXT:        .ascii  "int"                   # string offset=1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .ascii  "foo"                   # string offset=5
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .ascii  ".text"                 # string offset=9
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .byte   97                      # string offset=15
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .ascii  "/tmp/yhs/work/tests/llvm/test.c" # string offset=17
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"", at progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   40
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   20
-; CHECK-NEXT:        .long   20
-; CHECK-NEXT:        .long   28
-; CHECK-NEXT:        .long   48
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   48
-; CHECK-NEXT:        .long   20
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   9                       # FuncInfo section string offset=9
-; CHECK-NEXT:        .long   1
-; CHECK-NEXT:        .long   .Lfunc_begin0
-; CHECK-NEXT:        .long   3
-; CHECK-NEXT:        .long   16                      # LineInfo
-; CHECK-NEXT:        .long   9                       # LineInfo section string offset=9
-; CHECK-NEXT:        .long   1
-; CHECK-NEXT:        .long   .Ltmp{{[0-9]+}}
-; CHECK-NEXT:        .long   17
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   2061                    # Line 2 Col 13
-; CHECK-NEXT:        .long   8                       # ExternReloc
-; CHECK-NEXT:        .long   9                       # Extern reloc section string offset=9
-; CHECK-NEXT:        .long   1
-; CHECK-NEXT:        .long   .Ltmp{{[0-9]+}}
-; CHECK-NEXT:        .long   15
-
-attributes #0 = { norecurse nounwind readonly "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
-
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!3, !4, !5}
-!llvm.ident = !{!6}
-
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 8.0.20181009 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
-!1 = !DIFile(filename: "test.c", directory: "/tmp/yhs/work/tests/llvm")
-!2 = !{}
-!3 = !{i32 2, !"Dwarf Version", i32 4}
-!4 = !{i32 2, !"Debug Info Version", i32 3}
-!5 = !{i32 1, !"wchar_size", i32 4}
-!6 = !{!"clang version 8.0.20181009 "}
-!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: true, unit: !0, retainedNodes: !2)
-!8 = !DISubroutineType(types: !9)
-!9 = !{!10}
-!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-!11 = !DILocation(line: 2, column: 20, scope: !7)
-!12 = !{!13, !13, i64 0}
-!13 = !{!"int", !14, i64 0}
-!14 = !{!"omnipotent char", !15, i64 0}
-!15 = !{!"Simple C/C++ TBAA"}
-!16 = !DILocation(line: 2, column: 13, scope: !7)

Removed: llvm/trunk/test/CodeGen/BPF/CORE/patchable-extern-ulonglong.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/BPF/CORE/patchable-extern-ulonglong.ll?rev=374366&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/BPF/CORE/patchable-extern-ulonglong.ll (original)
+++ llvm/trunk/test/CodeGen/BPF/CORE/patchable-extern-ulonglong.ll (removed)
@@ -1,103 +0,0 @@
-; RUN: llc -march=bpfel -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
-; RUN: llc -march=bpfeb -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
-; Source code:
-;   extern __attribute__((section(".BPF.patchable_externs"))) unsigned long long a;
-;   int foo() { return a; }
-; Compilation flag:
-;   clang -target bpf -O2 -g -S -emit-llvm test.c
-
- at a = external dso_local local_unnamed_addr global i64, section ".BPF.patchable_externs", align 8
-
-; Function Attrs: norecurse nounwind readonly
-define dso_local i32 @foo() local_unnamed_addr #0 !dbg !7 {
-  %1 = load i64, i64* @a, align 8, !dbg !11, !tbaa !12
-  %2 = trunc i64 %1 to i32, !dbg !11
-; CHECK:             r0 = 0 ll
-; CHECK-NEXT:        exit
-  ret i32 %2, !dbg !16
-}
-
-; CHECK:             .section        .BTF,"", at progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   40
-; CHECK-NEXT:        .long   40
-; CHECK-NEXT:        .long   54
-; CHECK-NEXT:        .long   0                       # BTF_KIND_FUNC_PROTO(id = 1)
-; CHECK-NEXT:        .long   218103808               # 0xd000000
-; CHECK-NEXT:        .long   2
-; CHECK-NEXT:        .long   1                       # BTF_KIND_INT(id = 2)
-; CHECK-NEXT:        .long   16777216                # 0x1000000
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   16777248                # 0x1000020
-; CHECK-NEXT:        .long   5                       # BTF_KIND_FUNC(id = 3)
-; CHECK-NEXT:        .long   201326592               # 0xc000000
-; CHECK-NEXT:        .long   1
-; CHECK-NEXT:        .byte   0                       # string offset=0
-; CHECK-NEXT:        .ascii  "int"                   # string offset=1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .ascii  "foo"                   # string offset=5
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .ascii  ".text"                 # string offset=9
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .byte   97                      # string offset=15
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .ascii  "/tmp/home/yhs/work/tests/llvm/test.c" # string offset=17
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"", at progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   40
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   20
-; CHECK-NEXT:        .long   20
-; CHECK-NEXT:        .long   28
-; CHECK-NEXT:        .long   48
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   48
-; CHECK-NEXT:        .long   20
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   9                       # FuncInfo section string offset=9
-; CHECK-NEXT:        .long   1
-; CHECK-NEXT:        .long   .Lfunc_begin0
-; CHECK-NEXT:        .long   3
-; CHECK-NEXT:        .long   16                      # LineInfo
-; CHECK-NEXT:        .long   9                       # LineInfo section string offset=9
-; CHECK-NEXT:        .long   1
-; CHECK-NEXT:        .long   .Ltmp{{[0-9]+}}
-; CHECK-NEXT:        .long   17
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   2061                    # Line 2 Col 13
-; CHECK-NEXT:        .long   8                       # ExternReloc
-; CHECK-NEXT:        .long   9                       # Extern reloc section string offset=9
-; CHECK-NEXT:        .long   1
-; CHECK-NEXT:        .long   .Ltmp{{[0-9]+}}
-; CHECK-NEXT:        .long   15
-
-attributes #0 = { norecurse nounwind readonly "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
-
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!3, !4, !5}
-!llvm.ident = !{!6}
-
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 8.0.20181009 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
-!1 = !DIFile(filename: "test.c", directory: "/tmp/home/yhs/work/tests/llvm")
-!2 = !{}
-!3 = !{i32 2, !"Dwarf Version", i32 4}
-!4 = !{i32 2, !"Debug Info Version", i32 3}
-!5 = !{i32 1, !"wchar_size", i32 4}
-!6 = !{!"clang version 8.0.20181009 "}
-!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: true, unit: !0, retainedNodes: !2)
-!8 = !DISubroutineType(types: !9)
-!9 = !{!10}
-!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-!11 = !DILocation(line: 2, column: 20, scope: !7)
-!12 = !{!13, !13, i64 0}
-!13 = !{!"long long", !14, i64 0}
-!14 = !{!"omnipotent char", !15, i64 0}
-!15 = !{!"Simple C/C++ TBAA"}
-!16 = !DILocation(line: 2, column: 13, scope: !7)




More information about the llvm-commits mailing list