This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Refactor unary FP op constant folding
ClosedPublic

Authored by arsenm on May 9 2023, 2:47 AM.

Diff Detail

Unit TestsFailed

Event Timeline

arsenm created this revision.May 9 2023, 2:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2023, 2:47 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
arsenm requested review of this revision.May 9 2023, 2:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2023, 2:47 AM
Herald added a subscriber: wdng. · View Herald Transcript

LGTM, just a small style nit

llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
1294

small nit: not a fan of having V/Val in the same function, the names get confusing - maybe use something like Ret instead? Or rename the Val parameter to something more descriptive.

1307

If I understand correctly this is a NFC, G_FPTRUNC was handled anyway by the V.convert call below, but now it's explicit?

Pierre-vh accepted this revision.May 9 2023, 3:07 AM
This revision is now accepted and ready to land.May 9 2023, 3:07 AM
arsenm added inline comments.May 9 2023, 3:52 AM
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
1307

Yes, the LLT-to-semantics is only used for fptrunc now.

I'm thinking of moving FPTRUNC handling out of here entirely. It's an annoying special case complicating another patch I'm working on