mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
[AArch64][CGP] Sink zext feeding stxr/stlxr into the same block.
The usual CodeGenPrepare trickery, on a target-specific intrinsic. Without this, the expansion of atomics will usually have the zext be hoisted out of the loop, defeating the various patterns we have to catch this precise case. Differential Revision: http://reviews.llvm.org/D9930 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238054 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1397,6 +1397,16 @@ bool CodeGenPrepare::OptimizeCallInst(CallInst *CI, bool& ModifiedDT) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case Intrinsic::aarch64_stlxr:
|
||||
case Intrinsic::aarch64_stxr: {
|
||||
ZExtInst *ExtVal = dyn_cast<ZExtInst>(CI->getArgOperand(0));
|
||||
if (!ExtVal || !ExtVal->hasOneUse() ||
|
||||
ExtVal->getParent() == CI->getParent())
|
||||
return false;
|
||||
// Sink a zext feeding stlxr/stxr before it, so it can be folded into it.
|
||||
ExtVal->moveBefore(CI);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (TLI) {
|
||||
|
Reference in New Issue
Block a user