This is an archive of the discontinued LLVM Phabricator instance.

[FuncSpec] Ignore ConstantExpr when find possible constant
AbandonedPublic

Authored by ChuanqiXu on Jul 29 2021, 6:26 AM.

Details

Summary

Now the function specialization pass would crash for SPEC2017int rate.

The reason would be we didn't update the SCCPSolver after we replace the constant.
It would be fixed once we adopted D106426.

Since it looks like that D106426 would take more time to check in, I think we could use this fix first.

Test Plan: check-all, SPEC2017 int rate

Diff Detail

Event Timeline

ChuanqiXu created this revision.Jul 29 2021, 6:26 AM
ChuanqiXu requested review of this revision.Jul 29 2021, 6:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 29 2021, 6:26 AM
ChuanqiXu updated this revision to Diff 362949.Jul 29 2021, 6:54 PM

Fix tests.

BTW, may I ask a question here. The test case in this diff would get changed by function specialization pass but there wouldn't be any function get specialized. I know that the change is introduced by SCCPSolver. But do you think it is suitable? I feel it is a little bit strange.

BTW, may I ask a question here. The test case in this diff would get changed by function specialization pass but there wouldn't be any function get specialized. I know that the change is introduced by SCCPSolver. But do you think it is suitable? I feel it is a little bit strange.

It's definitely an indirect way of testing things, which indeed is not ideal. It's also not ideal that IR gets changed while the transformation does not get triggered, but in this case that's not something we can avoid I think. The solver used to be integral part of the IPSCC transformation, and thus we are not testing this in isolation. Looks like the best we can do is add this test here.

Now that there's progress with D106426, we don't need the FIXME in the code (we definitely want the test)? This change depends on D106426, and we can commit them soon after each other?

BTW, may I ask a question here. The test case in this diff would get changed by function specialization pass but there wouldn't be any function get specialized. I know that the change is introduced by SCCPSolver. But do you think it is suitable? I feel it is a little bit strange.

It's definitely an indirect way of testing things, which indeed is not ideal. It's also not ideal that IR gets changed while the transformation does not get triggered, but in this case that's not something we can avoid I think. The solver used to be integral part of the IPSCC transformation, and thus we are not testing this in isolation. Looks like the best we can do is add this test here.

Yes. We could add it to the todo list.

Now that there's progress with D106426, we don't need the FIXME in the code (we definitely want the test)? This change depends on D106426, and we can commit them soon after each other?

Yeah.

ChuanqiXu abandoned this revision.Aug 8 2021, 6:38 PM

Discarded.

But is the test case still interesting to have?

But is the test case still interesting to have?

My bad. The test case is checked in by D107622.

Ah okay, didn't realise that :-)