This is an archive of the discontinued LLVM Phabricator instance.

[LLVM][LTO][NFC] Resolve FIXME in ThinLTOCodeGenerator.cpp
AbandonedPublic

Authored by gAlfonso-bit on Aug 4 2021, 8:59 AM.

Details

Reviewers
mehdi_amini
steven_wu
jrtc27
Group Reviewers
Restricted Project
Summary

Made the complicated if statements into a switch statement.

Diff Detail

Event Timeline

gAlfonso-bit created this revision.Aug 4 2021, 8:59 AM
gAlfonso-bit requested review of this revision.Aug 4 2021, 8:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2021, 8:59 AM

+ mehdi

I think the FIXME is about not duplicating code from LTOCodeGenerator, not how terrible if statement looks.

That is said, I am fine with the clean up but this probably doesn't resolve FIXME.

This comment was removed by gAlfonso-bit.

Mirrored changes into LTOCodeGenerator.cpp, since the original code was from there.

Can you unify the duplicated code or just put the FIXME back saying need to fix the duplicated code in the future?

Does the original code break any linter? Or it is just an attempt to rewrite the code using switch?

jrtc27 requested changes to this revision.Aug 24 2021, 2:01 PM
jrtc27 added a subscriber: jrtc27.
jrtc27 added inline comments.
llvm/lib/LTO/LTOCodeGenerator.cpp
347 ↗(On Diff #364993)

You've deleted this

This revision now requires changes to proceed.Aug 24 2021, 2:01 PM
gAlfonso-bit marked an inline comment as done.

Readded arm64e detection

Can you unify the duplicated code or just put the FIXME back saying need to fix the duplicated code in the future?

Does the original code break any linter? Or it is just an attempt to rewrite the code using switch?

Should I just have the logic in a function? If I do, should I assume macOS is the target and cpu is empty or should I add those checks in the function?

gAlfonso-bit abandoned this revision.Sep 30 2021, 2:36 PM