Page MenuHomePhabricator

[X86][CodeGen][NFC] Delay `combineIncDecVector()` from DAGCombine to X86DAGToDAGISel
Needs ReviewPublic

Authored by lebedev.ri on May 23 2019, 9:04 AM.

Details

Summary

We were previously doing it in DAGCombine.
But we also want to do sub %x, C -> add %x, (sub 0, C) for vectors in DAGCombine.
So if we had sub %x, -1, we'll transform it to add %x, 1,
which combineIncDecVector() will immediately transform back into sub %x, -1,
and here we go again...

I've marked this as NFC since not a single test changes,
but since that 'changes' DAGCombine, probably this isn't fully NFC.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper added inline comments.May 23 2019, 1:35 PM
lib/Target/X86/X86ISelDAGToDAG.cpp
3449

What happens to the constant pool value we already allocated. Does something recognize that is unused and not emit to the final assembly?

Could we use a isrematerializable test instead in the (sub x, c) -> (add x, -c) folds to avoid needing this?