HomePhabricator

[PowerPC] Fix computation of offset for load-and-splat for permuted loads

Authored by nemanjai on Fri, Jul 24, 12:38 PM.

Description

[PowerPC] Fix computation of offset for load-and-splat for permuted loads

Unfortunately this is another regression from my canonicalization patch
(1fed131660b2). The patch contained two implicit assumptions:

  1. That we would have a permuted load only if we are loading a partial vector
  2. That a partial vector load would necessarily be as wide as the splat

However, assumption 2 is not correct since it is possible to do a wider
load and only splat a half of it. This patch corrects this assumption by
simply checking if the load is permuted and adjusting the offset if it is.

Details

Committed
nemanjaiFri, Jul 24, 12:38 PM
Parents
rG032b78a0762b: [analyzer] Revert the accidental commit of D82122
Branches
Unknown
Tags
Unknown

Event Timeline

MaskRay added a subscriber: hans.Fri, Jul 24, 4:51 PM
MaskRay added a subscriber: MaskRay.
RKSimon added inline comments.
/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
9948

@nemanjai Please can you check this assert as its causing build warning - as it stands it will always be true, is it supposed to be comparing to something?

nemanjai marked an inline comment as done.Sat, Jul 25, 5:24 PM
nemanjai added inline comments.
/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
9948

This is super weird. I build with clang 10.0 with -DLLVM_ENABLE_WERROR=On and it wasn't flagged by any of the -Werror bots either. I'll try building with GCC to see if I can reproduce the warning.

hans added a comment.Mon, Jul 27, 4:04 AM

Nemanja: should we cherry-pick this to the 11.x release branch, since 1fed131660b2 landed before? Are there other fixes that should also be cherry-picked?

hans added a comment.Mon, Jul 27, 7:25 AM

Nemanja: should we cherry-pick this to the 11.x release branch, since 1fed131660b2 landed before? Are there other fixes that should also be cherry-picked?

Ah, I see https://bugs.llvm.org/show_bug.cgi?id=46852 now. I'll follow up there.