Index: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp =================================================================== --- llvm/lib/Target/PowerPC/PPCInstrInfo.cpp +++ llvm/lib/Target/PowerPC/PPCInstrInfo.cpp @@ -3063,6 +3063,11 @@ RegMO = &DefMI.getOperand(1); ImmMO = &DefMI.getOperand(2); + // Going from XForm to DForm loads means that the load must be word aligned. + // XForm loads do not have this restriction. + if (ImmMO->isGlobal() && ImmMO->getGlobal()->getAlignment() < 4) + return false; + // This DefMI is elgible for forwarding if it is: // 1. add inst // 2. one of the operands is Imm/CPI/Global.