[PATCH] D25914: Redo store splitting in CodeGenPrepare

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 28 10:15:17 PST 2016


wmi added inline comments.


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:5300-5301
+                                const TargetLowering &TLI) {
+  unsigned HalfValBitSize =
+      DL.getTypeSizeInBits(SI.getValueOperand()->getType()) / 2;
+
----------------
majnemer wrote:
> This looks wrong. Shouldn't it be `getTypeStoreSizeInBits` instead of `getTypeSizeInBits`?
They are the same here because the type of the store value must have power of 2 size if it is a merged store. But you remind me to add some testcases: @int31_float_pair, @int15_float_pair, @int7_float_pair added in the testcase. 


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:5303
+
+  // match the following patterns:
+  // (store (or (zext LValue to i64),
----------------
majnemer wrote:
> Start with an uppercase letter.
Fixed.


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:5327-5328
+  // as the input of target query.
+  BitCastInst *LBC = dyn_cast<BitCastInst>(LValue);
+  BitCastInst *HBC = dyn_cast<BitCastInst>(HValue);
+  EVT LowTy = LBC ? EVT::getEVT(LBC->getOperand(0)->getType())
----------------
majnemer wrote:
> `auto *`
Fixed.


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:5347
+
+  auto CreateSplittedStore = [&](Value *V, bool Upper) {
+    Type *Ty = Type::getIntNTy(SI.getContext(), HalfValBitSize);
----------------
chandlerc wrote:
> CreateSplittedStore -> CreateSplitStore
Fixed.


Repository:
  rL LLVM

https://reviews.llvm.org/D25914





More information about the llvm-commits mailing list