[PATCH] D113285: [AArch64TargetMachine] Improve codegenprep for agressive mode

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 5 08:14:47 PDT 2021


djtodoro created this revision.
djtodoro added a project: LLVM.
Herald added subscribers: hiraditya, kristof.beyls.
djtodoro requested review of this revision.
Herald added a subscriber: llvm-commits.

This improves the AArch64 Target Machine, since the SeparateConstOffsetFromGEP is being run.

TODO: Get the data on SPEC benchmark.

Co-authored-by: @mmatic05, @milica-lazarevic, @dmilosevic141


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113285

Files:
  llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
  llvm/test/CodeGen/AArch64/O3-pipeline.ll


Index: llvm/test/CodeGen/AArch64/O3-pipeline.ll
===================================================================
--- llvm/test/CodeGen/AArch64/O3-pipeline.ll
+++ llvm/test/CodeGen/AArch64/O3-pipeline.ll
@@ -79,6 +79,18 @@
 ; CHECK-NEXT:       Natural Loop Information
 ; CHECK-NEXT:      Scalar Evolution Analysis
 ; CHECK-NEXT:      Split GEPs to a variadic base and a constant offset for better CSE
+; CHECK-NEXT:      Scalar Evolution Analysis
+; CHECK-NEXT:      Straight line strength reduction
+; CHECK-NEXT:      Phi Values Analysis
+; CHECK-NEXT:      Basic Alias Analysis (stateless AA impl)
+; CHECK-NEXT:      Function Alias Analysis Results
+; CHECK-NEXT:      Memory Dependence Analysis
+; CHECK-NEXT:      Lazy Branch Probability Analysis
+; CHECK-NEXT:      Lazy Block Frequency Analysis
+; CHECK-NEXT:      Optimization Remark Emitter
+; CHECK-NEXT:      Global Value Numbering
+; CHECK-NEXT:      Scalar Evolution Analysis
+; CHECK-NEXT:      Nary reassociation
 ; CHECK-NEXT:      Early CSE
 ; CHECK-NEXT:      Basic Alias Analysis (stateless AA impl)
 ; CHECK-NEXT:      Function Alias Analysis Results
Index: llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
+++ llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
@@ -43,6 +43,7 @@
 #include "llvm/Target/TargetLoweringObjectFile.h"
 #include "llvm/Target/TargetOptions.h"
 #include "llvm/Transforms/CFGuard.h"
+#include "llvm/Transforms/Scalar/GVN.h"
 #include "llvm/Transforms/Scalar.h"
 #include <memory>
 #include <string>
@@ -551,6 +552,11 @@
     // and lower a GEP with multiple indices to either arithmetic operations or
     // multiple GEPs with single index.
     addPass(createSeparateConstOffsetFromGEPPass(true));
+    addPass(createStraightLineStrengthReducePass());
+    // SeparateConstOffsetFromGEP and SLSR creates common expressions which GVN
+    // can optimize.
+    addPass(createGVNPass());
+    addPass(createNaryReassociatePass());
     // Call EarlyCSE pass to find and remove subexpressions in the lowered
     // result.
     addPass(createEarlyCSEPass());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113285.385078.patch
Type: text/x-patch
Size: 2178 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211105/b1726449/attachment.bin>


More information about the llvm-commits mailing list