Page MenuHomePhabricator

[ARM] KnownBits for CSINC/CSNEG/CSINV
ClosedPublic

Authored by dmgreen on Mar 2 2021, 10:57 AM.

Details

Summary

This adds some simple known bits handling for the three CSINC/NEG/INV instructions. From the operands known bits we can compute the common bits of the first operand and incremented/negated/inverted second operand. The first, especially CSINC ZR, ZR, comes up fair amount in the tests. The others are more rare so a unit test for them is added.

Diff Detail

Event Timeline

dmgreen created this revision.Mar 2 2021, 10:57 AM
dmgreen requested review of this revision.Mar 2 2021, 10:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2021, 10:57 AM
simon_tatham accepted this revision.Mar 3 2021, 8:46 AM

LGTM, but to show willing I've spotted a typo in a comment :-)

llvm/lib/Target/ARM/ARMISelLowering.cpp
17810
This revision is now accepted and ready to land.Mar 3 2021, 8:46 AM
This revision was landed with ongoing or failed builds.Mar 4 2021, 12:40 AM
This revision was automatically updated to reflect the committed changes.

This fails to compile for me, with this error:

ld.lld: error: undefined symbol: llvm::parseAssemblyString(llvm::StringRef, llvm::SMDiagnostic&, llvm::LLVMContext&, llvm::SlotMapping*)
>>> referenced by ARMSelectionDAGTest.cpp
>>>               unittests/Target/ARM/CMakeFiles/ARMTests.dir/ARMSelectionDAGTest.cpp.o:(llvm::ARMSelectionDAGTest::SetUp())

You beat any of the buildbots to reporting a problem! I was wondering if something like that would come up.

Any details on the configuration you are using to trigger this? What makes it different to the configs that are working?

I can remove the unit test in the meantime.

You beat any of the buildbots to reporting a problem! I was wondering if something like that would come up.

Any details on the configuration you are using to trigger this? What makes it different to the configs that are working?

I can remove the unit test in the meantime.

I think it might work if you're building the llvm libs as shared libs, maybe. (On the other hand I do remember even more of such issues crop up if building in such a config.) I pushed a fix that fixes it for me anyway.

Thanks. I think it may be some difference from whether LLVM_TARGETS_TO_BUILD is specified or not.

I've removed the test in 098aea95e92e0cae53959737bf3520dc85b1b888 as it's still failing on a PPC bot. I will look into reinstating it.