[SystemZ] Avoid type legalization on structs
authorJosh Stone <jistone@redhat.com>
Wed, 26 Jul 2023 22:00:58 +0000 (15:00 -0700)
committerTobias Hieta <tobias@hieta.se>
Tue, 22 Aug 2023 05:45:18 +0000 (07:45 +0200)
commit7470d9a13088f97959f0e58519a72dbf537f1e59
treec17aae16585e325b20a3601c011dfc1e72c57587
parentefcacdb0f9c71bd631aba3ee896a1c54306ad0be
[SystemZ] Avoid type legalization on structs

In SystemZTTIImpl::getMemoryOpCost, the call to getNumberOfParts will
run type legalization, which can't handle structs. So before that, we
check for an unknown value type and forward to BaseT, just like many
other targets do in this situation.

https://bugzilla.redhat.com/show_bug.cgi?id=2224885

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D156379

(cherry picked from commit 85e4ee15d32ae0344755d11d4ca90a15a6e005cd)
llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
llvm/test/Analysis/CostModel/SystemZ/struct-cost-crash.ll [new file with mode: 0644]