This is an archive of the discontinued LLVM Phabricator instance.

[X86] Use (SUBREG_TO_REG (MOV32rm)) for extloadi64i8/extloadi64i16 when the load is 4 byte aligned or better and not volatile.
ClosedPublic

Authored by craig.topper on Apr 5 2019, 2:46 PM.

Details

Summary

Previously we would use MOVZXrm8/MOVZXrm16, but those are longer encodings.

This is similar to what we do in the loadi32 predicate.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Apr 5 2019, 2:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2019, 2:46 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
RKSimon accepted this revision.Apr 7 2019, 5:46 AM

LGTM - although I'm a little surprised that <4 x i1> has an alignment >= 4

llvm/test/CodeGen/X86/vector-sext-widen.ll
1494 ↗(On Diff #193973)

I'm a little surprised that <4 x i1> is assumed to have a alignment >= 4

This revision is now accepted and ready to land.Apr 7 2019, 5:46 AM
This revision was automatically updated to reflect the committed changes.
craig.topper marked an inline comment as done.Apr 7 2019, 12:18 PM
craig.topper added inline comments.
llvm/test/CodeGen/X86/vector-sext-widen.ll
1494 ↗(On Diff #193973)

It appears data layout takes element allocation size which I guess is rounded up to a byte, then multiplies by element count.