Details
- Reviewers
rsandifo uabelho mehdi_amini
Diff Detail
Event Timeline
lib/Transforms/Scalar/Scalarizer.cpp | ||
---|---|---|
110 | It is not clear to me what is this doing? Looks like you mimic'd struct BinarySplitter, but simplifications make it moot. | |
412 | Document the function | |
431 | Is this dead code? | |
437 | This seems to assume that every vector operand must have the same number of elements as the returned type? | |
439 | Would this loop be equivalent to: for (auto &Operand : I->operands()) { if (!Operand.getType()->isVectorTy()) ScalarOperands[I] = CI.getOperand(I); else { Scattered[I] = scatter(&CI, CI.getOperand(I)); assert(Scattered[I].size() == NumElems && "mismatched call operands"); } } I'm not sure about hasVectorInstrinsicScalarOpd though... | |
445 | I think you could pass the initial size to the ctor. | |
462 | A comment above the loop can be appreciated. |
Address comments
lib/Transforms/Scalar/Scalarizer.cpp | ||
---|---|---|
437 | This is true for all of the current intrinsics, I can add a comment | |
439 | Yes, the hasVectorInstrinsicScalarOpd is why this is over the index | |
445 | That's what I originally did, but the scalar operand complicated using push_back, so now it always sets the appropriate index. I would expect such an intrinsic to fail isTriviallyScalarizable since a different vector size probably should be treated like the scalar operand index |
LGTM, with two comments
lib/Transforms/Scalar/Scalarizer.cpp | ||
---|---|---|
437 | The comment seems truncated (and too long for a single line), clang-format? I'm surprised no intrinsic are breaking this, is it an assumption baked everywhere in the optimizer? | |
439 | Why using this hasVectorInstrinsicScalarOpd()? |
lib/Transforms/Scalar/Scalarizer.cpp | ||
---|---|---|
437 | I don't think it's that surprising. There's no obvious scalarizaton/vectorization for something like that. Not many places really care about the general types of intrinsics besides the vectorizers. | |
439 | It also checks the operand index. This is just the existing mechanism, I guess it would also work to check the type |
lib/Transforms/Scalar/Scalarizer.cpp | ||
---|---|---|
439 | The use below needs it because it doesn't check the actual value, it only knows the index when picking between the vector and scalar args |
It is not clear to me what is this doing?
(Why do you need the CI member for instance)
Looks like you mimic'd struct BinarySplitter, but simplifications make it moot.