This was pretty close to working already. While I was here I went ahead and passed the ICmpInst pointer from the caller instead of doing a dyn_cast that can never fail.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
I didn't test it, but I don't see a hasOneUse() check on the cmp, so this might be creating more instructions than we expect. That would be a follow-up change though, so LGTM. See inline for a small potential improvement.
lib/Transforms/InstCombine/InstCombineSelect.cpp | ||
---|---|---|
322 ↗ | (On Diff #112980) | Could use IC->getType() and make this a compound predicate in the first line? |