I think what we need is the least Log2(EltSize) significant bits are known to be ones.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
7301–7302 | It might be worthwhile to replace the ISD::AND case with SimplifyMultipleUseDemandedBits: if (IsRotate && isPowerOf2_64(EltSize)) { unsigned Bits = Log2_64(EltSize); APInt DemandedBits = APInt::getLowBitsSet(EltSize, Bits); if (SDValue Inner = SimplifyMultipleUseDemandedBits(Neg, DemandedBits, DAG)) { Neg = Inner; MaskLoBits = Bits; } } |
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
7301–7302 | Thanks! I think it makes sense! |
Any thoughts about comments? I think they may be not matched with implementation now. @RKSimon
How about this?
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
7295–7297 | // This allows us to peek through any operations that only the affect Mask's un-demanded bits. |
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
7295–7297 | Make sense to me. Thanks! |
This seems to be hitting assertions when compiling BoringSSL:
https://luci-milo.appspot.com/ui/p/fuchsia/builders/ci/clang_toolchain.ci.core.x64-release/b8807566603550542609/overview
Haven't conclusively proven that it's this change, but it's the only one in the blamelist that could affect X86 ISel.
More likely its exposed something - demanded bits tends to do that. Any chance you can send us the IR file? Or even just the pre-processed source.
@mysterymath I've pushed rG1ea7b9c6ee6420dd6e87489534f44b92e1b6f220 as a tentative fix
// This allows us to peek through any operations that only the affect Mask's un-demanded bits.