[PATCH] Add support to recognize non SIMD kind of parallelism in SLPVectorizer

Karthik Bhat kv.bhat at samsung.com
Fri Jun 6 06:24:42 PDT 2014


Hi Arnold,
Thanks for the review. Yes i have run llvm regression test cases in debug and release modes and there are no failures. I'm yet to generate performance results for this patch. Will try to collect it over weekend.

Checking Opcode != Instruction::ShuffleVector was an experimental code unfortunetly i forgot to remove it while submitting the patch. Updated the patch to remove wrongly added code. Thanks for highlighting it I will be more careful next time.

Updated the cost model to use getShuffleCost and added a new ShuffleKind (SK_Alternate).
I have not yet handled SK_Alternate separately and we are returning default cost of 1 as with SK_Broadcast etc.) 
I have added a TODO to handle cost model for shuffle vector in a better way as i can see that with current cost model sequences generated from code such as-
  float c[4];
  float a;
  float b;
  void foo () {
    c[0]= a+b;
    c[1] = a-b;
    c[2] = a+b;
    c[3] = a-b;
  }
are not getting converted in shuffle vector.(it works when we set a lower -slp-threshold). It also works when both a and b are arrays.(e.g. test case attached in this patch (addsub.ll) )

Thanks for your inputs and time.
Regards
Karthik Bhat

http://reviews.llvm.org/D4015

Files:
  include/llvm/Analysis/TargetTransformInfo.h
  lib/Transforms/Vectorize/SLPVectorizer.cpp
  test/Transforms/SLPVectorizer/X86/addsub.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4015.10177.patch
Type: text/x-patch
Size: 11108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140606/162c8afb/attachment.bin>


More information about the llvm-commits mailing list