Page MenuHomePhabricator

[AARCH64][NEON] Allow to sink operands of aarch64_neon_pmull64.
ClosedPublic

Authored by avl on Wed, May 20, 1:51 PM.

Details

Summary

This patch fixes a problem when pmull2 instruction is not
generated for vmull_high_p64 intrinsic.

ISel has a pattern for int_aarch64_neon_pmull64 intrinsic to generate
PMULL2 instruction. That pattern assumes that extraction operations
are located in the same basic block. We need to sink them
if they are not. Handle operands of int_aarch64_neon_pmull64
into AArch64TargetLowering::shouldSinkOperands.

Diff Detail

Event Timeline

avl created this revision.Wed, May 20, 1:51 PM
efriedma added inline comments.Wed, May 20, 3:34 PM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
9403

Op can't be null.

9408

CI->getValue()

9411

VectorType::getNumElements() is deprecated; please dyn_cast<> to FixedVectorType.

9416

The check for the size is redundant; a two-element vector with i64 elements must be a 128-bit vector.

9435

getArgOperand()

dmgreen added inline comments.
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
9407

This wouldn't return false on non-constant operands either. (Not that I would expect that to come up much!)

You might find that the m_ExtractElement style pattern matchers make this simpler to handle.

avl updated this revision to Diff 265522.Thu, May 21, 9:34 AM

addressed comments.

efriedma accepted this revision.Thu, May 21, 11:14 AM

LGTM with a couple minor nits.

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
9409

cast<>

9438

getArgOperandUse

This revision is now accepted and ready to land.Thu, May 21, 11:14 AM
avl added a comment.Thu, May 21, 12:08 PM

Thank you.

This revision was automatically updated to reflect the committed changes.