This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Look through G_ANYEXT and G_IMPLICIT_DEF for constants
AcceptedPublic

Authored by arsenm on Jul 20 2020, 5:38 AM.

Diff Detail

Event Timeline

arsenm created this revision.Jul 20 2020, 5:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2020, 5:38 AM
paquette added inline comments.Jul 21 2020, 2:18 PM
llvm/lib/CodeGen/GlobalISel/Utils.cpp
289

Is there any reason we weren't doing this before?

arsenm marked an inline comment as done.Jul 21 2020, 2:28 PM
arsenm added inline comments.
llvm/lib/CodeGen/GlobalISel/Utils.cpp
289

I don't know. I guess it's slightly weird to just treat these as 0 and not something distinct.

Another oddity is when rolling back the seen casts at the end, no extend is applied. This is also the case for G_INTTOPTR (although I think this case is actually broken)

paquette added inline comments.Jul 21 2020, 2:51 PM
llvm/lib/CodeGen/GlobalISel/Utils.cpp
320

Probably need to add a G_ANYEXT case here?

arsenm updated this revision to Diff 279679.Jul 21 2020, 5:45 PM
This revision is now accepted and ready to land.Jul 22 2020, 9:24 AM
foad added a subscriber: foad.Dec 10 2020, 3:04 AM

Reverse ping! Was there a reason not to apply this?