[PATCH] D12731: [InstCombine] CVTPH2PS Vector Demanded Elements + Constant Folding

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 13:25:05 PDT 2015


ab added inline comments.

================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:846-857
@@ -799,13 +845,14 @@
+
   case Intrinsic::x86_sse_storeu_ps:
   case Intrinsic::x86_sse2_storeu_pd:
   case Intrinsic::x86_sse2_storeu_dq:
     // Turn X86 storeu -> store if the pointer is known aligned.
     if (getOrEnforceKnownAlignment(II->getArgOperand(0), 16, DL, II, AC, DT) >=
         16) {
       Type *OpPtrTy =
         PointerType::getUnqual(II->getArgOperand(1)->getType());
       Value *Ptr = Builder->CreateBitCast(II->getArgOperand(0), OpPtrTy);
       return new StoreInst(II->getArgOperand(1), Ptr);
     }
     break;
 
----------------
RKSimon wrote:
> ab wrote:
> > I couldn't help but notice that this is very similar to the ppc case above.  All else being equal, can you keep them together?
> > 
> > Plus, the ph2ps case is similar to ss2si below!
> Yes there is a lot of code duplication going in this file - splitting off common code into helper functions should be quite straightforward.
Right: in case I wasn't clear, I'm not saying you should refactor the entire function for this patch, just to move the added ph2ps case block between storeu and cvtss2si.


Repository:
  rL LLVM

http://reviews.llvm.org/D12731





More information about the llvm-commits mailing list