Page MenuHomePhabricator

[IPSCCP] Partial support for constrained intrinsics
Needs ReviewPublic

Authored by kpn on Dec 14 2021, 8:33 AM.



This teaches the SCCP Solver about some of the constrained intrinsics by having them use the same codepaths as the non-constrained instructions.

Casting instructions along with the binary operators will come later.

Diff Detail

Event Timeline

kpn created this revision.Dec 14 2021, 8:33 AM
kpn requested review of this revision.Dec 14 2021, 8:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2021, 8:33 AM
fhahn requested changes to this revision.Dec 14 2021, 8:42 AM
fhahn added inline comments.
694 ↗(On Diff #394265)

I think this change is strictly independent of supporting constrained intrinsics in SCCP and should be separate I think.

1 ↗(On Diff #394265)

could you preocmmit the tests?

This revision now requires changes to proceed.Dec 14 2021, 8:42 AM
nikic added inline comments.Dec 14 2021, 8:55 AM
694 ↗(On Diff #394265)

I think it would be better to address this by switching SCCP to use isInstructionTriviallyDead() instead. In fact, if we switch SCCP and FunctionSpecialization, we can drop this method entirely, as these seem to be the only users. Don't really see why we need a second, worse implementation if this functionality.

kpn updated this revision to Diff 437648.Jun 16 2022, 11:48 AM
kpn edited the summary of this revision. (Show Details)

Update for review comments. I've also reduced it down to just fcmp and fcmps having a functional impact. I don't have a good way to test the binary operators just yet.

Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2022, 11:48 AM
nikic added a comment.Jun 28 2022, 9:31 AM

Why isn't this already handled by ConstantFoldCall?