This is an archive of the discontinued LLVM Phabricator instance.

[SVE][IR] Fix Binary op matching in PatternMatch::m_VScale
ClosedPublic

Authored by DylanFleming-arm on Jul 14 2021, 6:47 AM.

Diff Detail

Event Timeline

DylanFleming-arm requested review of this revision.Jul 14 2021, 6:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2021, 6:47 AM
DylanFleming-arm retitled this revision from [IR] Fix Binary op matching in PatternMatch::m_VScale to [SVE][IR] Fix Binary op matching in PatternMatch::m_VScale.Jul 14 2021, 6:49 AM

I'm surprised how we've never hit this until now. Mostly looks good to me, just a few nits.

llvm/include/llvm/IR/PatternMatch.h
2435

nit: can you make this: GEP->getNumIndices() == 1?

2438

nit: please move this condition earlier, so that a simple condition that's likely to evaluate to false, is evaluated first.

llvm/unittests/IR/PatternMatch.cpp
1640

nit: unnecessary newline

1645

You can write VecTy->getPointerTo() and remove VecPtrTy.

1651

Same comment as above, you can write VecTy2->getPointerTo()

Matt added a subscriber: Matt.Jul 14 2021, 9:18 AM

Restructured if statment

Cleaned up code:
Removed unneeded newline
Changed PointerType::get() to ->getPointerType()

sdesmalen accepted this revision.Jul 19 2021, 1:51 AM
sdesmalen added inline comments.
llvm/unittests/IR/PatternMatch.cpp
1649

nit: Can you add a comment saying that this used to cause an assertion-failure before this patch?

This revision is now accepted and ready to land.Jul 19 2021, 1:51 AM