There are extra patterns that have for these three logic operations
that aren't covered in SimplifyDemandedUseBits. To avoid duplicating
the code, just use analyzeKnownBitsFromAndXorOr in
SimplifyDemandedUseBits to get full coverage.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
This is going to unnecessarily recompute known bits we already have. Please go with the helpers instead. Doing a recursive computeKnownBits() call for an operand we didn't check yet is fine, but we shouldn't recompute the known bits we already have.
Comment Actions
Done in V2. Made the AndXorOr helper public in previous patch (D142427) so now just goes through analyzeKnownBitsFromAndXorOr.
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp | ||
---|---|---|
198–199 | You can use cast<Operator>(I) here and drop the if. Every Instruction is an Operator. |
You can use cast<Operator>(I) here and drop the if. Every Instruction is an Operator.