It was mentioned that D88276 that when a phi node is visited, terminators at their incoming edges should be used for CtxI.
This is a patch that makes two functions (ComputeNumSignBitsImpl, isGuaranteedNotToBeUndefOrPoison) to do so.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
2977 | The separation of the first incoming value here looks unnecessary, write it like this instead? Tmp = TyBits; for (unsigned i = 0, e = NumIncomingValues; i != e; ++i) { if (Tmp == 1) return Tmp; RecQ.CxtI = PN->getIncomingBlock(i)->getTerminator(); Tmp = std::min( Tmp, ComputeNumSignBits(PN->getIncomingValue(i), Depth + 1, RecQ)); } Not really related to your change, but it does make it more visible. | |
llvm/unittests/Analysis/ValueTrackingTest.cpp | ||
789 | This test looks like it would be passing both before and after your change. You're also not passing TI to the function, so the failure message doesn't really make sense. |
llvm/unittests/Analysis/ValueTrackingTest.cpp | ||
---|---|---|
789 | Sorry, my mistake. Fixed |
clang-format not found in user's PATH; not linting file.