Skip to content

Commit

Permalink
Don't propagate dereferenceable attribute through gc.relocate in Inst…
Browse files Browse the repository at this point in the history
…Combine

Reviewed By: reames

Differential Revision: http://reviews.llvm.org/D16143

llvm-svn: 260509
  • Loading branch information
arpilipe committed Feb 11, 2016
1 parent 2960c98 commit 44e7c51
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
6 changes: 0 additions & 6 deletions llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1850,12 +1850,6 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
// isKnownNonNull -> nonnull attribute
if (isKnownNonNullAt(DerivedPtr, II, DT, TLI))
II->addAttribute(AttributeSet::ReturnIndex, Attribute::NonNull);

// isDereferenceablePointer -> deref attribute
if (isDereferenceablePointer(DerivedPtr, DL))
if (Argument *A = dyn_cast<Argument>(DerivedPtr))
II->addDereferenceableAttr(AttributeSet::ReturnIndex,
A->getDereferenceableBytes());
}

// TODO: bitcast(relocate(p)) -> relocate(bitcast(p))
Expand Down
11 changes: 0 additions & 11 deletions llvm/test/Transforms/InstCombine/gc.relocate.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ declare zeroext i1 @return_i1()
declare token @llvm.experimental.gc.statepoint.p0f_i1f(i64, i32, i1 ()*, i32, i32, ...)
declare i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(token, i32, i32)

define i32 addrspace(1)* @deref(i32 addrspace(1)* dereferenceable(8) %dparam) gc "statepoint-example" {
; Checks that a dereferenceabler pointer
; CHECK-LABEL: @deref
; CHECK: call dereferenceable(8)
entry:
%load = load i32, i32 addrspace(1)* %dparam
%tok = tail call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0, i32 addrspace(1)* %dparam)
%relocate = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(token %tok, i32 7, i32 7)
ret i32 addrspace(1)* %relocate
}

define i32 @explicit_nonnull(i32 addrspace(1)* nonnull %dparam) gc "statepoint-example" {
; Checks that a nonnull pointer
; CHECK-LABEL: @explicit_nonnull
Expand Down

0 comments on commit 44e7c51

Please sign in to comment.