As discussed in D75505, it's not particularly useful to change the type of a volatile load to/from floating-point/integer because it's followed by a bitcast, and it might lead to surprising code generation. Check that this doesn't generally happen.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Can you please add a test where we load i64 (needs datalayout) and then losslessly bitcast it into pointer?
Comment Actions
Okay, thank you for the patch.
Langref changes seem to have gone AWOL.
This doesn't guarantee that we don't do such change elsewhere other than instcombine though.
llvm/test/Transforms/InstCombine/volatile_load_cast.ll | ||
---|---|---|
4 | This needs a comment, something like ; See https://reviews.llvm.org/D75644 and https://reviews.llvm.org/D75505#inline-688817 ; Don't ever change the type of `volatile`-loaded value, keep bitcast afterwards. |
Comment Actions
Odd, the previous update only had the second commit. I've squashed all 3 commits now, so it's all here :)
This needs a comment, something like