This is an archive of the discontinued LLVM Phabricator instance.

[StructurizeCFG] Remove imposible case, associated test, and replace by assert
ClosedPublic

Authored by jmmartinez on Sep 22 2022, 7:05 AM.

Diff Detail

Event Timeline

jmmartinez created this revision.Sep 22 2022, 7:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 22 2022, 7:05 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
jmmartinez requested review of this revision.Sep 22 2022, 7:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 22 2022, 7:05 AM

I think it should be ok to remove the code, but I would rather we keep the tests, the test is hitting the limitation of StructurizeCFG. The test contains infinite loop in its CFG. Maybe we can update the comment in the test to say this, and see whether we could solve this problem later.

I think it should be ok to remove the code, but I would rather we keep the tests, the test is hitting the limitation of StructurizeCFG. The test contains infinite loop in its CFG. Maybe we can update the comment in the test to say this, and see whether we could solve this problem later.

Whay do you think about removing this test and introducing a separate infinite-loop.ll test ? I'd prefer a test that matches what we expect StructurizeCFG to do on an infinite loop (in this particular case, nothing) than the current test.

ruiling accepted this revision.Sep 27 2022, 7:43 PM

I think it should be ok to remove the code, but I would rather we keep the tests, the test is hitting the limitation of StructurizeCFG. The test contains infinite loop in its CFG. Maybe we can update the comment in the test to say this, and see whether we could solve this problem later.

Whay do you think about removing this test and introducing a separate infinite-loop.ll test ? I'd prefer a test that matches what we expect StructurizeCFG to do on an infinite loop (in this particular case, nothing) than the current test.

sounds good to me.

This revision is now accepted and ready to land.Sep 27 2022, 7:43 PM
  • Test case for infinite loops added
ruiling added inline comments.Sep 28 2022, 6:13 AM
llvm/test/Transforms/StructurizeCFG/infinite-loop.ll
8

I think you can just remove this one, we don't need to test against 'br undef'. There has been discussion to remove 'br undef' in test, see https://discourse.llvm.org/t/please-dont-use-br-undef-in-tests-aka-please-avoid-test-cases-with-ub/63115. Other parts LGTM.

Removed undef branch test case

ruiling accepted this revision.Sep 28 2022, 8:42 PM

Thanks!

llvm/test/Transforms/StructurizeCFG/infinite-loop.ll