This is an archive of the discontinued LLVM Phabricator instance.

[Hexagon] Use InstSimplify instead of ConstantProp
ClosedPublic

Authored by aeubanks on Jul 31 2020, 2:47 PM.

Details

Summary

This is the last remaining use of ConstantProp, migrate it to InstSimplify in the goal of removing ConstantProp.

Diff Detail

Event Timeline

aeubanks created this revision.Jul 31 2020, 2:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 31 2020, 2:47 PM
aeubanks requested review of this revision.Jul 31 2020, 2:47 PM
aeubanks updated this revision to Diff 282327.Jul 31 2020, 3:08 PM
aeubanks retitled this revision from [Hexagon] Use InstCombine instead of ConstantProp This is the last remaining use of ConstantProp, migrate it to InstCombine in the goal of removing ConstantProp. to [Hexagon] Use InstCombine instead of ConstantProp.
aeubanks edited the summary of this revision. (Show Details)

InstSimplify instead of InstCombine

aeubanks retitled this revision from [Hexagon] Use InstCombine instead of ConstantProp to [Hexagon] Use InstSimplify instead of ConstantProp.Jul 31 2020, 3:09 PM
aeubanks edited the summary of this revision. (Show Details)
aeubanks added a reviewer: kparzysz.

There are 10 failures under llvm/test/CodeGen/Hexagon, and I don't have enough domain knowledge to fix them, was wondering if this even made sense at all.

These failures seem to be caused by optimizing the code "too much", and simply removing the parts that the tests were looking for.

Could you add a debug flag in HexagonTargetMachine.cpp, and add the simplification pass conditionally, similarly to how line 322 does it? The pass would be added by default, but these failing tests could exclude it (see the -hexagon-initial-cfg-cleanup=0 in some of the failing tests, that's the exact same problem caused by some other change in optimization passes).

aeubanks updated this revision to Diff 282701.Aug 3 2020, 12:36 PM

Add -hexagon-instsimplify option, add -hexagon-instsimplify=0 to some tests

These failures seem to be caused by optimizing the code "too much", and simply removing the parts that the tests were looking for.

Could you add a debug flag in HexagonTargetMachine.cpp, and add the simplification pass conditionally, similarly to how line 322 does it? The pass would be added by default, but these failing tests could exclude it (see the -hexagon-initial-cfg-cleanup=0 in some of the failing tests, that's the exact same problem caused by some other change in optimization passes).

Ah I see, thanks! Done.

kparzysz accepted this revision.Aug 4 2020, 3:20 PM
This revision is now accepted and ready to land.Aug 4 2020, 3:20 PM
This revision was automatically updated to reflect the committed changes.