llvm-project
0dad6843 - [SPIRV] In G_SELECT selection path: replace `removeFromParent` with `eraseFromParent` and return early (#184807)

Commit
82 days ago
[SPIRV] In G_SELECT selection path: replace `removeFromParent` with `eraseFromParent` and return early (#184807) When selecting an `ASSIGN_TYPE` of a `G_SELECT`, both instructions were removed but not erased. The code followed on a code path where the replaced G_SELECT would be added to a remove set if it was dead. But the select is not in the function anymore since it is already removed! Selecting a `selectSelect` always returns `true`. So the assertions/prints below would have never been triggered. This patch simplifies this code path to avoid falling through the asserts and paths where `selectSelect` could have failed (which trivially doesn't happen). Guarded `selectSelect` return with an assert in case it changes. Follow up of https://github.com/llvm/llvm-project/pull/182330
Author
Parents
Loading