]> granicus.if.org Git - llvm/commitdiff
[BPF] Remove relocation for patchable externs
authorYonghong Song <yhs@fb.com>
Thu, 10 Oct 2019 15:33:09 +0000 (15:33 +0000)
committerYonghong Song <yhs@fb.com>
Thu, 10 Oct 2019 15:33:09 +0000 (15:33 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374367 91177308-0d34-0410-b5e6-96231b3b80d8

22 files changed:
lib/Target/BPF/BPFAbstractMemberAccess.cpp
lib/Target/BPF/BPFCORE.h
lib/Target/BPF/BPFMISimplifyPatchable.cpp
lib/Target/BPF/BTF.h
lib/Target/BPF/BTFDebug.cpp
lib/Target/BPF/BTFDebug.h
test/CodeGen/BPF/BTF/binary-format.ll
test/CodeGen/BPF/BTF/filename.ll
test/CodeGen/BPF/BTF/func-func-ptr.ll
test/CodeGen/BPF/BTF/func-non-void.ll
test/CodeGen/BPF/BTF/func-source.ll
test/CodeGen/BPF/BTF/func-typedef.ll
test/CodeGen/BPF/BTF/func-unused-arg.ll
test/CodeGen/BPF/BTF/func-void.ll
test/CodeGen/BPF/CORE/offset-reloc-basic.ll
test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll
test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll
test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll
test/CodeGen/BPF/CORE/offset-reloc-union.ll
test/CodeGen/BPF/CORE/patchable-extern-char.ll [deleted file]
test/CodeGen/BPF/CORE/patchable-extern-uint.ll [deleted file]
test/CodeGen/BPF/CORE/patchable-extern-ulonglong.ll [deleted file]

index 1b442815c7ed9d8028b4d051e40c6c1c3981da13..400701c4e5c226593be142a61493faf42f66b2b0 100644 (file)
@@ -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;
index a6cb3cf5337606e95aebe6c03c9544d2e94d82a8..ed4778353e529885391686a224ff7243f89354f4 100644 (file)
@@ -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
index b363179e25bb0306c1a888712a52944188776f3d..3321464a1dd063339edff147b130fa91d31a446c 100644 (file)
 //    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";
             }
           }
         }
index ef408dafd52b28fec52c090ad5dc144ca4272f2a..a13c862bf840a37a4b6ae083af7bcad7fabd5329 100644 (file)
 ///   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, VERSION = 1 };
 /// 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.
 
index a8f857343ec3339731474326af8b44dd1664e5c6..db551e739bd7ce87e8b785a843e33a724126e6de 100644 (file)
@@ -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 MachineInstr *MI) {
       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 MachineInstr *MI, MCInst &OutMI) {
         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;
       }
     }
   }
index eec8614431663c18e1651f611ffab16cd62f1d06..c01e0d1d16128f945903fccd16cb2db6488fe24d 100644 (file)
@@ -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;
index bc561560caa12322dc6fbb86525cefbf4b786d9f..9701983679132d67a197b2a61305aaadb5c1a679 100644 (file)
@@ -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
index fd96720f041f8ecdeb28acfca8f39c5dc925901b..4c6a3a0a4196e002cfada4aa1a52a313305f0e80 100644 (file)
@@ -43,15 +43,13 @@ define dso_local i32 @test() local_unnamed_addr #0 !dbg !7 {
 ; 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
index e61459125b4b6bcd14b7e6d732cc3c5d519451a7..d9f677cd85f5c2100258fa010d81af80fa79ba74 100644 (file)
@@ -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
index 5593ea888dde0f18398c733a3714c3118b84c086..c09ee9a77c16f4886218b43680cf83baf62b7b83 100644 (file)
@@ -48,15 +48,13 @@ define dso_local i32 @f1(i32 returned) local_unnamed_addr #0 !dbg !7 {
 ; 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
index 0d6e098b358da61b27190a7eb545cdfadce2377b..48e161ad966ec8e4db432b6d34d1dd28eeb3d686 100644 (file)
@@ -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
index 48fcb3362962a9f08a9381b5bcd01824df00263e..46fc883ec282e483d53e2bf27dac3e98e777fca0 100644 (file)
@@ -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
index ea94fb7463808d5b47a96bb9a836ba6d382f7a0b..c104a765876db19eaa12ac81d54be271170285c7 100644 (file)
@@ -48,15 +48,13 @@ define dso_local i32 @f1(i32) local_unnamed_addr #0 !dbg !7 {
 ; 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
index 42a24d1884df15f8b53dac9579f2d5c327b0a32a..4979f401ccc8e4a0609da3883c108a7dad2d8273 100644 (file)
@@ -37,15 +37,13 @@ define dso_local void @f1() local_unnamed_addr #0 !dbg !7 {
 ; 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
index 6c4bbf14ce794764d1418608988d7cbb03fb5f1c..310a07a079c2f5e57be5a8338ee422e59ac93af6 100644 (file)
@@ -103,21 +103,19 @@ define dso_local i32 @bpf_prog(%struct.sk_buff*) local_unnamed_addr #0 !dbg !15
 ; 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
index 120b85d8687b84fea91fcc3fc38c23fb1973a189..105ec1618069079adbe9f028778a7ae83fd30b96 100644 (file)
@@ -111,21 +111,19 @@ define dso_local i32 @bpf_prog(%struct.sk_buff*) local_unnamed_addr #0 !dbg !15
 ; 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
index f77152b448b3430e9fca31298f633bed3687083a..72c60f2e6cb013fd429b0438c04d9bbcac2d1e42 100644 (file)
@@ -121,15 +121,13 @@ define dso_local i32 @bpf_prog(%struct.sk_buff*) local_unnamed_addr #0 !dbg !15
 ; 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
index a56b8fd84095ee4e7f10b8736679dc8237460dc1..d4590bb8a59e940634d09a6e3e9275bab1793749 100644 (file)
@@ -124,21 +124,19 @@ define dso_local i32 @bpf_prog(%struct.sk_buff*) local_unnamed_addr #0 !dbg !15
 ; 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
index cb60c81d58a15d72b112e450137c7f884b516728..44f687b1a1e9b147edf4d37d9c192b0f67c6b1a8 100644 (file)
@@ -127,21 +127,19 @@ define dso_local i32 @bpf_prog(%union.sk_buff*) local_unnamed_addr #0 !dbg !15 {
 ; 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
diff --git a/test/CodeGen/BPF/CORE/patchable-extern-char.ll b/test/CodeGen/BPF/CORE/patchable-extern-char.ll
deleted file mode 100644 (file)
index fb30fd5..0000000
+++ /dev/null
@@ -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
-
-@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,"",@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,"",@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)
diff --git a/test/CodeGen/BPF/CORE/patchable-extern-uint.ll b/test/CodeGen/BPF/CORE/patchable-extern-uint.ll
deleted file mode 100644 (file)
index ba3770b..0000000
+++ /dev/null
@@ -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
-
-@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,"",@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,"",@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)
diff --git a/test/CodeGen/BPF/CORE/patchable-extern-ulonglong.ll b/test/CodeGen/BPF/CORE/patchable-extern-ulonglong.ll
deleted file mode 100644 (file)
index c483cce..0000000
+++ /dev/null
@@ -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
-
-@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,"",@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,"",@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)