This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine][SVE] Bail out of isSafeToLoadUnconditionally for scalable types
ClosedPublic

Authored by peterwaller-arm on Jul 11 2022, 4:08 AM.

Details

Summary

isSafeToLoadUnconditionally currently assumes sized types. Bail out for now.
This fixes a TypeSize warning reachable from instcombine via (load (select
cond, ptr, ptr)).

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald Transcript
peterwaller-arm requested review of this revision.Jul 11 2022, 4:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2022, 4:09 AM
david-arm added inline comments.Jul 11 2022, 4:48 AM
llvm/lib/Analysis/Loads.cpp
411

Here you're still relying upon the implicit cast from TypeSize->uint64_t, which we're trying to avoid. I think it's better to write this explicitly as:

APInt Size(DL.getIndexTypeSizeInBits(V->getType()), TySize.getFixedValue());
llvm/test/Transforms/InstCombine/scalable-select.ll
20

This test is missing some CHECK lines

Address review comments: Run test checks, use TySize.getFixedValue()

david-arm accepted this revision.Jul 11 2022, 4:56 AM

LGTM! Merci!

This revision is now accepted and ready to land.Jul 11 2022, 4:56 AM
Matt added a subscriber: Matt.Jul 11 2022, 3:27 PM
This revision was landed with ongoing or failed builds.Jul 13 2022, 3:14 AM
This revision was automatically updated to reflect the committed changes.