Commit 630d55c
authored
[AsmPrinter] Always emit global equivalents if there is non-global uses (#145648)
A case found from rust-lang/rust#142752:
https://llvm.godbolt.org/z/T7ce9saWh.
We should emit `@bar_0` for the following code:
```llvm
target triple = "x86_64-unknown-linux-gnu"
@rel_0 = private unnamed_addr constant [1 x i32] [
i32 trunc (i64 sub (i64 ptrtoint (ptr @bar_0 to i64), i64 ptrtoint (ptr @rel_0 to i64)) to i32)]
@bar_0 = internal unnamed_addr constant ptr @foo_0, align 8
@foo_0 = external global ptr, align 8
define void @foo(ptr %arg0) {
store ptr @bar_0, ptr %arg0, align 8
ret void
}
```1 parent 892a263 commit 630d55c
File tree
2 files changed
+53
-7
lines changed- llvm
- lib/CodeGen/AsmPrinter
- test/MC/X86
2 files changed
+53
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2142 | 2142 | | |
2143 | 2143 | | |
2144 | 2144 | | |
2145 | | - | |
2146 | | - | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
2147 | 2149 | | |
| 2150 | + | |
2148 | 2151 | | |
2149 | 2152 | | |
2150 | 2153 | | |
2151 | 2154 | | |
2152 | 2155 | | |
2153 | 2156 | | |
2154 | | - | |
| 2157 | + | |
| 2158 | + | |
2155 | 2159 | | |
2156 | 2160 | | |
2157 | 2161 | | |
| |||
2162 | 2166 | | |
2163 | 2167 | | |
2164 | 2168 | | |
2165 | | - | |
| 2169 | + | |
| 2170 | + | |
2166 | 2171 | | |
2167 | 2172 | | |
2168 | 2173 | | |
| |||
2174 | 2179 | | |
2175 | 2180 | | |
2176 | 2181 | | |
2177 | | - | |
| 2182 | + | |
| 2183 | + | |
2178 | 2184 | | |
2179 | 2185 | | |
2180 | 2186 | | |
| |||
2192 | 2198 | | |
2193 | 2199 | | |
2194 | 2200 | | |
2195 | | - | |
| 2201 | + | |
| 2202 | + | |
2196 | 2203 | | |
2197 | | - | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
2198 | 2208 | | |
2199 | 2209 | | |
2200 | 2210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments