[PATCH] D22399: [LoopDataPrefetch/AArch64] Don't add prefetch intrinsic, when the loop already has InlineAsm prefetch.
Junmo Park via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 18 00:39:24 PDT 2016
flyingforyou added subscribers: mcrosier, t.p.northover.
flyingforyou added reviewers: mcrosier, t.p.northover.
flyingforyou added a comment.
Is `Diff 64111` too much modification?
I think we just check below string. Because it depends on ISA, only.
AArch64 : prfm
AArch32 : pld
PowerPC: dcbt
...
How about making helper function for checking these string?
or Just checking string in `TargetTransformInfoImpl.h` likes `isLoweredToCall`?
bool isLoweredToCall(const Function *F) {
// FIXME: These should almost certainly not be handled here, and instead
// handled with the help of TLI or the target itself. This was largely
// ported from existing analysis heuristics here so that such refactorings
// can take place in the future.
if (F->isIntrinsic())
return false;
if (F->hasLocalLinkage() || !F->hasName())
return true;
StringRef Name = F->getName();
// These will all likely lower to a single selection DAG node.
if (Name == "copysign" || Name == "copysignf" || Name == "copysignl" ||
Name == "fabs" || Name == "fabsf" || Name == "fabsl" || Name == "sin" ||
Name == "fmin" || Name == "fminf" || Name == "fminl" ||
Name == "fmax" || Name == "fmaxf" || Name == "fmaxl" ||
Name == "sinf" || Name == "sinl" || Name == "cos" || Name == "cosf" ||
Name == "cosl" || Name == "sqrt" || Name == "sqrtf" || Name == "sqrtl")
return false;
// These are all likely to be optimized into something smaller.
if (Name == "pow" || Name == "powf" || Name == "powl" || Name == "exp2" ||
Name == "exp2l" || Name == "exp2f" || Name == "floor" ||
Name == "floorf" || Name == "ceil" || Name == "round" ||
Name == "ffs" || Name == "ffsl" || Name == "abs" || Name == "labs" ||
Name == "llabs")
return false;
return true;
}
Thanks,
Junmo Park.
https://reviews.llvm.org/D22399
More information about the llvm-commits
mailing list