[PATCH] D150216: Add support for salvaging debug info from icmp instrcuctions.
Shubham Sandeep Rastogi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 9 13:37:40 PDT 2023
rastogishubham added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:2068-2070
+ uint64_t DwarfIcmpOp = getDwarfOpForIcmpPred(Icmp->getPredicate());
+ if (!DwarfIcmpOp)
+ return nullptr;
----------------
bulbazord wrote:
> You've already changed `AdditionalValues` by the time you get to this point... Do the callers verify that the return value of this function is `nullptr` before using `AdditionalValues`? Even if they do today, somebody may use this function without realizing that this is the behavior with surprising results. My suggestion would be to only mutate the output references (`Opcodes` and `AdditionalValues`) when you know that this function will succeed.
That is a good catch, the check for the predicate doesn't have to be done at the end, so I can move it above the mutation of `AdditionalValues`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150216/new/
https://reviews.llvm.org/D150216
More information about the llvm-commits
mailing list