Details
Details
- Reviewers
spatel - Commits
- rGcaa9f63022d2: [CodeGen] Refactor visitSCALAR_TO_VECTOR. NFC.
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Less readable to me, but shorter, so I'll say LGTM - see inline for some possible minor improvements.
Note that there is potentially a real cost to writing code like this:
https://github.com/llvm/llvm-project/issues/58982
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
23551–23558 | I find it easier to notice pseudo-loops like this if we write it this way: for (int i : {0, 1}) { | |
23554–23558 | Reduce levels of indents: SDValue EE = Scalar.getOperand(i); auto *C = dyn_cast<ConstantSDNode>(Scalar.getOperand(i ? 0 : 1)); if (C && EE.getOpcode() == ...) Also, a "i ? 0 : 1" pattern seems more obvious to me than "1 - i". |
I find it easier to notice pseudo-loops like this if we write it this way: