[lworld] RFR: 8320225: [lworld] TestBasicFunctionality::test20 fails intermittently because it does not correctly handle coalescing of subword stores

Tobias Hartmann thartmann at openjdk.org
Tue Nov 21 14:28:15 UTC 2023


On Tue, 21 Nov 2023 10:35:33 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

> `TestBasicFunctionality::test20` fails intermittently if one of the randomly chosen field values of a value object is zero because that will lead to slightly different type information for the captured stores that initialize the object. 
> 
> Passing case:
> 
> 299  StoreP  === 330 375 285 290  [[ 302 304 ]]  @rawptr:BotPTR, idx=Raw;  Memory: @rawptr:BotPTR, idx=Raw;
> 304  StoreL  === 330 299 289 302  [[ 308 ]]  @null  Memory: @rawptr:BotPTR, idx=Raw;
> 308  StoreNKlass  === 330 304 306 331  [[ 316 ]]  @null  Memory: @rawptr:BotPTR, idx=Raw;
> 316  StoreI  === 330 308 315 57  [[ 280 ]]  @rawptr:BotPTR, idx=Raw;  Memory: @rawptr:BotPTR, idx=Raw;
> 311  StoreL  === 279 280 309 310  [[ 246 ]]  @rawptr:BotPTR, idx=Raw;  Memory: @rawptr:BotPTR, idx=Raw; !orig=[245],3161 !jvms: MyValue1::<vnew> @ bci:82 (line 57) MyValue1::setV4 @ bci:40 (line 178) MyValue1::createWithFieldsInline @ bci:106 (line 89) TestBasicFunctionality::test20 @ bci:6 (line 475)
> 246  StoreL  === 279 311 254 188  [[ 314 ]]  @compiler/valhalla/inlinetypes/MyValue2 (compiler/valhalla/inlinetypes/MyInterface):exact+24 *, name=l, idx=11;  Memory: @rawptr:BotPTR, idx=Raw; !orig=3166 !jvms: MyValue1::<vnew> @ bci:82 (line 57) MyValue1::setV4 @ bci:40 (line 178) MyValue1::createWithFieldsInline @ bci:106 (line 89) TestBasicFunctionality::test20 @ bci:6 (line 475)
> 314  StoreL  === 279 246 312 313  [[ 231 ]]  @rawptr:BotPTR, idx=Raw;  Memory: @rawptr:BotPTR, idx=Raw; !orig=[248],3178 !jvms: MyValue1::<vnew> @ bci:82 (line 57) MyValue1::setV4 @ bci:40 (line 178) MyValue1::createWithFieldsInline @ bci:106 (line 89) TestBasicFunctionality::test20 @ bci:6 (line 475)
> 
> 
> Failing case:
> 
> 300  StoreP  === 337 384 286 291  [[ 303 305 ]]  @rawptr:BotPTR, idx=Raw;  Memory: @rawptr:BotPTR, idx=Raw;
> 305  StoreL  === 337 300 290 303  [[ 309 ]]  @null  Memory: @rawptr:BotPTR, idx=Raw;
> 309  StoreNKlass  === 337 305 307 338  [[ 317 ]]  @null  Memory: @rawptr:BotPTR, idx=Raw;
> 317  StoreI  === 337 309 316 57  [[ 343 ]]  @rawptr:BotPTR, idx=Raw;  Memory: @rawptr:BotPTR, idx=Raw;
> 343  StoreL  === 337 317 322 184  [[ 281 ]]  @rawptr:BotPTR, idx=Raw;  Memory: @rawptr:BotPTR, idx=Raw; !orig=[323]
> 312  StoreL  === 280 281 310 311  [[ 315 ]]  @rawptr:BotPTR, idx=Raw;  Memory: @rawptr:BotPTR, idx=Raw; !orig=[248],3163 !jvms: MyValue1::<vnew> @ bci:82 (line 57) MyValue1::setV4 @ bci:40 (line 178) MyValue1::createWithFieldsInline @ bci:106 (line 89) TestBasicFunctionality::test20 @ bci:6 (line 475)
> 315  StoreL  === 280 312 313 314  [[ 234 ]]  @ra...

On second thought, this is still not sufficient because depending on which field values are zero, C2 will replace some of the stores by `StoreI`s instead:


 302  StoreP  === 337 382 288 293  [[ 305 307 ]]  @rawptr:BotPTR, idx=Raw;  Memory: @rawptr:BotPTR, idx=Raw;
 307  StoreL  === 337 302 292 305  [[ 311 ]]  @null  Memory: @rawptr:BotPTR, idx=Raw;
 311  StoreNKlass  === 337 307 309 338  [[ 321 ]]  @null  Memory: @rawptr:BotPTR, idx=Raw;
 321  StoreI  === 337 311 320 57  [[ 323 ]]  @rawptr:BotPTR, idx=Raw;  Memory: @rawptr:BotPTR, idx=Raw;
 323  StoreI  === 337 321 322 57  [[ 283 ]]  @rawptr:BotPTR, idx=Raw;  Memory: @rawptr:BotPTR, idx=Raw;
 316  StoreI  === 282 283 314 315  [[ 249 ]]  @rawptr:BotPTR, idx=Raw;  Memory: @rawptr:BotPTR, idx=Raw; !orig=[248],3159 !jvms: MyValue1::<vnew> @ bci:82 (line 57) MyValue1::setV4 @ bci:40 (line 178) MyValue1::createWithFieldsInline @ bci:96 (line 89) TestBasicFunctionality::test20 @ bci:6 (line 477)
 249  StoreL  === 282 316 257 191  [[ 319 ]]  @compiler/valhalla/inlinetypes/MyValue2 (compiler/valhalla/inlinetypes/MyInterface):exact+24 *, name=l, idx=11;  Memory: @rawptr:BotPTR, idx=Raw; !orig=3164 !jvms: MyValue1::<vnew> @ bci:82 (line 57) MyValue1::setV4 @ bci:40 (line 178) MyValue1::createWithFieldsInline @ bci:96 (line 89) TestBasicFunctionality::test20 @ bci:6 (line 477)
 319  StoreL  === 282 249 317 318  [[ 234 ]]  @rawptr:BotPTR, idx=Raw;  Memory: @rawptr:BotPTR, idx=Raw; !orig=[251],3176 !jvms: MyValue1::<vnew> @ bci:82 (line 57) MyValue1::setV4 @ bci:40 (line 178) MyValue1::createWithFieldsInline @ bci:96 (line 89) TestBasicFunctionality::test20 @ bci:6 (line 477)
``` 

Let's just remove the IR rule instead, it does not have much value anyway.

-------------

PR Comment: https://git.openjdk.org/valhalla/pull/957#issuecomment-1821018469



More information about the valhalla-dev mailing list