}]>;
// Helper fragments for loads.
-// It's always safe to treat a anyext i16 load as a i32 load. Ditto for
-// i8 to i16.
+// It's always safe to treat a anyext i16 load as a i32 load if the i16 is
+// known to be 32-bit aligned or better. Ditto for i8 to i16.
def loadi16 : PatFrag<(ops node:$ptr), (i16 (ld node:$ptr)), [{
if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N)) {
if (LD->getAddressingMode() != ISD::UNINDEXED)
if (ExtType == ISD::NON_EXTLOAD)
return true;
if (ExtType == ISD::EXTLOAD)
- return LD->getAlignment() >= 8 && !LD->isVolatile();
+ return LD->getAlignment() >= 16 && !LD->isVolatile();
}
return false;
}]>;
if (ExtType == ISD::NON_EXTLOAD)
return true;
if (ExtType == ISD::EXTLOAD)
- return LD->getAlignment() >= 16 && !LD->isVolatile();
+ return LD->getAlignment() >= 32 && !LD->isVolatile();
}
return false;
}]>;