HomePhabricator

Partially revert D61491 "AMDGPU: Be explicit about whether the high-word in…

Description

Partially revert D61491 "AMDGPU: Be explicit about whether the high-word in SI_PC_ADD_REL_OFFSET is 0"

Summary:
D61491 caused us to use relocs when they're not strictly necessary, to
refer to symbols in the text section. This is a pessimization and it's a
problem for some loaders that don't support relocs yet.

Reviewers: nhaehnle, arsenm, tpr

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

Event Timeline

foad added a comment.Sep 3 2019, 6:43 AM

@foad This has broken EXPENSIVE_CHECKS builds - can you take a look or should I revert?

I haven't managed to do an expensive checks build on my own machine. I run into various build time problems like:

/home/jayfoad2/git/llvm-project/llvm/include/llvm/ADT/PointerUnion.h:64:25:   in constexpr expansion of ‘std::min<int>(std::initializer_list<int>{((const int*)(& ._125)), 4})’
/usr/include/c++/7/bits/stl_algo.h:3451:31: error: ‘constexpr _FIter std::min_element(_FIter, _FIter) [with _FIter = const int*]’ called in a constant expression
     { return *std::min_element(__l.begin(), __l.end()); }
               ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

I have tried various different host compilers on Ubuntu 18.04 with no luck yet.

However... from looking at the build log, the failure doesn't seem to be anything to do with failing an expensive check, so I don't understand what's going on there.

This is the -mcpu=tonga output on EXPENSIVE_CHECKS:

File: <stdin>
Format: ELF64-amdgpu
Arch: amdgcn
AddressSize: 64bit
LoadName: <Not found>
Relocations [
  Section (3) .rel.text {
    0x8 R_AMDGPU_REL32_LO extern_const_addrspace 0x0
    0x10 R_AMDGPU_REL32_HI extern_const_addrspace 0x0
  }
]
Symbols [
  Symbol {
    Name:  (0)
    Value: 0x0
    Size: 0
    Binding: Local (0x0)
    Type: None (0x0)
    Other: 0
    Section: Undefined (0x0)
  }
  Symbol {
    Name: extern_const_addrspace (93)
    Value: 0x0
    Size: 0
    Binding: Global (0x1)
    Type: None (0x0)
    Other: 0
    Section: Undefined (0x0)
  }
  Symbol {
    Name: load_extern_const_init (11)
    Value: 0x0
    Size: 64
    Binding: Global (0x1)
    Type: Function (0x2)
    Other: 0
    Section: .text (0x2)
  }
  Symbol {
    Name: load_undef_const_init (34)
    Value: 0x100
    Size: 4
    Binding: Global (0x1)
    Type: Function (0x2)
    Other: 0
    Section: .text (0x2)
  }
  Symbol {
    Name: undef_const_addrspace (116)
    Value: 0x0
    Size: 20
    Binding: Global (0x1)
    Type: Object (0x1)
    Other: 0
    Section: .rodata (0x5)
  }
]
foad added a comment.Sep 3 2019, 7:43 AM

Thanks. That is odd. I will investigate as soon as I am able to do an EXPENSIVE_CHECKS build.

foad added a comment.Sep 4 2019, 2:34 AM

I have managed to build on Linux with EXPENSIVE_CHECKS but kludged to remove -D_GLIBCXX_DEBUG (because of problems) and I can't reproduce the failure. I have also done the same plus -DLLVM_REVERSE_ITERATION=ON and I still can't reproduce the failure.

I will try on Windows, but it might take me a day or two to get round to it.

foad added a subscriber: rnk.Sep 5 2019, 3:29 AM

Fixed in rL371000, thanks @rnk!