This is an archive of the discontinued LLVM Phabricator instance.

[EarlyCSE] Add support for unary FNeg to EarlyCSE
ClosedPublic

Authored by cameron.mcinally on Aug 6 2019, 9:58 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptAug 6 2019, 9:58 AM

Remove unnecessary {}'s.

cameron.mcinally planned changes to this revision.Aug 6 2019, 10:06 AM

Ah, I misunderstood hash_combine(...). This patch needs work...

Correct hash_combine(...) use.

JosephTremoulet added inline comments.Aug 6 2019, 2:23 PM
llvm/lib/Transforms/Scalar/EarlyCSE.cpp
168–169 ↗(On Diff #213653)

I think this is the same thing you'd get by letting control fall down to the default case at the end of the function (once you relax the assertion there to mirror the change you've made to canHandle). I'd think that would be preferable as it would keep getHashValueImpl and isEqualImpl more directly/syntactically/obviously in sync.

Updated patch for Joe's suggestion.

cameron.mcinally marked an inline comment as done.Aug 6 2019, 4:13 PM

LGTM. Probably good to have someone else weigh in before committing (I touched this code last, but only to fix a couple bugs).

spatel accepted this revision.Aug 7 2019, 3:14 AM

LGTM

This revision is now accepted and ready to land.Aug 7 2019, 3:14 AM
This revision was automatically updated to reflect the committed changes.