[llvm] r338160 - Recommit "Enable MachineOutliner by default under -Oz for AArch64"
Jessica Paquette via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 30 09:44:48 PDT 2018
Hi Galina,
Sorry for the late response; I didn’t check my e-mail over the weekend.
I think this should be fixed by r338267. I don’t have access to a Windows machine, so I can’t verify locally, but it appears that an extra verification pass is added in Windows. When I grep for the line causing the failure, it doesn’t show up in the test output for Linux or macOS.
Hopefully this will fix it!
- Jessica
> On Jul 27, 2018, at 9:19 PM, Galina Kistanova <gkistanova at gmail.com> wrote:
>
> Hello Jessica,
>
> This commit broke tests on one of our builders:
> http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/11299 <http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/11299>
>
> . . .
> Failing Tests (1):
> LLVM :: CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll
>
> Please have a look?
>
> Thanks
>
> Galina
>
> On Fri, Jul 27, 2018 at 1:18 PM, Jessica Paquette via llvm-commits <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
> Author: paquette
> Date: Fri Jul 27 13:18:27 2018
> New Revision: 338160
>
> URL: http://llvm.org/viewvc/llvm-project?rev=338160&view=rev <http://llvm.org/viewvc/llvm-project?rev=338160&view=rev>
> Log:
> Recommit "Enable MachineOutliner by default under -Oz for AArch64"
>
> Fixed the ASAN failure from before in r338148, so recommiting.
>
> This patch enables the MachineOutliner by default in AArch64 under -Oz.
>
> The MachineOutliner offers around a 4.5% improvement on the current -Oz code
> size improvements.
>
> We have done work into improving the debuggability of outlined code, so that
> users of -Oz won't be surprised by the optimization. We have also been executing
> the LLVM test suite and common external tests such as the SPEC suites
> continuously with no issue. The outliner has a low compile-time overhead of
> roughly 1%. At this point, the outliner would be a really good addition to the
> -Oz pass pipeline!
>
> Added:
> llvm/trunk/test/CodeGen/AArch64/machine-outliner-default.mir
> Modified:
> llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp
> llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.h
> llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.cpp
> llvm/trunk/test/CodeGen/AArch64/O3-pipeline.ll
> llvm/trunk/test/CodeGen/AArch64/arm64-memset-to-bzero.ll
> llvm/trunk/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll
> llvm/trunk/test/CodeGen/AArch64/cond-sel.ll
> llvm/trunk/test/CodeGen/AArch64/machine-outliner-flags.ll
> llvm/trunk/test/CodeGen/AArch64/max-jump-table.ll
>
> Modified: llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp?rev=338160&r1=338159&r2=338160&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp?rev=338160&r1=338159&r2=338160&view=diff>
> ==============================================================================
> --- llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp (original)
> +++ llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp Fri Jul 27 13:18:27 2018
> @@ -5482,3 +5482,8 @@ MachineBasicBlock::iterator AArch64Instr
>
> return CallPt;
> }
> +
> +bool AArch64InstrInfo::shouldOutlineFromFunctionByDefault(
> + MachineFunction &MF) const {
> + return MF.getFunction().optForMinSize();
> +}
>
> Modified: llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.h?rev=338160&r1=338159&r2=338160&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.h?rev=338160&r1=338159&r2=338160&view=diff>
> ==============================================================================
> --- llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.h (original)
> +++ llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.h Fri Jul 27 13:18:27 2018
> @@ -249,6 +249,7 @@ public:
> insertOutlinedCall(Module &M, MachineBasicBlock &MBB,
> MachineBasicBlock::iterator &It, MachineFunction &MF,
> const outliner::Candidate &C) const override;
> + bool shouldOutlineFromFunctionByDefault(MachineFunction &MF) const override;
> /// Returns true if the instruction sets to an immediate value that can be
> /// executed more efficiently.
> bool isExynosResetFast(const MachineInstr &MI) const;
>
> Modified: llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.cpp?rev=338160&r1=338159&r2=338160&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.cpp?rev=338160&r1=338159&r2=338160&view=diff>
> ==============================================================================
> --- llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.cpp (original)
> +++ llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.cpp Fri Jul 27 13:18:27 2018
> @@ -255,6 +255,9 @@ AArch64TargetMachine::AArch64TargetMachi
>
> // AArch64 supports the MachineOutliner.
> setMachineOutliner(true);
> +
> + // AArch64 supports default outlining behaviour.
> + setSupportsDefaultOutlining(true);
> }
>
> AArch64TargetMachine::~AArch64TargetMachine() = default;
>
> Modified: llvm/trunk/test/CodeGen/AArch64/O3-pipeline.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/O3-pipeline.ll?rev=338160&r1=338159&r2=338160&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/O3-pipeline.ll?rev=338160&r1=338159&r2=338160&view=diff>
> ==============================================================================
> --- llvm/trunk/test/CodeGen/AArch64/O3-pipeline.ll (original)
> +++ llvm/trunk/test/CodeGen/AArch64/O3-pipeline.ll Fri Jul 27 13:18:27 2018
> @@ -154,6 +154,8 @@
> ; CHECK-NEXT: Insert fentry calls
> ; CHECK-NEXT: Insert XRay ops
> ; CHECK-NEXT: Implement the 'patchable-function' attribute
> +; CHECK-NEXT: Machine Outliner
> +; CHECK-NEXT: FunctionPass Manager
> ; CHECK-NEXT: Lazy Machine Block Frequency Analysis
> ; CHECK-NEXT: Machine Optimization Remark Emitter
> ; CHECK-NEXT: AArch64 Assembly Printer
>
> Modified: llvm/trunk/test/CodeGen/AArch64/arm64-memset-to-bzero.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/arm64-memset-to-bzero.ll?rev=338160&r1=338159&r2=338160&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/arm64-memset-to-bzero.ll?rev=338160&r1=338159&r2=338160&view=diff>
> ==============================================================================
> --- llvm/trunk/test/CodeGen/AArch64/arm64-memset-to-bzero.ll (original)
> +++ llvm/trunk/test/CodeGen/AArch64/arm64-memset-to-bzero.ll Fri Jul 27 13:18:27 2018
> @@ -1,6 +1,6 @@
> -; RUN: llc %s -mtriple=arm64-apple-darwin -o - | \
> -; RUN: FileCheck --check-prefixes=CHECK,CHECK-DARWIN %s
> -; RUN: llc %s -mtriple=arm64-linux-gnu -o - | \
> +; RUN: llc %s -enable-machine-outliner=never -mtriple=arm64-apple-darwin -o - \
> +; RUN: | FileCheck --check-prefixes=CHECK,CHECK-DARWIN %s
> +; RUN: llc %s -enable-machine-outliner=never -mtriple=arm64-linux-gnu -o - | \
> ; RUN: FileCheck --check-prefixes=CHECK,CHECK-LINUX %s
> ; <rdar://problem/14199482> ARM64: Calls to bzero() replaced with calls to memset()
>
>
> Modified: llvm/trunk/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll?rev=338160&r1=338159&r2=338160&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll?rev=338160&r1=338159&r2=338160&view=diff>
> ==============================================================================
> --- llvm/trunk/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll (original)
> +++ llvm/trunk/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll Fri Jul 27 13:18:27 2018
> @@ -26,8 +26,8 @@
> ; requested. (This hard-codes the previous pass to the Assembly Printer,
> ; please adjust accordingly.)
>
> -; HOTNESS: Executing Pass 'Implement the 'patchable-function' attribute'
> -; HOTNESS-NEXT: Freeing Pass 'Implement the 'patchable-function' attribute'
> +; HOTNESS: Freeing Pass 'Machine Outliner'
> +; HOTNESS-NEXT: Executing Pass 'Function Pass Manager'
> ; HOTNESS-NEXT: Executing Pass 'Lazy Machine Block Frequency Analysis'
> ; HOTNESS-NEXT: Executing Pass 'Machine Optimization Remark Emitter'
> ; HOTNESS-NEXT: Building MachineBlockFrequencyInfo on the fly
> @@ -41,8 +41,8 @@
> ; HOTNESS: arm64-summary-remarks.ll:5:0: 1 instructions in function (hotness: 33)
>
>
> -; NO_HOTNESS: Executing Pass 'Implement the 'patchable-function' attribute'
> -; NO_HOTNESS-NEXT: Freeing Pass 'Implement the 'patchable-function' attribute'
> +; NO_HOTNESS: Freeing Pass 'Machine Outliner'
> +; NO_HOTNESS-NEXT: Executing Pass 'Function Pass Manager'
> ; NO_HOTNESS-NEXT: Executing Pass 'Lazy Machine Block Frequency Analysis'
> ; NO_HOTNESS-NEXT: Executing Pass 'Machine Optimization Remark Emitter'
> ; NO_HOTNESS-NEXT: Executing Pass 'AArch64 Assembly Printer'
>
> Modified: llvm/trunk/test/CodeGen/AArch64/cond-sel.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/cond-sel.ll?rev=338160&r1=338159&r2=338160&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/cond-sel.ll?rev=338160&r1=338159&r2=338160&view=diff>
> ==============================================================================
> --- llvm/trunk/test/CodeGen/AArch64/cond-sel.ll (original)
> +++ llvm/trunk/test/CodeGen/AArch64/cond-sel.ll Fri Jul 27 13:18:27 2018
> @@ -1,5 +1,5 @@
> -; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -mcpu=cyclone | FileCheck %s
> -; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -mattr=-fp-armv8 | FileCheck --check-prefix=CHECK-NOFP %s
> +; RUN: llc -enable-machine-outliner=never -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -mcpu=cyclone | FileCheck %s
> +; RUN: llc -enable-machine-outliner=never -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -mattr=-fp-armv8 | FileCheck --check-prefix=CHECK-NOFP %s
>
> @var32 = global i32 0
> @var64 = global i64 0
>
> Added: llvm/trunk/test/CodeGen/AArch64/machine-outliner-default.mir
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/machine-outliner-default.mir?rev=338160&view=auto <http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/machine-outliner-default.mir?rev=338160&view=auto>
> ==============================================================================
> --- llvm/trunk/test/CodeGen/AArch64/machine-outliner-default.mir (added)
> +++ llvm/trunk/test/CodeGen/AArch64/machine-outliner-default.mir Fri Jul 27 13:18:27 2018
> @@ -0,0 +1,71 @@
> +# RUN: llc -mtriple=aarch64--- -run-pass=machine-outliner \
> +# RUN: -verify-machineinstrs %s -o - | FileCheck %s
> +
> +--- |
> + define void @outline_1() #0 { ret void }
> + define void @outline_2() #0 { ret void }
> + define void @outline_3() #0 { ret void }
> + define void @dont_outline() #1 { ret void }
> +
> + attributes #0 = { noredzone minsize optsize }
> + attributes #1 = { noredzone }
> +...
> +---
> +
> +name: outline_1
> +tracksRegLiveness: true
> +body: |
> + bb.0:
> + ; CHECK-LABEL: bb.0:
> + ; CHECK: OUTLINED
> + liveins: $w8, $wzr
> + $w8 = ORRWri $wzr, 1
> + $w8 = ORRWri $wzr, 2
> + $w8 = ORRWri $wzr, 3
> + $w8 = ORRWri $wzr, 4
> + RET undef $lr
> +...
> +---
> +
> +name: outline_2
> +tracksRegLiveness: true
> +body: |
> + bb.0:
> + ; CHECK-LABEL: bb.0:
> + ; CHECK: OUTLINED
> + liveins: $w8, $wzr
> + $w8 = ORRWri $wzr, 1
> + $w8 = ORRWri $wzr, 2
> + $w8 = ORRWri $wzr, 3
> + $w8 = ORRWri $wzr, 4
> + RET undef $lr
> +...
> +---
> +
> +name: outline_3
> +tracksRegLiveness: true
> +body: |
> + bb.0:
> + ; CHECK-LABEL: bb.0:
> + ; CHECK: OUTLINED
> + liveins: $w8, $wzr
> + $w8 = ORRWri $wzr, 1
> + $w8 = ORRWri $wzr, 2
> + $w8 = ORRWri $wzr, 3
> + $w8 = ORRWri $wzr, 4
> + RET undef $lr
> +...
> +---
> +
> +name: dont_outline
> +tracksRegLiveness: true
> +body: |
> + bb.0:
> + ; CHECK-LABEL: bb.0:
> + ; CHECK-NOT: BL
> + liveins: $w8, $wzr
> + $w8 = ORRWri $wzr, 1
> + $w8 = ORRWri $wzr, 2
> + $w8 = ORRWri $wzr, 3
> + $w8 = ORRWri $wzr, 4
> + RET undef $lr
>
> Modified: llvm/trunk/test/CodeGen/AArch64/machine-outliner-flags.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/machine-outliner-flags.ll?rev=338160&r1=338159&r2=338160&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/machine-outliner-flags.ll?rev=338160&r1=338159&r2=338160&view=diff>
> ==============================================================================
> --- llvm/trunk/test/CodeGen/AArch64/machine-outliner-flags.ll (original)
> +++ llvm/trunk/test/CodeGen/AArch64/machine-outliner-flags.ll Fri Jul 27 13:18:27 2018
> @@ -14,7 +14,7 @@
> ; RUN: | FileCheck %s -check-prefix=NEVER
>
> ; RUN: llc %s -debug-pass=Structure -verify-machineinstrs \
> -; RUN: -mtriple arm64---- -o /dev/null 2>&1 \
> +; RUN: --debug-only=machine-outliner -mtriple arm64---- -o /dev/null 2>&1 \
> ; RUN: | FileCheck %s -check-prefix=NOT-ADDED
>
> ; RUN: llc %s -O=0 -debug-pass=Structure -verify-machineinstrs \
> @@ -27,10 +27,11 @@
> ; Cases where it should be added:
> ; * -enable-machine-outliner
> ; * -enable-machine-outliner=always
> +; * -enable-machine-outliner is not passed (AArch64 supports
> +; target-default outlining)
> ;
> ; Cases where it should not be added:
> ; * -O0 or equivalent
> -; * -enable-machine-outliner is not passed
> ; * -enable-machine-outliner=never is passed
>
> ; ALWAYS: Machine Outliner
> @@ -38,7 +39,8 @@
> ; ENABLE: Machine Outliner
> ; ENABLE: Machine Outliner: Running on all functions
> ; NEVER-NOT: Machine Outliner
> -; NOT-ADDED-NOT: Machine Outliner
> +; NOT-ADDED: Machine Outliner
> +; NOT-ADDED: Machine Outliner: Running on target-default functions
> ; OPTNONE-NOT: Machine Outliner
>
> define void @foo() {
>
> Modified: llvm/trunk/test/CodeGen/AArch64/max-jump-table.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/max-jump-table.ll?rev=338160&r1=338159&r2=338160&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/max-jump-table.ll?rev=338160&r1=338159&r2=338160&view=diff>
> ==============================================================================
> --- llvm/trunk/test/CodeGen/AArch64/max-jump-table.ll (original)
> +++ llvm/trunk/test/CodeGen/AArch64/max-jump-table.ll Fri Jul 27 13:18:27 2018
> @@ -89,6 +89,7 @@ entry:
> ; CHECKM1-NOT: %jump-table.1
> ; CHECKM3-NEXT: %jump-table.0: %bb.1 %bb.2 %bb.3 %bb.4 %bb.7 %bb.7 %bb.7 %bb.7 %bb.7 %bb.7 %bb.7 %bb.7 %bb.7 %bb.5 %bb.6{{$}}
> ; CHECKM3-NOT: %jump-table.1
> +; CHECK-DAG: End machine code for function jt2.
>
> bb1: tail call void @ext(i32 1) br label %return
> bb2: tail call void @ext(i32 2) br label %return
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180730/7fa9cf58/attachment.html>
More information about the llvm-commits
mailing list