This pattern is sometime created after legalization.
Details
Diff Detail
- Repository
- rL LLVM
- Build Status
Buildable 28924 Build 28923: arc lint + arc unit
Event Timeline
Looks sane https://rise4fun.com/Alive/Nfiz
But looks like it's missed in instcombine too?
https://godbolt.org/z/UdEwql
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
2197–2198 | Tests? |
It is interesting that instcombine doesn't do this. I would have expected it to be the case. Let me prepare a patch for it.
If this pattern can emerge during legalization, then yes, we want a DAG combine for it. There's also a question raised in the IR version of the patch (D58877) about a reassociated version of this pattern. We don't have a dedicated reassociation pass for SDAG, so DAGCombine is responsible for handling that pattern too. Do we already have it, or should it be added too (as a separate DAG patch)?
All the pattern I submit in DAGCombiner are extracted from actual code -in this case libraries doing cryptography). I never encountered the vector version of this but I'm happy to add test cases for them if this is of interest.
Tests?