[PATCH] Improve Cost model for SLPVectorizer when we have a vector division by power of 2

Karthik Bhat kv.bhat at samsung.com
Thu Aug 21 22:52:25 PDT 2014


Hi Andrea,Sanjay,
It seems like i missed out on some intresting discussion yesterday.
Updating the patch addressing Andrea and Sanjay's comments.

Intrestingly yes UDIV by power of 2 is actually coverted into SRL before it reaches vectorization code so i think checking for UDIV with power of 2 is as good as dead code here. Removed the same.

Opd1PropInfo,Opd2PropInfo actually doesn't effect cost of Instruction::AShr,Instruction::LShr,Instruction::Add as it is used only by SDIV. Having said that i agree it is incorrect to pass old property while getting the cost although they are not used as of now. So updated it to use OP_None.

Updated formatting comments given by Sanjay.
Since now we are only checking for signed division by power of 2 the existing test cases should suffice?

Thanks again for your interest in the patch. Does this now look good to commit?

Thanks and Regards
Karthik Bhat

http://reviews.llvm.org/D4971

Files:
  include/llvm/Analysis/TargetTransformInfo.h
  lib/Analysis/TargetTransformInfo.cpp
  lib/CodeGen/BasicTargetTransformInfo.cpp
  lib/Target/AArch64/AArch64TargetTransformInfo.cpp
  lib/Target/ARM/ARMTargetTransformInfo.cpp
  lib/Target/PowerPC/PPCTargetTransformInfo.cpp
  lib/Target/X86/X86TargetTransformInfo.cpp
  lib/Transforms/Vectorize/LoopVectorize.cpp
  lib/Transforms/Vectorize/SLPVectorizer.cpp
  test/Transforms/LoopVectorize/X86/powof2div.ll
  test/Transforms/SLPVectorizer/X86/powof2div.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4971.12832.patch
Type: text/x-patch
Size: 19945 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140822/a736b93f/attachment.bin>


More information about the llvm-commits mailing list