[LLVMdev] Adding NonTemporal

David Greene dag at cray.com
Thu Feb 11 15:40:24 PST 2010

While hacking around in the SelectionDAG build code, I've made the
isVolatile, (new) isNonTemporal and Alignment parameters to 
SelectionDAG::getLoad/getStore and friends non-default.

I've already caught one bug in the XCore backend by doing this:

    if (Offset % 4 == 0) {
      // We've managed to infer better alignment information than the load
      // already has. Use an aligned load.
      return DAG.getLoad(getPointerTy(), dl, Chain, BasePtr, NULL, 4,
                         false, false, 0);

Whoops!  There's no alignment info being set here!

Is there any reason to keep these as default arguments?  It invites silent 
coding errors.  I did this because I have to propagate the non-temporal
information through various phases of lowering and making these non-default
helps me catch missing cases.

We've done the same in our local sources and we've never found
specifying the extra arguments to be burdensome.


More information about the llvm-dev mailing list