[llvm] 732f63d - [PowerPC]set default min-jump-table-entries to 64 on PPC
Chen Zheng via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 29 18:42:41 PDT 2023
Author: Chen Zheng
Date: 2023-08-29T21:42:22-04:00
New Revision: 732f63d96dc5b2cc5a5ad4e1db16bb3b4297fa24
URL: https://github.com/llvm/llvm-project/commit/732f63d96dc5b2cc5a5ad4e1db16bb3b4297fa24
DIFF: https://github.com/llvm/llvm-project/commit/732f63d96dc5b2cc5a5ad4e1db16bb3b4297fa24.diff
LOG: [PowerPC]set default min-jump-table-entries to 64 on PPC
Reviewed By: nemanjai
Differential Revision: https://reviews.llvm.org/D159050
Added:
Modified:
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/test/CodeGen/PowerPC/absol-jump-table-enabled.ll
llvm/test/CodeGen/PowerPC/aix-lower-jump-table.ll
llvm/test/CodeGen/PowerPC/jump-table.ll
llvm/test/CodeGen/PowerPC/jump-tables-collapse-rotate.ll
llvm/test/CodeGen/PowerPC/mcm-5.ll
llvm/test/CodeGen/PowerPC/p10-spill-crgt.ll
llvm/test/CodeGen/PowerPC/pcrel-jump-table.ll
llvm/test/CodeGen/PowerPC/ppc-TOC-stats.ll
llvm/test/CodeGen/PowerPC/pr22711.ll
llvm/test/CodeGen/PowerPC/pr33547.ll
llvm/test/CodeGen/PowerPC/unreachable-mbb-jtreference-elimination.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index 9175603b088510..0f15ad12db19eb 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -132,6 +132,10 @@ cl::opt<bool> DisableAutoPairedVecSt(
cl::desc("disable automatically generated 32byte paired vector stores"),
cl::init(true), cl::Hidden);
+static cl::opt<unsigned> PPCMinimumJumpTableEntries(
+ "ppc-min-jump-table-entries", cl::init(64), cl::Hidden,
+ cl::desc("Set minimum number of entries to use a jump table on PPC"));
+
STATISTIC(NumTailCalls, "Number of tail calls");
STATISTIC(NumSiblingCalls, "Number of sibling calls");
STATISTIC(ShufflesHandledWithVPERM,
@@ -1432,6 +1436,12 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,
setJumpIsExpensive();
}
+ // TODO: The default entry number is set to 64. This stops most jump table
+ // generation on PPC. But it is good for current PPC HWs because the indirect
+ // branch instruction mtctr to the jump table may lead to bad branch predict.
+ // Re-evaluate this value on future HWs that can do better with mtctr.
+ setMinimumJumpTableEntries(PPCMinimumJumpTableEntries);
+
setMinFunctionAlignment(Align(4));
switch (Subtarget.getCPUDirective()) {
diff --git a/llvm/test/CodeGen/PowerPC/absol-jump-table-enabled.ll b/llvm/test/CodeGen/PowerPC/absol-jump-table-enabled.ll
index 4ee62fa1908f94..91738c1989d918 100644
--- a/llvm/test/CodeGen/PowerPC/absol-jump-table-enabled.ll
+++ b/llvm/test/CodeGen/PowerPC/absol-jump-table-enabled.ll
@@ -1,43 +1,43 @@
; NOTE: This test case generates a jump table on PowerPC big and little endian
; NOTE: then verifies that the command line option to enable absolute jump
; NOTE: table works correctly.
-; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -o - \
+; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -ppc-min-jump-table-entries=4 -o - \
; RUN: -ppc-use-absolute-jumptables -ppc-asm-full-reg-names \
; RUN: -verify-machineinstrs %s | FileCheck %s -check-prefix=CHECK-LE
-; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -o - \
+; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -ppc-min-jump-table-entries=4 -o - \
; RUN: -ppc-use-absolute-jumptables -ppc-asm-full-reg-names \
; RUN: -verify-machineinstrs %s | FileCheck %s -check-prefix=CHECK-BE
-; RUN: llc -mtriple=powerpc64-ibm-aix-xcoff -o - \
+; RUN: llc -mtriple=powerpc64-ibm-aix-xcoff -ppc-min-jump-table-entries=4 -o - \
; RUN: -ppc-use-absolute-jumptables -ppc-asm-full-reg-names \
; RUN: -verify-machineinstrs %s | FileCheck %s -check-prefix=CHECK-AIX
-; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -o - \
+; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -ppc-min-jump-table-entries=4 -o - \
; RUN: -ppc-use-absolute-jumptables=true --relocation-model=pic < %s | FileCheck %s \
; RUN: -check-prefix=CHECK-A-PIC-LE
-; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -o - \
+; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -ppc-min-jump-table-entries=4 -o - \
; RUN: -ppc-use-absolute-jumptables=false --relocation-model=pic < %s | FileCheck %s \
; RUN: -check-prefix=CHECK-R-PIC-LE
-; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -o - \
+; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -ppc-min-jump-table-entries=4 -o - \
; RUN: -ppc-use-absolute-jumptables=true --relocation-model=pic < %s | FileCheck %s \
; RUN: -check-prefix=CHECK-A-PIC-BE
-; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -o - \
+; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -ppc-min-jump-table-entries=4 -o - \
; RUN: -ppc-use-absolute-jumptables=false --relocation-model=pic < %s | FileCheck %s \
; RUN: -check-prefix=CHECK-R-PIC-BE
-; RUN: llc -mtriple=powerpc64-ibm-aix-xcoff -o - \
+; RUN: llc -mtriple=powerpc64-ibm-aix-xcoff -ppc-min-jump-table-entries=4 -o - \
; RUN: -ppc-use-absolute-jumptables=true --relocation-model=pic < %s | FileCheck %s \
; RUN: -check-prefix=CHECK-A-PIC-AIX
-; RUN: llc -mtriple=powerpc64-ibm-aix-xcoff -o - \
+; RUN: llc -mtriple=powerpc64-ibm-aix-xcoff -ppc-min-jump-table-entries=4 -o - \
; RUN: -ppc-use-absolute-jumptables=false --relocation-model=pic < %s | FileCheck %s \
; RUN: -check-prefix=CHECK-R-PIC-AIX
-; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -o - \
+; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -ppc-min-jump-table-entries=4 -o - \
; RUN: -ppc-use-absolute-jumptables=true --relocation-model=static < %s | FileCheck %s \
; RUN: -check-prefix=CHECK-A-STATIC-LE
-; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -o - \
+; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -ppc-min-jump-table-entries=4 -o - \
; RUN: -ppc-use-absolute-jumptables=false --relocation-model=static < %s | FileCheck %s \
; RUN: -check-prefix=CHECK-R-STATIC-LE
-; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -o - \
+; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -ppc-min-jump-table-entries=4 -o - \
; RUN: -ppc-use-absolute-jumptables=true --relocation-model=static < %s | FileCheck %s \
; RUN: -check-prefix=CHECK-A-STATIC-BE
-; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -o - \
+; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -ppc-min-jump-table-entries=4 -o - \
; RUN: -ppc-use-absolute-jumptables=false --relocation-model=static < %s | FileCheck %s \
; RUN: -check-prefix=CHECK-R-STATIC-BE
diff --git a/llvm/test/CodeGen/PowerPC/aix-lower-jump-table.ll b/llvm/test/CodeGen/PowerPC/aix-lower-jump-table.ll
index 179aed2d9276c6..b0466d21adda7b 100644
--- a/llvm/test/CodeGen/PowerPC/aix-lower-jump-table.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-lower-jump-table.ll
@@ -1,36 +1,36 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff \
-; RUN: -code-model=small -stop-after=machine-cp < %s | FileCheck \
+; RUN: -ppc-min-jump-table-entries=4 -code-model=small -stop-after=machine-cp < %s | FileCheck \
; RUN: --check-prefix=32SMALL-MIR %s
; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff \
-; RUN: -code-model=large -stop-after=machine-cp < %s | FileCheck \
+; RUN: -ppc-min-jump-table-entries=4 -code-model=large -stop-after=machine-cp < %s | FileCheck \
; RUN: --check-prefix=32LARGE-MIR %s
; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff \
-; RUN: -code-model=small -stop-after=machine-cp < %s | FileCheck \
+; RUN: -ppc-min-jump-table-entries=4 -code-model=small -stop-after=machine-cp < %s | FileCheck \
; RUN: --check-prefix=64SMALL-MIR %s
; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff \
-; RUN: -code-model=large -stop-after=machine-cp < %s | FileCheck \
+; RUN: -ppc-min-jump-table-entries=4 -code-model=large -stop-after=machine-cp < %s | FileCheck \
; RUN: --check-prefix=64LARGE-MIR %s
-; RUN: llc -mtriple powerpc-ibm-aix-xcoff -code-model=small < %s | FileCheck \
+; RUN: llc -mtriple powerpc-ibm-aix-xcoff -ppc-min-jump-table-entries=4 -code-model=small < %s | FileCheck \
; RUN: --check-prefixes=32SMALL-ASM,SMALL-ASM %s
-; RUN: llc -mtriple powerpc-ibm-aix-xcoff -code-model=large < %s | FileCheck \
+; RUN: llc -mtriple powerpc-ibm-aix-xcoff -ppc-min-jump-table-entries=4 -code-model=large < %s | FileCheck \
; RUN: --check-prefixes=32LARGE-ASM,LARGE-ASM %s
-; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -code-model=small < %s | FileCheck \
+; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -ppc-min-jump-table-entries=4 -code-model=small < %s | FileCheck \
; RUN: --check-prefixes=64SMALL-ASM,SMALL-ASM %s
-; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -code-model=large < %s | FileCheck \
+; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -ppc-min-jump-table-entries=4 -code-model=large < %s | FileCheck \
; RUN: --check-prefixes=64LARGE-ASM,LARGE-ASM %s
-; RUN: llc -mtriple powerpc-ibm-aix-xcoff -function-sections < %s | FileCheck \
+; RUN: llc -mtriple powerpc-ibm-aix-xcoff -ppc-min-jump-table-entries=4 -function-sections < %s | FileCheck \
; RUN: --check-prefix=FUNC-ASM %s
-; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -function-sections < %s | FileCheck \
+; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -ppc-min-jump-table-entries=4 -function-sections < %s | FileCheck \
; RUN: --check-prefix=FUNC-ASM %s
define i32 @jump_table(i32 %a) {
diff --git a/llvm/test/CodeGen/PowerPC/jump-table.ll b/llvm/test/CodeGen/PowerPC/jump-table.ll
index 23cb9c852f1d02..7528764f352c0b 100644
--- a/llvm/test/CodeGen/PowerPC/jump-table.ll
+++ b/llvm/test/CodeGen/PowerPC/jump-table.ll
@@ -4,11 +4,17 @@
; RUN: | FileCheck %s
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-ibm-aix -stop-after=finalize-isel \
; RUN: | FileCheck %s
+; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu -stop-after=finalize-isel \
+; RUN: -min-jump-table-entries=4 | FileCheck %s
+; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu -stop-after=finalize-isel \
+; RUN: -ppc-min-jump-table-entries=4 | FileCheck %s -check-prefix=JT
+
+; JT: jumpTable:
+; JT-NEXT: kind: label-
diff erence32
+; JT-NEXT: entries:
+; JT-NEXT: - id: 0
-; CHECK: jumpTable:
-; CHECK-NEXT: kind: label-
diff erence32
-; CHECK-NEXT: entries:
-; CHECK-NEXT: - id: 0
+; CHECK-NOT: jumpTable:
define signext i32 @jt(i32 signext %a, i32 signext %b) {
entry:
diff --git a/llvm/test/CodeGen/PowerPC/jump-tables-collapse-rotate.ll b/llvm/test/CodeGen/PowerPC/jump-tables-collapse-rotate.ll
index 3d48e0f7ef923b..ccc9adbc2bdd1d 100644
--- a/llvm/test/CodeGen/PowerPC/jump-tables-collapse-rotate.ll
+++ b/llvm/test/CodeGen/PowerPC/jump-tables-collapse-rotate.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -o - \
+; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -ppc-min-jump-table-entries=4 -o - \
; RUN: -ppc-asm-full-reg-names -verify-machineinstrs %s | FileCheck %s
; Function Attrs: nounwind
diff --git a/llvm/test/CodeGen/PowerPC/mcm-5.ll b/llvm/test/CodeGen/PowerPC/mcm-5.ll
index cfce1fa8eb0cd7..5e85c62c29a408 100644
--- a/llvm/test/CodeGen/PowerPC/mcm-5.ll
+++ b/llvm/test/CodeGen/PowerPC/mcm-5.ll
@@ -1,5 +1,5 @@
-; RUN: llc -verify-machineinstrs -mcpu=pwr7 -code-model=medium <%s | FileCheck %s
-; RUN: llc -verify-machineinstrs -mcpu=pwr7 -code-model=large <%s | FileCheck -check-prefix=LARGE %s
+; RUN: llc -verify-machineinstrs -mcpu=pwr7 -ppc-min-jump-table-entries=4 -code-model=medium <%s | FileCheck %s
+; RUN: llc -verify-machineinstrs -mcpu=pwr7 -ppc-min-jump-table-entries=4 -code-model=large <%s | FileCheck -check-prefix=LARGE %s
; Test correct code generation for medium and large code model
; for loading the address of a jump table from the TOC.
diff --git a/llvm/test/CodeGen/PowerPC/p10-spill-crgt.ll b/llvm/test/CodeGen/PowerPC/p10-spill-crgt.ll
index ba81c46a738d8a..4bea1d81a9de0a 100644
--- a/llvm/test/CodeGen/PowerPC/p10-spill-crgt.ll
+++ b/llvm/test/CodeGen/PowerPC/p10-spill-crgt.ll
@@ -1,9 +1,9 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
-; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
+; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr -ppc-min-jump-table-entries=4 < %s | \
; RUN: FileCheck %s
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \
-; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
+; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr -ppc-min-jump-table-entries=4 < %s | \
; RUN: FileCheck %s --check-prefix=CHECK-BE
; This test case tests spilling the CR GT bit on Power10. On Power10, this is
diff --git a/llvm/test/CodeGen/PowerPC/pcrel-jump-table.ll b/llvm/test/CodeGen/PowerPC/pcrel-jump-table.ll
index 3a742588d23b59..fb1dbadd48e816 100644
--- a/llvm/test/CodeGen/PowerPC/pcrel-jump-table.ll
+++ b/llvm/test/CodeGen/PowerPC/pcrel-jump-table.ll
@@ -1,15 +1,15 @@
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
-; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names < %s | FileCheck %s \
+; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-min-jump-table-entries=4 < %s | FileCheck %s \
; RUN: --check-prefix=CHECK-R
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
-; RUN: -mcpu=pwr10 -ppc-use-absolute-jumptables \
+; RUN: -mcpu=pwr10 -ppc-use-absolute-jumptables -ppc-min-jump-table-entries=4 \
; RUN: -ppc-asm-full-reg-names < %s | FileCheck %s \
; RUN: --check-prefix=CHECK-A-LE
; RUN: llc -verify-machineinstrs -target-abi=elfv2 -mtriple=powerpc64-- \
-; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names < %s | FileCheck %s \
+; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-min-jump-table-entries=4 < %s | FileCheck %s \
; RUN: --check-prefix=CHECK-R
; RUN: llc -verify-machineinstrs -target-abi=elfv2 -mtriple=powerpc64-- \
-; RUN: -mcpu=pwr10 -ppc-use-absolute-jumptables \
+; RUN: -mcpu=pwr10 -ppc-use-absolute-jumptables -ppc-min-jump-table-entries=4 \
; RUN: -ppc-asm-full-reg-names < %s | FileCheck %s \
; RUN: --check-prefix=CHECK-A-BE
diff --git a/llvm/test/CodeGen/PowerPC/ppc-TOC-stats.ll b/llvm/test/CodeGen/PowerPC/ppc-TOC-stats.ll
index a9a87ad56a4dfa..1337c8eb477554 100644
--- a/llvm/test/CodeGen/PowerPC/ppc-TOC-stats.ll
+++ b/llvm/test/CodeGen/PowerPC/ppc-TOC-stats.ll
@@ -4,17 +4,17 @@
; REQUIRES: asserts
; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr8 \
-; RUN: --stats < %s 2>&1 | FileCheck %s --check-prefix=AIX
+; RUN: --stats -ppc-min-jump-table-entries=4 < %s 2>&1 | FileCheck %s --check-prefix=AIX
; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr8 \
-; RUN: --stats < %s 2>&1 | FileCheck %s --check-prefix=AIX
+; RUN: --stats -ppc-min-jump-table-entries=4 < %s 2>&1 | FileCheck %s --check-prefix=AIX
; RUN: llc -verify-machineinstrs -mtriple powerpc64-unknown-linux -mcpu=pwr8 \
-; RUN: --stats < %s 2>&1 | FileCheck %s --check-prefix=LINUX
+; RUN: --stats -ppc-min-jump-table-entries=4 < %s 2>&1 | FileCheck %s --check-prefix=LINUX
; RUN: llc -verify-machineinstrs -mtriple powerpc64le-unknown-linux -mcpu=pwr8 \
-; RUN: --stats < %s 2>&1 | FileCheck %s --check-prefix=LINUX
+; RUN: --stats -ppc-min-jump-table-entries=4 < %s 2>&1 | FileCheck %s --check-prefix=LINUX
; RUN: llc -verify-machineinstrs -mtriple powerpc64-unknown-linux -mcpu=pwr8 \
-; RUN: -code-model=large --stats < %s 2>&1 | FileCheck %s --check-prefix=LINUXLARGE
+; RUN: -code-model=large --stats -ppc-min-jump-table-entries=4 < %s 2>&1 | FileCheck %s --check-prefix=LINUXLARGE
; RUN: llc -verify-machineinstrs -mtriple powerpc64le-unknown-linux -mcpu=pwr8 \
-; RUN: -code-model=large --stats < %s 2>&1 | FileCheck %s --check-prefix=LINUXLARGE
+; RUN: -code-model=large --stats -ppc-min-jump-table-entries=4 < %s 2>&1 | FileCheck %s --check-prefix=LINUXLARGE
; The purpose of this test is to check that the statistics about the TOC are
diff --git a/llvm/test/CodeGen/PowerPC/pr22711.ll b/llvm/test/CodeGen/PowerPC/pr22711.ll
index 8acaa6123ac7da..9bfed4c803fb04 100644
--- a/llvm/test/CodeGen/PowerPC/pr22711.ll
+++ b/llvm/test/CodeGen/PowerPC/pr22711.ll
@@ -1,6 +1,7 @@
; Verify that the .toc section is aligned on an 8-byte boundary.
-; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 -filetype=obj -o - | llvm-readobj --sections - | FileCheck %s
+; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu \
+; RUN: -mcpu=pwr8 -filetype=obj -ppc-min-jump-table-entries=4 -o - | llvm-readobj --sections - | FileCheck %s
define void @test(ptr %a) {
entry:
diff --git a/llvm/test/CodeGen/PowerPC/pr33547.ll b/llvm/test/CodeGen/PowerPC/pr33547.ll
index 5f50fc10454aec..1a41b3d6522a6e 100644
--- a/llvm/test/CodeGen/PowerPC/pr33547.ll
+++ b/llvm/test/CodeGen/PowerPC/pr33547.ll
@@ -46,43 +46,41 @@ L.entry:
define void @testFunc(ptr nocapture %r, ptr nocapture readonly %k) {
; CHECK-LABEL: testFunc:
; CHECK: # %bb.0: # %L.entry
-; CHECK-NEXT: mflr 0
-; CHECK-NEXT: stdu 1, -32(1)
-; CHECK-NEXT: std 0, 48(1)
-; CHECK-NEXT: .cfi_def_cfa_offset 32
-; CHECK-NEXT: .cfi_offset lr, 16
-; CHECK-NEXT: bl .L2$pb
-; CHECK-NEXT: .L2$pb:
-; CHECK-NEXT: lwz 4, 0(4)
-; CHECK-NEXT: mflr 5
-; CHECK-NEXT: addi 4, 4, -1
-; CHECK-NEXT: cmplwi 4, 5
-; CHECK-NEXT: bgt 0, .LBB2_6
-; CHECK-NEXT: # %bb.1: # %L.entry
-; CHECK-NEXT: addis 6, 2, .LC2 at toc@ha
-; CHECK-NEXT: rldic 4, 4, 2, 30
-; CHECK-NEXT: ld 6, .LC2 at toc@l(6)
-; CHECK-NEXT: lwax 4, 4, 6
-; CHECK-NEXT: add 4, 4, 5
-; CHECK-NEXT: mtctr 4
+; CHECK-NEXT: lwz 5, 0(4)
; CHECK-NEXT: li 4, -3
-; CHECK-NEXT: bctr
+; CHECK-NEXT: cmpwi 5, 4
+; CHECK-NEXT: bge 0, .LBB2_6
+; CHECK-NEXT: # %bb.1: # %L.entry
+; CHECK-NEXT: cmplwi 5, 1
+; CHECK-NEXT: beq 0, .LBB2_11
+; CHECK-NEXT: # %bb.2: # %L.entry
+; CHECK-NEXT: cmplwi 5, 2
+; CHECK-NEXT: beq 0, .LBB2_5
+; CHECK-NEXT: # %bb.3: # %L.entry
+; CHECK-NEXT: cmplwi 5, 3
+; CHECK-NEXT: beq 0, .LBB2_11
+; CHECK-NEXT: # %bb.4: # %L.LB3_307
+; CHECK-NEXT: blr
; CHECK-NEXT: .p2align 4
-; CHECK-NEXT: .LBB2_2: # %infloop11
+; CHECK-NEXT: .LBB2_5: # %infloop11
; CHECK-NEXT: #
-; CHECK-NEXT: b .LBB2_2
+; CHECK-NEXT: b .LBB2_5
+; CHECK-NEXT: .LBB2_6: # %L.entry
+; CHECK-NEXT: beq 0, .LBB2_10
+; CHECK-NEXT: # %bb.7: # %L.entry
+; CHECK-NEXT: cmplwi 5, 5
+; CHECK-NEXT: beq 0, .LBB2_11
+; CHECK-NEXT: # %bb.8: # %L.entry
+; CHECK-NEXT: cmplwi 5, 6
+; CHECK-NEXT: bnelr 0
; CHECK-NEXT: .p2align 4
-; CHECK-NEXT: .LBB2_3: # %infloop
+; CHECK-NEXT: .LBB2_9: # %infloop
; CHECK-NEXT: #
-; CHECK-NEXT: b .LBB2_3
-; CHECK-NEXT: .LBB2_4: # %L.LB3_321.split
+; CHECK-NEXT: b .LBB2_9
+; CHECK-NEXT: .LBB2_10: # %L.LB3_321.split
; CHECK-NEXT: li 4, 5
-; CHECK-NEXT: .LBB2_5: # %L.LB3_307.sink.split
+; CHECK-NEXT: .LBB2_11: # %L.LB3_307.sink.split
; CHECK-NEXT: stw 4, 0(3)
-; CHECK-NEXT: .LBB2_6: # %L.LB3_307
-; CHECK-NEXT: addi 1, 1, 32
-; CHECK-NEXT: ld 0, 16(1)
-; CHECK-NEXT: mtlr 0
; CHECK-NEXT: blr
L.entry:
%0 = load i32, ptr %k, align 4
diff --git a/llvm/test/CodeGen/PowerPC/unreachable-mbb-jtreference-elimination.ll b/llvm/test/CodeGen/PowerPC/unreachable-mbb-jtreference-elimination.ll
index 65f0b053ab0215..f16d34da46f251 100644
--- a/llvm/test/CodeGen/PowerPC/unreachable-mbb-jtreference-elimination.ll
+++ b/llvm/test/CodeGen/PowerPC/unreachable-mbb-jtreference-elimination.ll
@@ -1,4 +1,4 @@
-; RUN: llc -O2 --verify-machineinstrs -stop-before=livevars \
+; RUN: llc -O2 --verify-machineinstrs -stop-before=livevars -ppc-min-jump-table-entries=4 \
; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s
define dso_local void @foo() #0 {
More information about the llvm-commits
mailing list