Previous attempt to fix infinite recursion in min/max reassociation was not fully successful (D100170). Newly discovered failing case is due to not properly handled when there is a single use. It should be processed separately from 2 uses case.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
650 ms | x64 windows > lld.MachO::reproduce.s |
Event Timeline
llvm/lib/Transforms/Scalar/NaryReassociate.cpp | ||
---|---|---|
617 | How is this even possible? I could not find explaining comment here, but intuitively LHS and RHS are expected to be arguments of I. If LHS has the only user then it must be I. no? Could you please add a method comment about what I, LHS and RHS actually are? |
llvm/lib/Transforms/Scalar/NaryReassociate.cpp | ||
---|---|---|
617 | Yes, your understanding is correct. LHS & RHS simply left and right operands of I (which is min/max or select). I will updated the code shortly |
llvm/lib/Transforms/Scalar/NaryReassociate.cpp | ||
---|---|---|
616 | Ah it's a user of LHS and not I. Makes sense then. |
Is U != I even happens to be false? An instruction can only use itself it it's a Phi, and I believe I is not a Phi here.