Previously when constraint system outputs the rows in the system the variables used are x1,2...n making it hard to infer which ones they relate to in the IR
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for looking into this! Would it make sense to change ConstraintSystem to hold a pointer/reference to the corresponding variable map and then isolate the name generation logic and dumping to ConstraintSystem.cpp only?
Would it be possible to add a test to show the additional dbg output, e.g. llvm/test/Transforms/ConstraintElimination/debug.ll?
llvm/include/llvm/Analysis/ConstraintSystem.h | ||
---|---|---|
37 | capitalize first letter of sentence and period at end of sentence. Newline before comment | |
41 | Please run clang-format and remove the needed ; | |
42 | Pass argument as const reference? | |
llvm/lib/Analysis/ConstraintSystem.cpp | ||
111 | Can use (auto &[V, Index] : Value2Index). | |
llvm/lib/Transforms/Scalar/ConstraintElimination.cpp | ||
638–639 | This function isn't needed any longer. | |
639–640 | Change to const reference and adjust name? |
- Modify debug.ll test to display variable names.
- Delete unused functions and rename dumpdumpWithNames to dumpConstraint
- Address style comments
llvm/include/llvm/Analysis/ConstraintSystem.h | ||
---|---|---|
37 | still needs a newline before the comment. | |
42 | not just const, const reference, i.e. const DenseMap<Value *, unsigned> &Value2Index | |
43 | newline before the next function. | |
43 | ; here also needs removed and reformatting. Please run clang-format. | |
103–104 | The bit about using Names needs to be removed. |
LGTM, with a few small nits addressed.
llvm/include/llvm/Analysis/ConstraintSystem.h | ||
---|---|---|
37 | nit: from *the* Value2Index map. | |
llvm/lib/Analysis/ConstraintSystem.cpp | ||
121 | nit: add newline here. | |
124 | nit: the coding style recommends using auto sparingly and spell out full types unless they are too big. So here it would probably be better to use SmallVector<std::string> |
capitalize first letter of sentence and period at end of sentence. Newline before comment