I noticed that we were not back-propagating undef lanes to shuffle masks when we have a shuffle that reduces the vector width. This is part of investigating/solving PR38691:
https://bugs.llvm.org/show_bug.cgi?id=38691
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
I don't see any obvious problems here, but i'm unfamiliar with this area at all..
Do we not have any one-use concerns in such transforms?
lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp | ||
---|---|---|
1267 ↗ | (On Diff #163102) | Yes, good catch. Not sure how to expose that in a test, but I'll fix the code in the next rev. |
Patch updated:
Corrected the recursive call on the condition to use its own 'UndefElts' constant (which is unused currently as explained in the new code comments).
I cleaned up the surrounding code with rL341545.
lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp | ||
---|---|---|
1263 ↗ | (On Diff #164213) | What would you think about casting to SelectInst and using getCondition, getTrueValue, getFalseValue, setCondition, etc. throughout this code? |
lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp | ||
---|---|---|
1263 ↗ | (On Diff #164213) | Sure - let me clean that up and rebase. |
Patch updated:
Rebased after cleanup and rL341708.
I made a subtle change here to not use a local Cond variable because that could become stale if we setCond() in the new block.