File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -417,7 +417,8 @@ unsigned X86TargetLowering::getJumpTableEncoding() const {
417417 if (isPositionIndependent () && Subtarget.isPICStyleGOT ())
418418 return MachineJumpTableInfo::EK_Custom32;
419419 if (isPositionIndependent () &&
420- getTargetMachine ().getCodeModel () == CodeModel::Large)
420+ getTargetMachine ().getCodeModel () == CodeModel::Large &&
421+ !Subtarget.isTargetCOFF ())
421422 return MachineJumpTableInfo::EK_LabelDifference64;
422423
423424 // Otherwise, use the normal jump table encoding heuristics.
Original file line number Diff line number Diff line change 1- ; RUN: llc < %s -relocation-model static | FileCheck %s
1+ ; RUN: llc < %s -relocation-model=static | FileCheck %s
2+ ; RUN: llc < %s -relocation-model=pic | FileCheck %s --check-prefix=PIC
3+ ; RUN: llc < %s -relocation-model=pic -code-model=large | FileCheck %s --check-prefix=PIC
24
3- ; FIXME: Remove '-relocation-model static' when it is no longer necessary to
5+ ; FIXME: Remove '-relocation-model= static' when it is no longer necessary to
46; trigger the separate .rdata section.
57
68target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
@@ -57,3 +59,9 @@ declare void @g(i32)
5759; It's important that we switch back to .text here, not .rdata.
5860; CHECK: .text
5961; CHECK: .seh_endproc
62+
63+ ; Windows PIC code should use 32-bit entries
64+ ; PIC: .long .LBB0_2-.LJTI0_0
65+ ; PIC: .long .LBB0_3-.LJTI0_0
66+ ; PIC: .long .LBB0_4-.LJTI0_0
67+ ; PIC: .long .LBB0_5-.LJTI0_0
You can’t perform that action at this time.
0 commit comments