This patch adds a check in SplitLandingPadPredecessors to see if the original landingpad instruction has any uses. If not, we don't need to create a PHINode for it in the joint block since it's gonna be a dead code anyway. The motivation for this patch is that we found a bug that SplitLandingPadPredecessors created a PHINode of token type landingpad, which failed the verifier since PHINode can not be token type. However, the created PHINode will never be used in our code pattern. This patch will workaround this bug, and we might add supports in SplitLandingPadPredecessors to handle token type landingpad with uses in the future.
Details
Details
Diff Detail
Diff Detail
Event Timeline
lib/Transforms/Utils/BasicBlockUtils.cpp | ||
---|---|---|
629–639 | I happen to know from talking to you offline that this is about fixing an issue for token types, but that's not obvious in the code. I'd add something to make this clear like an assertion that the type of the PHI being created isn't a token type with a comment talking about the splitting restriction. |
I happen to know from talking to you offline that this is about fixing an issue for token types, but that's not obvious in the code. I'd add something to make this clear like an assertion that the type of the PHI being created isn't a token type with a comment talking about the splitting restriction.