[llvm] r274329 - AMDGPU: Add option to run the load/store vectorizer
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 30 20:33:52 PDT 2016
Author: arsenm
Date: Thu Jun 30 22:33:52 2016
New Revision: 274329
URL: http://llvm.org/viewvc/llvm-project?rev=274329&view=rev
Log:
AMDGPU: Add option to run the load/store vectorizer
Modified:
llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp?rev=274329&r1=274328&r2=274329&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp Thu Jun 30 22:33:52 2016
@@ -39,6 +39,7 @@
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Scalar/GVN.h"
+#include "llvm/Transforms/Vectorize.h"
using namespace llvm;
@@ -59,6 +60,13 @@ static cl::opt<bool> EnableR600IfConvert
cl::ReallyHidden,
cl::init(true));
+// Option to disable vectorizer for tests.
+static cl::opt<bool> EnableLoadStoreVectorizer(
+ "amdgpu-load-store-vectorizer",
+ cl::desc("Enable load store vectorizer"),
+ cl::init(false),
+ cl::Hidden);
+
extern "C" void LLVMInitializeAMDGPUTarget() {
// Register the target
RegisterTargetMachine<R600TargetMachine> X(TheAMDGPUTarget);
@@ -267,6 +275,7 @@ public:
void addEarlyCSEOrGVNPass();
void addStraightLineScalarOptimizationPasses();
void addIRPasses() override;
+ void addCodeGenPrepare() override;
bool addPreISel() override;
bool addInstSelector() override;
bool addGCPasses() override;
@@ -392,6 +401,13 @@ void AMDGPUPassConfig::addIRPasses() {
addEarlyCSEOrGVNPass();
}
+void AMDGPUPassConfig::addCodeGenPrepare() {
+ TargetPassConfig::addCodeGenPrepare();
+
+ if (EnableLoadStoreVectorizer)
+ addPass(createLoadStoreVectorizerPass());
+}
+
bool AMDGPUPassConfig::addPreISel() {
addPass(createFlattenCFGPass());
return false;
More information about the llvm-commits
mailing list