mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
SelectionDAG: create correct BooleanContent constants
Occasionally DAGCombiner can spot that a SETCC operation is completely redundant and reduce it to "all true" or "all false". If this happens to a vector, the value produced has to take account of what a normal comparison would have produced, which may be an all-1s bitmask. The fix in SelectionDAG.cpp is tested, however, as far as I can see the code in TargetLowering.cpp is possibly unreachable and almost certainly irrelevant when triggered so there are no tests. However, I believe it's still clearly the right change and may save someone else some hassle if it suddenly becomes reachable. So I'm doing it anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190147 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1080,7 +1080,11 @@ TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1,
|
||||
case ISD::SETFALSE:
|
||||
case ISD::SETFALSE2: return DAG.getConstant(0, VT);
|
||||
case ISD::SETTRUE:
|
||||
case ISD::SETTRUE2: return DAG.getConstant(1, VT);
|
||||
case ISD::SETTRUE2: {
|
||||
TargetLowering::BooleanContent Cnt = getBooleanContents(VT.isVector());
|
||||
return DAG.getConstant(
|
||||
Cnt == TargetLowering::ZeroOrNegativeOneBooleanContent ? -1ULL : 1, VT);
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure that the constant occurs on the RHS, and fold constant
|
||||
|
||||
Reference in New Issue
Block a user