Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@ static cl::opt<cl::boolOrDefault>
EnableGlobalMerge("riscv-enable-global-merge", cl::Hidden,
cl::desc("Enable the global merge pass"));

static cl::opt<bool> ForceEnableGlobalMergeExternalGlobals(
"riscv-force-enable-global-merge-external-globals", cl::Hidden,
cl::init(false),
cl::desc(
"If the global merge pass is enabled, force enable global merging of "
"external globals (overriding any logic that might disable it)"));

static cl::opt<bool>
EnableMachineCombiner("riscv-enable-machine-combiner",
cl::desc("Enable the machine combiner pass"),
Expand Down Expand Up @@ -494,8 +487,7 @@ bool RISCVPassConfig::addPreISel() {
// Investigating and addressing both items are TODO.
addPass(createGlobalMergePass(TM, /* MaxOffset */ 2047,
/* OnlyOptimizeForSize */ false,
/* MergeExternalByDefault */
ForceEnableGlobalMergeExternalGlobals));
/* MergeExternalByDefault */ true));
}

return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv64 -riscv-force-enable-global-merge-external-globals \
; RUN: -verify-machineinstrs < %s | FileCheck %s -check-prefix=SMALL-DATA
; RUN: llc -mtriple=riscv64 -global-merge-min-data-size=0 \
; RUN: -riscv-force-enable-global-merge-external-globals -verify-machineinstrs < %s \
; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
; RUN: | FileCheck %s -check-prefix=SMALL-DATA
; RUN: llc -mtriple=riscv64 -global-merge-min-data-size=0 -verify-machineinstrs < %s \
; RUN: | FileCheck %s -check-prefix=MINSIZE

@ig1 = internal global i32 0, align 4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv32 -riscv-force-enable-global-merge-external-globals \
; RUN: -verify-machineinstrs < %s | FileCheck %s -check-prefix=SMALL-DATA
; RUN: llc -mtriple=riscv64 -global-merge-min-data-size=5 \
; RUN: -riscv-force-enable-global-merge-external-globals -verify-machineinstrs < %s \
; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
; RUN: | FileCheck %s -check-prefix=SMALL-DATA
; RUN: llc -mtriple=riscv64 -global-merge-min-data-size=5 -verify-machineinstrs < %s \
; RUN: | FileCheck %s -check-prefix=MINSIZE

@ig1 = internal global i32 0, align 4
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/CodeGen/RISCV/global-merge-minsize.ll
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv32 -riscv-force-enable-global-merge-external-globals \
; RUN: llc -mtriple=riscv32 \
; RUN: -verify-machineinstrs < %s | FileCheck %s -check-prefix=RV32
; RUN: llc -mtriple=riscv32 -global-merge-min-data-size=5 \
; RUN: -riscv-force-enable-global-merge-external-globals -verify-machineinstrs < %s | FileCheck %s -check-prefix=RV32-MINSIZE
; RUN: -verify-machineinstrs < %s | FileCheck %s -check-prefix=RV32-MINSIZE

@ig1 = internal global i32 0, align 4
@ig2 = internal global i32 0, align 4
Expand Down
8 changes: 4 additions & 4 deletions llvm/test/CodeGen/RISCV/global-merge-offset.ll
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: sed 's/ArrSize/100/g' %s | llc -mtriple=riscv32 \
; RUN: -riscv-force-enable-global-merge-external-globals -verify-machineinstrs | FileCheck %s
; RUN: -verify-machineinstrs | FileCheck %s
; RUN: sed 's/ArrSize/100/g' %s | llc -mtriple=riscv64 \
; RUN: -riscv-force-enable-global-merge-external-globals -verify-machineinstrs | FileCheck %s
; RUN: -verify-machineinstrs | FileCheck %s
; RUN: sed 's/ArrSize/101/g' %s | llc -mtriple=riscv32 \
; RUN: -riscv-force-enable-global-merge-external-globals -verify-machineinstrs | FileCheck %s -check-prefix=CHECK-TOOBIG
; RUN: -verify-machineinstrs | FileCheck %s -check-prefix=CHECK-TOOBIG
; RUN: sed 's/ArrSize/101/g' %s | llc -mtriple=riscv64 \
; RUN: -riscv-force-enable-global-merge-external-globals -verify-machineinstrs | FileCheck %s -check-prefix=CHECK-TOOBIG
; RUN: -verify-machineinstrs | FileCheck %s -check-prefix=CHECK-TOOBIG

; This test demonstrates that the MaxOffset is set correctly for RISC-V by
; constructing an input that is at the limit and comparing.
Expand Down
12 changes: 6 additions & 6 deletions llvm/test/CodeGen/RISCV/global-merge.ll
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s | FileCheck %s
; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s | FileCheck %s
; RUN: llc -mtriple=riscv32 \
; RUN: -riscv-force-enable-global-merge-external-globals -verify-machineinstrs < %s \
; RUN: llc -mtriple=riscv32 -global-merge-on-external=false \
; RUN: -verify-machineinstrs < %s | FileCheck %s
; RUN: llc -mtriple=riscv64 -global-merge-on-external=false \
; RUN: -verify-machineinstrs < %s | FileCheck %s
; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
; RUN: | FileCheck -check-prefix=CHECK-WEXTERN %s
; RUN: llc -mtriple=riscv64 \
; RUN: -riscv-force-enable-global-merge-external-globals -verify-machineinstrs < %s \
; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
; RUN: | FileCheck -check-prefix=CHECK-WEXTERN %s

@ig1 = internal global i32 0, align 4
Expand Down
Loading