[llvm-branch-commits] [llvm-branch] r369654 - Merging r369426 and r369443:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Aug 22 07:28:05 PDT 2019


Author: hans
Date: Thu Aug 22 07:28:05 2019
New Revision: 369654

URL: http://llvm.org/viewvc/llvm-project?rev=369654&view=rev
Log:
Merging r369426 and r369443:

------------------------------------------------------------------------
r369426 | mstorsjo | 2019-08-20 20:58:05 +0200 (Tue, 20 Aug 2019) | 5 lines

[TargetMachine] Don't try to create COFFSTUB references on windows on non-COFF

This avoids spurious relocation types for windows/elf targets.

Differential Revision: https://reviews.llvm.org/D66401
------------------------------------------------------------------------

------------------------------------------------------------------------
r369443 | mstorsjo | 2019-08-20 22:58:02 +0200 (Tue, 20 Aug 2019) | 11 lines

[test] Fix tests when run on windows after SVN r369426. NFC.

When running tests on windows, invoking "llc -march=<arch>" will
implicitly use windows as the target os, making these tests misbehave
after this change.

Fix the issue by using more specific -mtriple values instead of plain
-march in these tests.

This should hopefully fix buildbot failures like
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/9816.
------------------------------------------------------------------------

Modified:
    llvm/branches/release_90/   (props changed)
    llvm/branches/release_90/lib/Target/TargetMachine.cpp
    llvm/branches/release_90/lib/Target/X86/X86Subtarget.cpp
    llvm/branches/release_90/test/CodeGen/AMDGPU/propagate-attributes-bitcast-function.ll
    llvm/branches/release_90/test/CodeGen/AMDGPU/propagate-attributes-clone.ll
    llvm/branches/release_90/test/CodeGen/AMDGPU/propagate-attributes-single-set.ll
    llvm/branches/release_90/test/CodeGen/Hexagon/pic-jt-big.ll
    llvm/branches/release_90/test/CodeGen/Hexagon/pic-sdata.ll
    llvm/branches/release_90/test/CodeGen/SPARC/tls.ll
    llvm/branches/release_90/test/CodeGen/X86/mingw-refptr.ll

Propchange: llvm/branches/release_90/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug 22 07:28:05 2019
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,366431,366481,366487,366527,366570,366660,366868,366925,367019,367030,367062,367084,367124,367215,367292,367304,367306,367314,367340-367341,367394,367396,367398,367403,367412,367417,367429,367662,367750,367753,367846-367847,367898,367941,368004,368230,368300,368315,368324,368477-368478,368517-368519,368554,368572,368873,369011,369026,369084,369095,369097,369168,369199
+/llvm/trunk:155241,366431,366481,366487,366527,366570,366660,366868,366925,367019,367030,367062,367084,367124,367215,367292,367304,367306,367314,367340-367341,367394,367396,367398,367403,367412,367417,367429,367662,367750,367753,367846-367847,367898,367941,368004,368230,368300,368315,368324,368477-368478,368517-368519,368554,368572,368873,369011,369026,369084,369095,369097,369168,369199,369426,369443

Modified: llvm/branches/release_90/lib/Target/TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_90/lib/Target/TargetMachine.cpp?rev=369654&r1=369653&r2=369654&view=diff
==============================================================================
--- llvm/branches/release_90/lib/Target/TargetMachine.cpp (original)
+++ llvm/branches/release_90/lib/Target/TargetMachine.cpp Thu Aug 22 07:28:05 2019
@@ -140,8 +140,8 @@ bool TargetMachine::shouldAssumeDSOLocal
   // don't assume the variables to be DSO local unless we actually know
   // that for sure. This only has to be done for variables; for functions
   // the linker can insert thunks for calling functions from another DLL.
-  if (TT.isWindowsGNUEnvironment() && GV && GV->isDeclarationForLinker() &&
-      isa<GlobalVariable>(GV))
+  if (TT.isWindowsGNUEnvironment() && TT.isOSBinFormatCOFF() && GV &&
+      GV->isDeclarationForLinker() && isa<GlobalVariable>(GV))
     return false;
 
   // On COFF, don't mark 'extern_weak' symbols as DSO local. If these symbols
@@ -154,7 +154,9 @@ bool TargetMachine::shouldAssumeDSOLocal
   // Make an exception for windows OS in the triple: Some firmware builds use
   // *-win32-macho triples. This (accidentally?) produced windows relocations
   // without GOT tables in older clang versions; Keep this behaviour.
-  if (TT.isOSBinFormatCOFF() || (TT.isOSWindows() && TT.isOSBinFormatMachO()))
+  // Some JIT users use *-win32-elf triples; these shouldn't use GOT tables
+  // either.
+  if (TT.isOSBinFormatCOFF() || TT.isOSWindows())
     return true;
 
   // Most PIC code sequences that assume that a symbol is local cannot

Modified: llvm/branches/release_90/lib/Target/X86/X86Subtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_90/lib/Target/X86/X86Subtarget.cpp?rev=369654&r1=369653&r2=369654&view=diff
==============================================================================
--- llvm/branches/release_90/lib/Target/X86/X86Subtarget.cpp (original)
+++ llvm/branches/release_90/lib/Target/X86/X86Subtarget.cpp Thu Aug 22 07:28:05 2019
@@ -146,6 +146,9 @@ unsigned char X86Subtarget::classifyGlob
       return X86II::MO_DLLIMPORT;
     return X86II::MO_COFFSTUB;
   }
+  // Some JIT users use *-win32-elf triples; these shouldn't use GOT tables.
+  if (isOSWindows())
+    return X86II::MO_NO_FLAG;
 
   if (is64Bit()) {
     // ELF supports a large, truly PIC code model with non-PC relative GOT

Modified: llvm/branches/release_90/test/CodeGen/AMDGPU/propagate-attributes-bitcast-function.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_90/test/CodeGen/AMDGPU/propagate-attributes-bitcast-function.ll?rev=369654&r1=369653&r2=369654&view=diff
==============================================================================
--- llvm/branches/release_90/test/CodeGen/AMDGPU/propagate-attributes-bitcast-function.ll (original)
+++ llvm/branches/release_90/test/CodeGen/AMDGPU/propagate-attributes-bitcast-function.ll Thu Aug 22 07:28:05 2019
@@ -1,4 +1,4 @@
-; RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
 
 ; GCN: foo1:
 ; v_cndmask_b32_e64 v0, 0, 1, vcc_lo{{$}}

Modified: llvm/branches/release_90/test/CodeGen/AMDGPU/propagate-attributes-clone.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_90/test/CodeGen/AMDGPU/propagate-attributes-clone.ll?rev=369654&r1=369653&r2=369654&view=diff
==============================================================================
--- llvm/branches/release_90/test/CodeGen/AMDGPU/propagate-attributes-clone.ll (original)
+++ llvm/branches/release_90/test/CodeGen/AMDGPU/propagate-attributes-clone.ll Thu Aug 22 07:28:05 2019
@@ -1,5 +1,5 @@
 ; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -O1 < %s | FileCheck -check-prefix=OPT %s
-; RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefix=LLC %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefix=LLC %s
 
 ; OPT: declare void @foo4() local_unnamed_addr #0
 ; OPT: define internal fastcc void @foo3.2() unnamed_addr #1

Modified: llvm/branches/release_90/test/CodeGen/AMDGPU/propagate-attributes-single-set.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_90/test/CodeGen/AMDGPU/propagate-attributes-single-set.ll?rev=369654&r1=369653&r2=369654&view=diff
==============================================================================
--- llvm/branches/release_90/test/CodeGen/AMDGPU/propagate-attributes-single-set.ll (original)
+++ llvm/branches/release_90/test/CodeGen/AMDGPU/propagate-attributes-single-set.ll Thu Aug 22 07:28:05 2019
@@ -1,5 +1,5 @@
 ; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -O1 < %s | FileCheck -check-prefix=OPT %s
-; RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefix=LLC %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefix=LLC %s
 
 ; OPT: declare void @foo4() local_unnamed_addr #0
 ; OPT: define void @foo3() local_unnamed_addr #1

Modified: llvm/branches/release_90/test/CodeGen/Hexagon/pic-jt-big.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_90/test/CodeGen/Hexagon/pic-jt-big.ll?rev=369654&r1=369653&r2=369654&view=diff
==============================================================================
--- llvm/branches/release_90/test/CodeGen/Hexagon/pic-jt-big.ll (original)
+++ llvm/branches/release_90/test/CodeGen/Hexagon/pic-jt-big.ll Thu Aug 22 07:28:05 2019
@@ -1,4 +1,4 @@
-; RUN: llc -march=hexagon -relocation-model=pic < %s | FileCheck %s
+; RUN: llc -mtriple=hexagon-unknown-elf -relocation-model=pic < %s | FileCheck %s
 
 ; CHECK: r{{[0-9]+}} = add({{pc|PC}},##.LJTI{{[0-9_]+}}@PCREL)
 ; CHECK: r{{[0-9]+}} = memw(r{{[0-9]}}+##g0 at GOT

Modified: llvm/branches/release_90/test/CodeGen/Hexagon/pic-sdata.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_90/test/CodeGen/Hexagon/pic-sdata.ll?rev=369654&r1=369653&r2=369654&view=diff
==============================================================================
--- llvm/branches/release_90/test/CodeGen/Hexagon/pic-sdata.ll (original)
+++ llvm/branches/release_90/test/CodeGen/Hexagon/pic-sdata.ll Thu Aug 22 07:28:05 2019
@@ -1,5 +1,5 @@
-; RUN: llc -march=hexagon -hexagon-small-data-threshold=8 -relocation-model=static < %s | FileCheck --check-prefixes=CHECK,STATIC %s
-; RUN: llc -march=hexagon -hexagon-small-data-threshold=8 -relocation-model=pic < %s | FileCheck --check-prefixes=CHECK,PIC %s
+; RUN: llc -mtriple=hexagon-unknown-elf -hexagon-small-data-threshold=8 -relocation-model=static < %s | FileCheck --check-prefixes=CHECK,STATIC %s
+; RUN: llc -mtriple=hexagon-unknown-elf -hexagon-small-data-threshold=8 -relocation-model=pic < %s | FileCheck --check-prefixes=CHECK,PIC %s
 
 ; If a global has a specified section, it should probably be placed in that
 ; section, but with PIC any accesses to globals in small data should still

Modified: llvm/branches/release_90/test/CodeGen/SPARC/tls.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_90/test/CodeGen/SPARC/tls.ll?rev=369654&r1=369653&r2=369654&view=diff
==============================================================================
--- llvm/branches/release_90/test/CodeGen/SPARC/tls.ll (original)
+++ llvm/branches/release_90/test/CodeGen/SPARC/tls.ll Thu Aug 22 07:28:05 2019
@@ -1,12 +1,12 @@
-; RUN: llc <%s -march=sparc   -relocation-model=static | FileCheck %s --check-prefix=v8abs
-; RUN: llc <%s -march=sparcv9 -relocation-model=static | FileCheck %s --check-prefix=v9abs
-; RUN: llc <%s -march=sparc   -relocation-model=pic    | FileCheck %s --check-prefix=pic
-; RUN: llc <%s -march=sparcv9 -relocation-model=pic    | FileCheck %s --check-prefix=pic
+; RUN: llc <%s -mtriple=sparc-unknown-linux   -relocation-model=static | FileCheck %s --check-prefix=v8abs
+; RUN: llc <%s -mtriple=sparcv9-unknown-linux -relocation-model=static | FileCheck %s --check-prefix=v9abs
+; RUN: llc <%s -mtriple=sparc-unknown-linux   -relocation-model=pic    | FileCheck %s --check-prefix=pic
+; RUN: llc <%s -mtriple=sparcv9-unknown-linux -relocation-model=pic    | FileCheck %s --check-prefix=pic
 
-; RUN: llc <%s -march=sparc   -relocation-model=static -filetype=obj | llvm-readobj -r --symbols | FileCheck %s --check-prefix=v8abs-obj
-; RUN: llc <%s -march=sparcv9 -relocation-model=static -filetype=obj | llvm-readobj -r --symbols | FileCheck %s --check-prefix=v9abs-obj
-; RUN: llc <%s -march=sparc   -relocation-model=pic    -filetype=obj | llvm-readobj -r --symbols | FileCheck %s --check-prefix=pic-obj
-; RUN: llc <%s -march=sparcv9 -relocation-model=pic    -filetype=obj | llvm-readobj -r --symbols | FileCheck %s --check-prefix=pic-obj
+; RUN: llc <%s -mtriple=sparc-unknown-linux   -relocation-model=static -filetype=obj | llvm-readobj -r --symbols | FileCheck %s --check-prefix=v8abs-obj
+; RUN: llc <%s -mtriple=sparcv9-unknown-linux -relocation-model=static -filetype=obj | llvm-readobj -r --symbols | FileCheck %s --check-prefix=v9abs-obj
+; RUN: llc <%s -mtriple=sparc-unknown-linux   -relocation-model=pic    -filetype=obj | llvm-readobj -r --symbols | FileCheck %s --check-prefix=pic-obj
+; RUN: llc <%s -mtriple=sparcv9-unknown-linux -relocation-model=pic    -filetype=obj | llvm-readobj -r --symbols | FileCheck %s --check-prefix=pic-obj
 
 @local_symbol = internal thread_local global i32 0
 @extern_symbol = external thread_local global i32

Modified: llvm/branches/release_90/test/CodeGen/X86/mingw-refptr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_90/test/CodeGen/X86/mingw-refptr.ll?rev=369654&r1=369653&r2=369654&view=diff
==============================================================================
--- llvm/branches/release_90/test/CodeGen/X86/mingw-refptr.ll (original)
+++ llvm/branches/release_90/test/CodeGen/X86/mingw-refptr.ll Thu Aug 22 07:28:05 2019
@@ -1,5 +1,6 @@
 ; RUN: llc < %s -mtriple=x86_64-w64-mingw32 | FileCheck %s -check-prefix=CHECK-X64
 ; RUN: llc < %s -mtriple=i686-w64-mingw32 | FileCheck %s -check-prefix=CHECK-X86
+; RUN: llc < %s -mtriple=i686-w64-mingw32-none-elf | FileCheck %s -check-prefix=CHECK-X86-ELF
 
 @var = external local_unnamed_addr global i32, align 4
 @dsolocalvar = external dso_local local_unnamed_addr global i32, align 4
@@ -16,6 +17,9 @@ define dso_local i32 @getVar() {
 ; CHECK-X86:    movl .refptr._var, %eax
 ; CHECK-X86:    movl (%eax), %eax
 ; CHECK-X86:    retl
+; CHECK-X86-ELF-LABEL: getVar:
+; CHECK-X86-ELF:    movl var, %eax
+; CHECK-X86-ELF:    retl
 entry:
   %0 = load i32, i32* @var, align 4
   ret i32 %0
@@ -66,6 +70,9 @@ define dso_local i32 @getExtVar() {
 ; CHECK-X86:    movl __imp__extvar, %eax
 ; CHECK-X86:    movl (%eax), %eax
 ; CHECK-X86:    retl
+; CHECK-X86-ELF-LABEL: getExtVar:
+; CHECK-X86-ELF:    movl extvar, %eax
+; CHECK-X86-ELF:    retl
 entry:
   %0 = load i32, i32* @extvar, align 4
   ret i32 %0




More information about the llvm-branch-commits mailing list