mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Revert "Add Constant Hoisting Pass" (r200034)
This commit caused -Woverloaded-virtual warnings. The two new TargetTransformInfo::getIntImmCost functions were only added to the superclass, and to the X86 subclass. The other targets were not updated, and the warning highlighted this by pointing out that e.g. ARMTTI::getIntImmCost was hiding the two new getIntImmCost variants. We could pacify the warning by adding "using TargetTransformInfo::getIntImmCost" to the various subclasses, or turning it off, but I suspect that it's wrong to leave the functions unimplemnted in those targets. The default implementations return TCC_Free, which I don't think is right e.g. for ARM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200058 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1470,23 +1470,17 @@ TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1,
|
||||
if (Cond == ISD::SETGE || Cond == ISD::SETUGE) {
|
||||
if (C1 == MinVal) return DAG.getConstant(1, VT); // X >= MIN --> true
|
||||
// X >= C0 --> X > (C0-1)
|
||||
APInt C = C1-1;
|
||||
if (!N1C->isOpaque() || (N1C->isOpaque() && C.getBitWidth() <= 64 &&
|
||||
isLegalICmpImmediate(C.getSExtValue())))
|
||||
return DAG.getSetCC(dl, VT, N0,
|
||||
DAG.getConstant(C, N1.getValueType()),
|
||||
(Cond == ISD::SETGE) ? ISD::SETGT : ISD::SETUGT);
|
||||
return DAG.getSetCC(dl, VT, N0,
|
||||
DAG.getConstant(C1-1, N1.getValueType()),
|
||||
(Cond == ISD::SETGE) ? ISD::SETGT : ISD::SETUGT);
|
||||
}
|
||||
|
||||
if (Cond == ISD::SETLE || Cond == ISD::SETULE) {
|
||||
if (C1 == MaxVal) return DAG.getConstant(1, VT); // X <= MAX --> true
|
||||
// X <= C0 --> X < (C0+1)
|
||||
APInt C = C1+1;
|
||||
if (!N1C->isOpaque() || (N1C->isOpaque() && C.getBitWidth() <= 64 &&
|
||||
isLegalICmpImmediate(C.getSExtValue())))
|
||||
return DAG.getSetCC(dl, VT, N0,
|
||||
DAG.getConstant(C, N1.getValueType()),
|
||||
(Cond == ISD::SETLE) ? ISD::SETLT : ISD::SETULT);
|
||||
return DAG.getSetCC(dl, VT, N0,
|
||||
DAG.getConstant(C1+1, N1.getValueType()),
|
||||
(Cond == ISD::SETLE) ? ISD::SETLT : ISD::SETULT);
|
||||
}
|
||||
|
||||
if ((Cond == ISD::SETLT || Cond == ISD::SETULT) && C1 == MinVal)
|
||||
|
Reference in New Issue
Block a user