diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 808c53b1cf3fc..649c7c29408fb 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -7216,7 +7216,9 @@ SDValue SelectionDAG::foldConstantFPMath(unsigned Opcode, const SDLoc &DL, } SDValue SelectionDAG::getAssertAlign(const SDLoc &DL, SDValue Val, Align A) { - assert(Val.getValueType().isInteger() && "Invalid AssertAlign!"); + assert( + (Val.getValueType().isInteger() || Val.getValueType().isCapability()) && + "Invalid AssertAlign!"); // There's no need to assert on a byte-aligned pointer. All pointers are at // least byte aligned.