I'm looking at possibly making some changes near this code. While doing that I noticed that there was a dyn_cast that was already protected by an earlier isa check. And once we do that we can hoist the cast used in the other if block and only do the cast once.
Details
Details
Diff Detail
Diff Detail
Event Timeline
lib/Transforms/Scalar/JumpThreading.cpp | ||
---|---|---|
583 | "Cmp->getType()->isIntegerTy()" is always true, so you could just make this "if (Constant *CmpConst = dyn_cast<Constant>(Cmp->getOperand(1)))". |
Comment Actions
Oh, oops, you're right. Could you change it to check isVectorTy() instead, to make that more obvious?
Otherwise LGTM.
"Cmp->getType()->isIntegerTy()" is always true, so you could just make this "if (Constant *CmpConst = dyn_cast<Constant>(Cmp->getOperand(1)))".