@@ -3091,8 +3091,7 @@ Instruction *InstCombinerImpl::visitGetElementPtrInst(GetElementPtrInst &GEP) {
3091
3091
DL.getIndexSizeInBits (PtrOp->getType ()->getPointerAddressSpace ());
3092
3092
APInt BasePtrOffset (IdxWidth, 0 );
3093
3093
Value *UnderlyingPtrOp =
3094
- PtrOp->stripAndAccumulateInBoundsConstantOffsets (DL,
3095
- BasePtrOffset);
3094
+ PtrOp->stripAndAccumulateInBoundsConstantOffsets (DL, BasePtrOffset);
3096
3095
bool CanBeNull, CanBeFreed;
3097
3096
uint64_t DerefBytes = UnderlyingPtrOp->getPointerDereferenceableBytes (
3098
3097
DL, CanBeNull, CanBeFreed);
@@ -3120,7 +3119,8 @@ Instruction *InstCombinerImpl::visitGetElementPtrInst(GetElementPtrInst &GEP) {
3120
3119
// These rewrites is trying to preserve inbounds/nuw attributes. So we want to
3121
3120
// do this after having tried to derive "nuw" above.
3122
3121
if (GEP.getNumIndices () == 1 ) {
3123
- auto GetPreservedNoWrapFlags = [&](bool AddIsNUW, Value *Idx1, Value *Idx2) {
3122
+ auto GetPreservedNoWrapFlags = [&](bool AddIsNUW, Value *Idx1,
3123
+ Value *Idx2) {
3124
3124
// Preserve "inbounds nuw" if the original gep is "inbounds nuw", and the
3125
3125
// add is "nuw". Preserve "nuw" if the original gep is "nuw", and the add
3126
3126
// is "nuw".
@@ -3160,8 +3160,8 @@ Instruction *InstCombinerImpl::visitGetElementPtrInst(GetElementPtrInst &GEP) {
3160
3160
// as:
3161
3161
// %newptr = getelementptr i32, ptr %ptr, i32 %idx1
3162
3162
// %newgep = getelementptr i32, ptr %newptr, i32 idx2
3163
- bool NUW = match (GEP.getOperand (1 ), m_NNegZExt ( m_NUWAddLike ( m_Value (),
3164
- m_Value ())));
3163
+ bool NUW = match (GEP.getOperand (1 ),
3164
+ m_NNegZExt ( m_NUWAddLike ( m_Value (), m_Value ())));
3165
3165
GEPNoWrapFlags NWFlags = GetPreservedNoWrapFlags (NUW, Idx1, C);
3166
3166
auto *NewPtr = Builder.CreateGEP (
3167
3167
GEP.getSourceElementType (), GEP.getPointerOperand (),
0 commit comments