Resolves PR38938.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/X86/X86ISelDAGToDAG.cpp | ||
---|---|---|
2627–2630 | Actually, this does not have any test coverage it seems. |
Comment # 4 on bug 38938 from Craig Topper
We need to get the shl created before the address mode for the inc is
selected
in Simon's test case. So we need to handle this in DAG combine or in
preprocessiseldag.
Ok, makes sense.
This turned out to be rather problematic :S
This is *very* prone to endless loops (we unfold the pattern,
and then SimplifyDemandedBits folds it back).
I suspect the change in DAGCombiner::SimplifyDemandedBits()
is too ugly, but i don't have any better ideas.
Anything else appears to deadlock.
These aren't all the test changes, but most of them.
Ok, so the fix for the *given* problem is so much simpler.
AArch64 already overrode isDesirableToCommuteWithShift() with this very pattern.
But we clearly want to do the same for x86.
So just generalize it.
FIXME: i'm not sure if isBitFieldExtractPattern() should be a virtual function?
Actually, this does not have any test coverage it seems.
So i'm not sure what extra tests this needs.