mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
Disable bogus cast elimination when the cast is used by a setcc instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17583 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
18224032d3
commit
075cdc655e
@ -3163,15 +3163,15 @@ void PPC32ISel::visitCastInst(CastInst &CI) {
|
||||
// emit them, as the store instruction will implicitly not store the zero or
|
||||
// sign extended bytes.
|
||||
if (SrcClass <= cInt && SrcClass >= DestClass) {
|
||||
bool AllUsesAreStoresOrSetCC = true;
|
||||
bool AllUsesAreStores = true;
|
||||
for (Value::use_iterator I = CI.use_begin(), E = CI.use_end(); I != E; ++I)
|
||||
if (!isa<StoreInst>(*I) && !isa<SetCondInst>(*I)) {
|
||||
AllUsesAreStoresOrSetCC = false;
|
||||
if (!isa<StoreInst>(*I)) {
|
||||
AllUsesAreStores = false;
|
||||
break;
|
||||
}
|
||||
// Turn this cast directly into a move instruction, which the register
|
||||
// allocator will deal with.
|
||||
if (AllUsesAreStoresOrSetCC) {
|
||||
if (AllUsesAreStores) {
|
||||
unsigned SrcReg = getReg(Op, BB, MI);
|
||||
BuildMI(*BB, MI, PPC::OR, 2, DestReg).addReg(SrcReg).addReg(SrcReg);
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user