We can sometimes get into the situation where the operand to a vctp intrinsic becomes constant, such as after a loop is fully unrolled. This adds the constant folding needed for them, allowing them to simplify away and hopefully simplifying remaining instructions.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Ah. Sure, I think I can move it there. For some reason I was under the impression that constant folding did not handle target intrinsics, but I see there are some x86 and amd intrinsics in there already.
Comment Actions
With this now in ConstantFolding, this looks good to me. Please wait a day in case there are more comments.
Comment Actions
We might want to look at migrating the target-specific code into the target, similar to what we're doing for target-specific intrinsics in instcombine.
llvm/lib/Analysis/ConstantFolding.cpp | ||
---|---|---|
2765 | Are these just ConstantInt::getTrue() and ConstantInt::getFalse()? |
Comment Actions
Yep. Sounds sensible to me. (That's one of the reason's I didn't think ConstantFolding handled target intrinsics). The instcombine side should probably go in first though.
Are these just ConstantInt::getTrue() and ConstantInt::getFalse()?