Page MenuHomePhabricator

[DAG] Move integer setcc %x, %x folding into FoldSetCC
ClosedPublic

Authored by RKSimon on Mar 12 2019, 4:19 AM.

Details

Summary

First step towards PR40800

I intend to move the float case in a separate future patch

I had to tweak the (overly reduced) thumb2 test

The x86 widening test change is annoying (no longer rematerializable) but we should address this separately.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Mar 12 2019, 4:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2019, 4:19 AM
Herald added a subscriber: javed.absar. · View Herald Transcript
t.p.northover added inline comments.
lib/CodeGen/SelectionDAG/TargetLowering.cpp
3007–3008 ↗(On Diff #190233)

I think you might still get here if someone does a sneaky MorphNodeTo behind your back. Might be safer to bail with non-debug code.

RKSimon added inline comments.Mar 12 2019, 7:14 AM
lib/CodeGen/SelectionDAG/TargetLowering.cpp
3007–3008 ↗(On Diff #190233)

FoldSetCC is called at the start of this function now so I think we should be safe - but I'm happy to update the if to:

if (N0 == N1 && !N0.getValueType().isInteger()) {
t.p.northover added inline comments.Mar 12 2019, 7:33 AM
lib/CodeGen/SelectionDAG/TargetLowering.cpp
3007–3008 ↗(On Diff #190233)

Is that new? I can't see it in my source.

RKSimon marked an inline comment as done.Mar 12 2019, 9:07 AM
RKSimon added inline comments.
lib/CodeGen/SelectionDAG/TargetLowering.cpp
3007–3008 ↗(On Diff #190233)

I committed it yesterday in rL355828

t.p.northover accepted this revision.Mar 12 2019, 10:19 AM
t.p.northover added inline comments.
lib/CodeGen/SelectionDAG/TargetLowering.cpp
3007–3008 ↗(On Diff #190233)

Ah, sorry. I thought you meant MorphNodeTo by "this" (my mistake). The assert is fine by me then.

This revision is now accepted and ready to land.Mar 12 2019, 10:19 AM
This revision was automatically updated to reflect the committed changes.