mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
If we know that it's a constant being casted, propagate through the cast
instruction. Doesn't work the other way though (can't recover bits that have been truncated). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33104 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c2a7d097f9
commit
28c5b1544a
@ -1285,8 +1285,17 @@ namespace {
|
||||
IG.canonicalize(SI->getFalseValue(), Top)) {
|
||||
add(SI, SI->getTrueValue(), ICmpInst::ICMP_EQ, NewContext);
|
||||
}
|
||||
} else if (CastInst *CI = dyn_cast<CastInst>(I)) {
|
||||
if (CI->getDestTy()->isFPOrFPVector()) return;
|
||||
|
||||
if (Constant *C = dyn_cast<Constant>(
|
||||
IG.canonicalize(CI->getOperand(0), Top))) {
|
||||
add(CI, ConstantExpr::getCast(CI->getOpcode(), C, CI->getDestTy()),
|
||||
ICmpInst::ICMP_EQ, NewContext);
|
||||
}
|
||||
|
||||
// TODO: "%a = cast ... %b" where %b is NE/LT/GT a constant.
|
||||
}
|
||||
// TODO: CastInst "%a = cast ... %b" where %b is EQ or NE a constant.
|
||||
}
|
||||
|
||||
/// solve - process the work queue
|
||||
|
Loading…
x
Reference in New Issue
Block a user