[PATCH] D118685: [ArgPromotion] Make implementation offset based

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 1 02:19:46 PST 2022


nikic added inline comments.


================
Comment at: llvm/test/Transforms/ArgumentPromotion/fp80.ll:44
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[BITCAST:%.*]] = bitcast %union.u* [[ARG]] to %struct.s*
-; CHECK-NEXT:    [[GEP:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], %struct.s* [[BITCAST]], i64 0, i32 2
-; CHECK-NEXT:    [[RESULT:%.*]] = load i8, i8* [[GEP]], align 1
-; CHECK-NEXT:    ret i8 [[RESULT]]
+; CHECK-NEXT:    ret i8 [[ARG_10_VAL]]
 ;
----------------
Worth highlighting that ArgPromotion has two separate promotion mechanisms, one that works only for byval, and one that is generally applicable. This case fails byval promotion, and previously failed general promotion. With the new implementation, it still fails byval promotion, but can now be generally promoted. Same for the case below.


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

https://reviews.llvm.org/D118685



More information about the llvm-commits mailing list