The function extractArgumentsFromModule() was passing a one-based index to,
but replaceFunctionCalls() was expecting a zero-based argument index. This
resulted in assertion errors when reducing function call arguments with
different types. Additionally, the
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
llvm/tools/llvm-reduce/deltas/ReduceArguments.cpp | ||
---|---|---|
84–87 | Let's take this one step further, shall we? std::set<int> ArgIndexesToKeep; for (auto &Arg : enumerate(F->args())) if (ArgsToKeep.count(&Arg.value())) ArgIndexesToKeep.insert(Arg.index()); |
llvm/tools/llvm-reduce/deltas/ReduceArguments.cpp | ||
---|---|---|
84–87 | Yes, much better! I realized just after submitting this patch that the index is not always being incremented so my non-minimal test case still crashed. Will add a better test case. |
Fix missing increment using @lebedev.ri's suggestion
Improve test case to crash without this change.
LG, thank you.
llvm/test/Reduce/remove-args-2.ll | ||
---|---|---|
5 | I guess i will indeed have to cleanup all the existing tests :S |
llvm/test/Reduce/remove-args-2.ll | ||
---|---|---|
5–6 | Sorry I've only been watching this work superficially - but it looked like some other patches were moving towards using FileCheck directly (as the test program) for new llvm-reduce tests? Could that be done here too? |
llvm/test/Reduce/remove-args-2.ll | ||
---|---|---|
5–6 | Yeah that would definitely work. I didn't do it here since the test I used as a baseline didn't and I was able to reuse the same script. I can commit a follow-up change to use Filecheck for this test unless @lebedev.ri already has a change to clean up the existing tests. |
llvm/test/Reduce/remove-args-2.ll | ||
---|---|---|
5–6 |
Please feel free to. See latest tests i've added for examples. |
llvm/test/Reduce/remove-args-2.ll | ||
---|---|---|
5–6 |
I guess i will indeed have to cleanup all the existing tests :S