mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
When looking for loop-invariant users, look through no-op instructions,
so that an unfortunately placed bitcast doesn't pin a value in a register. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100883 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1947,9 +1947,17 @@ LSRInstance::CollectLoopInvariantFixupsAndFormulae() {
|
|||||||
continue;
|
continue;
|
||||||
// Ignore uses which are part of other SCEV expressions, to avoid
|
// Ignore uses which are part of other SCEV expressions, to avoid
|
||||||
// analyzing them multiple times.
|
// analyzing them multiple times.
|
||||||
if (SE.isSCEVable(UserInst->getType()) &&
|
if (SE.isSCEVable(UserInst->getType())) {
|
||||||
!isa<SCEVUnknown>(SE.getSCEV(const_cast<Instruction *>(UserInst))))
|
const SCEV *UserS = SE.getSCEV(const_cast<Instruction *>(UserInst));
|
||||||
|
// If the user is a no-op, look through to its uses.
|
||||||
|
if (!isa<SCEVUnknown>(UserS))
|
||||||
continue;
|
continue;
|
||||||
|
if (UserS == U) {
|
||||||
|
Worklist.push_back(
|
||||||
|
SE.getUnknown(const_cast<Instruction *>(UserInst)));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
// Ignore icmp instructions which are already being analyzed.
|
// Ignore icmp instructions which are already being analyzed.
|
||||||
if (const ICmpInst *ICI = dyn_cast<ICmpInst>(UserInst)) {
|
if (const ICmpInst *ICI = dyn_cast<ICmpInst>(UserInst)) {
|
||||||
unsigned OtherIdx = !UI.getOperandNo();
|
unsigned OtherIdx = !UI.getOperandNo();
|
||||||
|
Reference in New Issue
Block a user