[PATCH] D77524: [TargetPassConfig] Add CanonicalizeFreezeInLoops before LSR
Juneyoung Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 20 18:48:37 PDT 2020
aqjune updated this revision to Diff 265404.
aqjune added a comment.
Precommit test
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77524/new/
https://reviews.llvm.org/D77524
Files:
llvm/lib/CodeGen/TargetPassConfig.cpp
llvm/test/CodeGen/AArch64/O3-pipeline.ll
llvm/test/CodeGen/ARM/O3-pipeline.ll
llvm/test/CodeGen/X86/O3-pipeline.ll
llvm/test/Transforms/CanonicalizeFreezeInLoops/aarch64.ll
Index: llvm/test/Transforms/CanonicalizeFreezeInLoops/aarch64.ll
===================================================================
--- llvm/test/Transforms/CanonicalizeFreezeInLoops/aarch64.ll
+++ llvm/test/Transforms/CanonicalizeFreezeInLoops/aarch64.ll
@@ -7,13 +7,12 @@
define void @f(i8* %p, i32 %n, i32 %m) {
; CHECK-LABEL: f:
; CHECK: // %bb.0: // %entry
-; CHECK-NEXT: mov w8, #1
+; CHECK-NEXT: add w8, w2, #1 // =1
; CHECK-NEXT: .LBB0_1: // %loop
; CHECK-NEXT: // =>This Inner Loop Header: Depth=1
-; CHECK-NEXT: add w9, w2, w8
-; CHECK-NEXT: cmp w8, w1
+; CHECK-NEXT: strb wzr, [x0, w8, sxtw]
+; CHECK-NEXT: subs w1, w1, #1 // =1
; CHECK-NEXT: add w8, w8, #1 // =1
-; CHECK-NEXT: strb wzr, [x0, w9, sxtw]
; CHECK-NEXT: b.ne .LBB0_1
; CHECK-NEXT: // %bb.2: // %exit
; CHECK-NEXT: ret
Index: llvm/test/CodeGen/X86/O3-pipeline.ll
===================================================================
--- llvm/test/CodeGen/X86/O3-pipeline.ll
+++ llvm/test/CodeGen/X86/O3-pipeline.ll
@@ -27,6 +27,7 @@
; CHECK-NEXT: Canonicalize natural loops
; CHECK-NEXT: Scalar Evolution Analysis
; CHECK-NEXT: Loop Pass Manager
+; CHECK-NEXT: Canonicalize Freeze Instructions in Loops
; CHECK-NEXT: Induction Variable Users
; CHECK-NEXT: Loop Strength Reduction
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
Index: llvm/test/CodeGen/ARM/O3-pipeline.ll
===================================================================
--- llvm/test/CodeGen/ARM/O3-pipeline.ll
+++ llvm/test/CodeGen/ARM/O3-pipeline.ll
@@ -15,6 +15,7 @@
; CHECK-NEXT: Canonicalize natural loops
; CHECK-NEXT: Scalar Evolution Analysis
; CHECK-NEXT: Loop Pass Manager
+; CHECK-NEXT: Canonicalize Freeze Instructions in Loops
; CHECK-NEXT: Induction Variable Users
; CHECK-NEXT: Loop Strength Reduction
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
Index: llvm/test/CodeGen/AArch64/O3-pipeline.ll
===================================================================
--- llvm/test/CodeGen/AArch64/O3-pipeline.ll
+++ llvm/test/CodeGen/AArch64/O3-pipeline.ll
@@ -35,6 +35,7 @@
; CHECK-NEXT: Module Verifier
; CHECK-NEXT: Canonicalize natural loops
; CHECK-NEXT: Loop Pass Manager
+; CHECK-NEXT: Canonicalize Freeze Instructions in Loops
; CHECK-NEXT: Induction Variable Users
; CHECK-NEXT: Loop Strength Reduction
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
Index: llvm/lib/CodeGen/TargetPassConfig.cpp
===================================================================
--- llvm/lib/CodeGen/TargetPassConfig.cpp
+++ llvm/lib/CodeGen/TargetPassConfig.cpp
@@ -668,6 +668,7 @@
// Run loop strength reduction before anything else.
if (getOptLevel() != CodeGenOpt::None && !DisableLSR) {
+ addPass(createCanonicalizeFreezeInLoopsPass());
addPass(createLoopStrengthReducePass());
if (PrintLSR)
addPass(createPrintFunctionPass(dbgs(), "\n\n*** Code after LSR ***\n"));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77524.265404.patch
Type: text/x-patch
Size: 3076 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200521/288091a7/attachment-0001.bin>
More information about the llvm-commits
mailing list