mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
During SelectionDAG building explicitly set a node to constant zero when the
value is zero. This allows optmizations to kick in more easily. Fix some test cases so that they remain meaningful (i.e., not completely dead coded) when optimizations apply. <rdar://problem/14096009> superfluous multiply by high part of zero-extended value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184222 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -718,6 +718,14 @@ SDValue RegsForValue::getCopyFromRegs(SelectionDAG &DAG,
|
||||
unsigned NumSignBits = LOI->NumSignBits;
|
||||
unsigned NumZeroBits = LOI->KnownZero.countLeadingOnes();
|
||||
|
||||
if (NumZeroBits == RegSize) {
|
||||
// The current value is a zero.
|
||||
// Explicitly express that as it would be easier for
|
||||
// optimizations to kick in.
|
||||
Parts[i] = DAG.getConstant(0, RegisterVT);
|
||||
continue;
|
||||
}
|
||||
|
||||
// FIXME: We capture more information than the dag can represent. For
|
||||
// now, just use the tightest assertzext/assertsext possible.
|
||||
bool isSExt = true;
|
||||
|
Reference in New Issue
Block a user