[PATCH] D153406: [Attributor] Convert test to opaque pointers

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 21 02:16:50 PDT 2023


nikic added a comment.

Good context to know here is that getCalledFunction() will check that the function signatures match, but e.g. isCallee() won't, that requires an explicit check. It may be that Attributor needs additional function signature checks in some places, but it's not really clear to me whether it is necessary from the test diff.



================
Comment at: llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll:46
 ; CGSCC-SAME: (i16 [[A:%.*]]) #[[ATTR0:[0-9]+]] {
-; CGSCC-NEXT:    [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16)*)(i16 [[A]])
+; CGSCC-NEXT:    [[CALL:%.*]] = call noundef i16 @bar() #[[ATTR3:[0-9]+]]
 ; CGSCC-NEXT:    ret i16 [[CALL]]
----------------
We now infer attributes despite the mismatch in signature. That looks fine here, but possibly it only works by accident.


================
Comment at: llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll:93
+; CGSCC-NEXT:    [[A:%.*]] = add i16 [[P1]], [[P2]]
+; CGSCC-NEXT:    ret i16 [[A]]
 ;
----------------
The fact that we no longer infer attributes for TUNIT seems suspicious.


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

https://reviews.llvm.org/D153406



More information about the llvm-commits mailing list