[PATCH] D99546: [llvm][ValueMap] Share the value map between MappingContext

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 29 15:50:31 PDT 2021


steven_wu added inline comments.


================
Comment at: llvm/test/Linker/global-alias-value-map.ll:6
+
+@"$ss8SIMDMaskVyxGs11SIMDStoragessADPy6ScalarQzSicigTW.ptrauth" = dso_local local_unnamed_addr constant i8* bitcast (void (i1*, i64, i64*, i64*, i8**)* @"$ss8SIMDMaskVyxGs11SIMDStoragessADPy6ScalarQzSicigTW" to i8*)
+
----------------
dexonsmith wrote:
> Please simplify the symbol names in the testcase; I'd suggest something like:
> ```
> @dsolocal = ...
> @alias = ...
> @constant1 = ...
> @constant2 = ...
> define @function(...) { ... }
> declare @external(...)
> ```
Sure. Those were the original symbol name from `libswiftCore`. Kept it here for some context. 


================
Comment at: llvm/test/Linker/global-alias-value-map.ll:10-12
+@"$ss27ExpressibleByIntegerLiteralMp" = constant <{ i32, i32 }> <{ i32 0, i32 trunc (i64 sub (i64 ptrtoint (<{ i32, i32 }>* @"$ss35_ExpressibleByBuiltinIntegerLiteralMp" to i64), i64 ptrtoint (i32* getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @"$ss27ExpressibleByIntegerLiteralMp", i32 0, i32 0) to i64)) to i32)}>
+
+@"$ss35_ExpressibleByBuiltinIntegerLiteralMp" = constant <{ i32, i32 }> <{ i32 0, i32 0 }>
----------------
dexonsmith wrote:
> I wonder, can this be reduced further by inlining the second constant into the first?
No, the second constant needs to be referenced by one alias and another normal GV. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99546



More information about the llvm-commits mailing list