[LLVMdev] DAG optimization and lowering algorithm

Demikhovsky, Elena elena.demikhovsky at intel.com
Mon Feb 6 23:54:15 PST 2012


Hi,

I'm trying to build code for very short function and I encounter with a problem (or bug) in DAG selection algotithm.
I have a node that was created in Combine(BeforeLegalizeTypes) and should be optimized in Combine(AfterLegalizeTypes). But LegalizeTypes() did not change anything and Combine(AfterLegalizeTypes) was not called.
Vector legalization that comes afterwards just scalarized the operation.

SelectionDAGISel::CodeGenAndEmitDAG()
..
   CurDAG->Combine(BeforeLegalizeTypes, *AA, OptLevel);

   bool Changed;
   Changed = CurDAG->LegalizeTypes();

   if (Changed) {
      CurDAG->Combine(AfterLegalizeTypes, *AA, OptLevel);
    }

The problem does not exist if the function is bigger and something was changed on LegalizeTypes() stage.

I think that Combine(AfterLegalizeTypes) should be called anyway, even if LegalizeTypes() did not change anything.


- Elena


---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.





More information about the llvm-dev mailing list