Useful metadata like llvm.loop can be lost when the new branch instruction is created. Grab that metadata from the old branch.
Add a LIT test to check
Details
Diff Detail
Event Timeline
llvm/test/Transforms/JumpThreading/preserve-select-unfold.ll | ||
---|---|---|
4 | Use update_test_checks.py with --check-globals, remove data layout and triple. | |
11 | The metadata you are testing for appear to already be present without your patch: https://llvm.godbolt.org/z/GqW8oo5fb |
Thanks for the trust, but the change preserving metadata during jump-threading was my first LLVM commit, so my review would not be worth much.
I see that this is not needed any more. No idea why my version of LLVM has this problem....
llvm/test/Transforms/JumpThreading/preserve-select-unfold.ll | ||
---|---|---|
4 | Actually, this was the wrong test case :-). It was supposed to be https://llvm.godbolt.org/z/GKzGzEr7o. On the other hand, it seems to be working as well. I was basing my change on an older LLVM. I am trying to bring it up to trunk. |
Use update_test_checks.py with --check-globals, remove data layout and triple.