[PATCH] D68244: [InstCombine] don't assume 'inbounds' for bitcast pointer to GEP transform (PR43501)

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 2 13:47:34 PDT 2019


jdoerfert added a comment.

You accidentally or intentionally did the right thing when it comes to `deref_or_null`.
That is,

  define float @matching_scalar_smallest_deref_or_null(<4 x float>* dereferenceable_or_null(1) %p) {
  ; CHECK-LABEL: @matching_scalar_smallest_deref(
  ; CHECK-NEXT:    [[BC:%.*]] = getelementptr inbounds <4 x float>, <4 x float>* [[P:%.*]], i64 0, i64 0
  ; CHECK-NEXT:    [[R:%.*]] = load float, float* [[BC]], align 16
  ; CHECK-NEXT:    ret float [[R]]
  ;
    %bc = bitcast <4 x float>* %p to float*
    %r = load float, float* %bc, align 16
    ret float %r
  }

should also work fine.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68244/new/

https://reviews.llvm.org/D68244





More information about the llvm-commits mailing list