This is an archive of the discontinued LLVM Phabricator instance.

[LoopVectorize] Merge UnaryOperator and BinaryOperator handling
AbandonedPublic

Authored by craig.topper on May 28 2019, 10:53 AM.

Details

Summary

This is a follow up to D62510 where UnaryOperator was added. It was suggested that we have common handling for UnaryOperator and BinaryOperator

Diff Detail

Event Timeline

craig.topper created this revision.May 28 2019, 10:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 28 2019, 10:53 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
fhahn accepted this revision.May 28 2019, 11:09 AM

LGTM, IMO it makes sense to add this helper here.

llvm/include/llvm/IR/IRBuilder.h
1386

Maybe worth a comment that it either creates a binop or unaryop and Opc must be valid accordingly.

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
3988

nit: Could be just `

for (Value *Op : operands())  
   Ops.push_back(getOrCreateVectorValue(Op, Part));
This revision is now accepted and ready to land.May 28 2019, 11:09 AM
craig.topper abandoned this revision.May 30 2019, 12:00 AM

Merged into D62510