1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Revert "[Darwin] Respect -fno-unroll-loops during LTO."

As per post-commit comment at https://reviews.llvm.org/D76916, this
should better be done at the TU level.

This reverts commit 9ce198d6ed371399e9bd9ba8b48fbab0f4e60240.
This commit is contained in:
Florian Hahn 2020-03-30 15:20:30 +01:00
parent 2d8c535e77
commit 18e00645a2
2 changed files with 0 additions and 39 deletions

View File

@ -109,10 +109,6 @@ cl::opt<std::string> LTOStatsFile(
cl::Hidden);
}
cl::opt<bool> LTONoUnrollLoops("lto-no-unroll-loops",
cl::desc("Disable unrolling during LTO."),
cl::Hidden, cl::init(false));
LTOCodeGenerator::LTOCodeGenerator(LLVMContext &Context)
: Context(Context), MergedModule(new Module("ld-temp.o", Context)),
TheLinker(new Linker(*MergedModule)) {
@ -574,7 +570,6 @@ bool LTOCodeGenerator::optimize(bool DisableVerify, bool DisableInline,
Triple TargetTriple(TargetMach->getTargetTriple());
PassManagerBuilder PMB;
PMB.DisableUnrollLoops = LTONoUnrollLoops;
PMB.DisableGVNLoadPRE = DisableGVNLoadPRE;
PMB.LoopVectorize = !DisableVectorization;
PMB.SLPVectorize = !DisableVectorization;

View File

@ -1,34 +0,0 @@
; REQUIRES: asserts
; RUN: llvm-as < %s > %t1.bc
; Build with unrolling disabled (-lto-no-unroll-loops).
; RUN: llvm-lto %t1.bc -o %t.nounroll.o -lto-no-unroll-loops --exported-symbol=foo -save-merged-module
; RUN: llvm-dis -o - %t.nounroll.o.merged.bc | FileCheck --check-prefix=NOUNROLL %s
; NOUNROLL: br label %loop
; NOUNROLL: br i1 %ec, label %exit, label %loop
; Build with unrolling enabled (by not passing -lto-no-unroll-loops). All
; branches should be gone.
; RUN: llvm-lto %t1.bc -o %t.nounroll.o --exported-symbol=foo -save-merged-module
; RUN: llvm-dis -o - %t.nounroll.o.merged.bc | FileCheck --check-prefix=UNROLL %s
; UNROLL-NOT: br
define void @foo(i32* %ptr) {
entry:
br label %loop
loop:
%iv = phi i32 [ 0, %entry], [ %iv.next, %loop ]
%iv.ptr = getelementptr i32, i32* %ptr, i32 %iv
store i32 %iv, i32* %iv.ptr
%iv.next = add i32 %iv, 1
%ec = icmp eq i32 %iv.next, 10
br i1 %ec, label %exit, label %loop
exit:
ret void
}