If OtherOpT or OtherOpF have scalar types and the condition is a vector,
we would create an invalid select.
Details
Diff Detail
Event Timeline
LGTM - see inline for some minor bits.
lib/Transforms/InstCombine/InstCombineSelect.cpp | ||
---|---|---|
365 | I found this comment confusing. The select operands themselves are vectors, but the operands of those operands must also be vectors. This can only be a problem with GEPs? If that's correct, let's state that in the comment. | |
test/Transforms/InstCombine/select-gep.ll | ||
141 | We could reduce this a bit I think: define <2 x i64*> @test5(i64* %gep1, i64* %gep2, <2 x i1> %cc) { %gep3 = getelementptr i64, i64* %gep1, <2 x i64> undef %gep4 = getelementptr i64, i64* %gep2, <2 x i64> undef %select = select <2 x i1> %cc, <2 x i64*> %gep3, <2 x i64*> %gep4 ret <2 x i64*> %select } |
lib/Transforms/InstCombine/InstCombineSelect.cpp | ||
---|---|---|
365 | I tried to make it more explicit, what do you think? I *think* it only can happen for getlementptr currently, but there might be other cases ,e.g. if the code around here becomes more powerful) | |
test/Transforms/InstCombine/select-gep.ll | ||
141 | Thanks! I also replaced the undef operand. |
lib/Transforms/InstCombine/InstCombineSelect.cpp | ||
---|---|---|
365 | Works for me - thanks! |
I found this comment confusing. The select operands themselves are vectors, but the operands of those operands must also be vectors. This can only be a problem with GEPs? If that's correct, let's state that in the comment.