[LLVMdev] Complex load patterns and token factors

Hal Finkel hfinkel at anl.gov
Sat Jun 23 14:10:51 PDT 2012


Working on a target I added this pattern:

def : Pat<(v4i64 (load xoaddr:$src)),
          (QVFCTIDb (QVLFDXb xoaddr:$src))>;

which represents an actual load followed by a necessary conversion
operation. The problem is that when this matches any TokenFactor that
was attached to the load node gets attached, not to the inner load
instruction, but the outer conversion operation. This is causing
miscompiles because stores that should be scheduled before the load end
up scheduled after the load (but before the conversion operation,
because the conversion operation inherited the TokenFactor input).

I'd like to fix this so that it works correctly: the TokenFactor
inputs should be attached to all inner-most instructions. I'm guessing
this is somewhere in SelectionDAGISel.cpp, but if someone has a
more-specific idea, I'd appreciate hearing it.

Thanks in advance,
Hal

-- 
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-dev mailing list