This is possibly somewhat subjective, but having an explicitly named flag to track the property required and code structure that more closely matches phase 1/2 of the dataflow seems much easier to read.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp | ||
---|---|---|
1111–1112 | Why is this one true? If we insert a vsetvli in the body of the above if, don't we need to not use needVSETVLIPHI in the future? |
I think the simplification is good and I'd like to see something like this. Starting off with predecessor info is logical.
I'm not sure about the name PrefixTransparent though - I think that variable needs explanation (in a comment) because, personally, the name doesn't do it on its own.
llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp | ||
---|---|---|
1111–1112 | I was also wondering that. |
Fix bug noted by reviewers, and add requested comment.
llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp | ||
---|---|---|
1111–1112 | Because that's a flat out bug in the patch. Oops! Fixed in the new version. |
I was wondering if this would be better represented as Optional<VSETVLIInfo> LocalBBInfo initialized to None before traversing the block. We'd update it along with CurInfo (LocalBBInfo = CurInfo). Then we'd know that if LocalBBInfo has been set there have been block-local updates to VL/VTYPE and thus it's not safe to look through PHIs. At least I'd find that a little to grok. It's subjective, after all.
So, LGTM.
llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp | ||
---|---|---|
1079 | changed? |
changed?