[LLVMdev] strcpy optimization to i32 instead of i64 stores

Tim Northover t.p.northover at gmail.com
Wed Aug 7 08:17:12 PDT 2013


Hi Bjorn,

> Do I need to add anything to my backend to have this types of i64 stores converted into 2 i32 stores?

It looks like you need to override "getOptimalMemOpType" in
XXXISelLowering.cpp. It's used by FindOptimalMemOpLowering in
SelectionDAG.cpp.

> Or can I easily avoid that opt or clang create the i64 instructions in the first place?

That's more tricky, but it looks like the relevant functions are
"gerMaxStoresPerMemcpy", "getMaxStoresPerMemmove" and
"getMaxStoresPerMemset". I don't think they would stop it entirely
though, just discourage it.

Cheers.

Tim.



More information about the llvm-dev mailing list