[PATCH] [PPC64LE] Remove unnecessary swaps from lane-insensitive vector computations
Eric Christopher
echristo at gmail.com
Mon Mar 30 13:15:24 PDT 2015
Why is a command line option a subtarget feature? More comments inline...
-eric
REPOSITORY
rL LLVM
================
Comment at: lib/Target/PowerPC/PPCTargetMachine.cpp:312
@@ +311,3 @@
+ TargetPassConfig::addMachineSSAOptimization();
+ if (Triple(TM->getTargetTriple()).getArch() == Triple::ppc64le)
+ addPass(createPPCVSXSwapRemovalPass());
----------------
Comment on why.
================
Comment at: lib/Target/PowerPC/PPCVSXSwapRemoval.cpp:110
@@ +109,3 @@
+ // their swap entries. The key is the address of the MI.
+ std::map<MachineInstr*, int> SwapMap;
+
----------------
DenseMap?
================
Comment at: lib/Target/PowerPC/PPCVSXSwapRemoval.cpp:204
@@ +203,3 @@
+
+ const int InitialVectorSize(256);
+ SwapVector.clear();
----------------
256?
================
Comment at: lib/Target/PowerPC/PPCVSXSwapRemoval.cpp:251
@@ +250,3 @@
+ switch(MI->getOpcode()) {
+ default:
+ // Unless noted otherwise, an instruction is considered
----------------
What instructions not listed are you thinking here?
================
Comment at: lib/Target/PowerPC/PPCVSXSwapRemoval.cpp:614
@@ +613,3 @@
+
+ for (MachineInstr &UseMI : MRI->use_nodbg_instructions(DefReg)) {
+ int UseIdx = SwapMap[&UseMI];
----------------
Good point, what _does_ this do for debug info? :)
================
Comment at: lib/Target/PowerPC/PPCVSXSwapRemoval.cpp:646
@@ +645,3 @@
+// here.
+void PPCVSXSwapRemoval::handleSpecialSwappables(int EntryIdx) {
+}
----------------
?
http://reviews.llvm.org/D8565
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list