mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 06:32:09 +00:00
Fix PR1495 and CodeGen/X86/2007-06-05-LSR-Dominator.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37454 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
76ea084489
commit
b47f6124f4
@ -560,11 +560,17 @@ Value *BasedUser::InsertCodeForBaseAtPosition(const SCEVHandle &NewBase,
|
||||
OperandValToReplace->getType());
|
||||
|
||||
Value *Base = Rewriter.expandCodeFor(NewBase, BaseInsertPt);
|
||||
|
||||
// If we are inserting the base and imm values in the same block, make sure to
|
||||
// adjust the IP position if insertion reused a result.
|
||||
if (IP == BaseInsertPt)
|
||||
IP = Rewriter.getInsertionPoint();
|
||||
|
||||
// Always emit the immediate (if non-zero) into the same block as the user.
|
||||
SCEVHandle NewValSCEV = SCEVAddExpr::get(SCEVUnknown::get(Base), Imm);
|
||||
return Rewriter.expandCodeFor(NewValSCEV, IP,
|
||||
OperandValToReplace->getType());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user