This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Don't try to narrow extending loads/trunc store
ClosedPublic

Authored by arsenm on Feb 13 2020, 12:19 PM.

Details

Summary

If the loaded memory size was smaller than the result size, this would
produce out of bounds memory accesses. I'm wondering if we need a
distinct narrow memory legalize action type, since a case I care about
is decomposing a 4-byte unaligned access into 4 extending loads, which
would leave the original result register type. I'm currently awkwardly
using narrowScalar to handle unaligned accesses that need to be split.

Diff Detail

Event Timeline

arsenm created this revision.Feb 13 2020, 12:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 13 2020, 12:19 PM
paquette accepted this revision.Mar 10 2020, 2:32 PM

This seems reasonable to me.

llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
3125–3126

Can we have some debug output explaining what's happening here?

This revision is now accepted and ready to land.Mar 10 2020, 2:32 PM