mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
The previous fix of widening divides that trap was too fragile as it depends on custom
lowering and requires that certain types exist in ValueTypes.h. Modified widening to check if an op can trap and if so, the widening algorithm will apply only the op on the defined elements. It is safer to do this in widening because the optimizer can't guarantee removing unused ops in some cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95823 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -540,6 +540,24 @@ TargetLowering::~TargetLowering() {
|
||||
delete &TLOF;
|
||||
}
|
||||
|
||||
/// canOpTrap - Returns true if the operation can trap for the value type.
|
||||
/// VT must be a legal type.
|
||||
bool TargetLowering::canOpTrap(unsigned Op, EVT VT) const {
|
||||
assert(isTypeLegal(VT));
|
||||
switch (Op) {
|
||||
default:
|
||||
return false;
|
||||
case ISD::FDIV:
|
||||
case ISD::FREM:
|
||||
case ISD::SDIV:
|
||||
case ISD::UDIV:
|
||||
case ISD::SREM:
|
||||
case ISD::UREM:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static unsigned getVectorTypeBreakdownMVT(MVT VT, MVT &IntermediateVT,
|
||||
unsigned &NumIntermediates,
|
||||
EVT &RegisterVT,
|
||||
|
Reference in New Issue
Block a user