This teaches the SCCP Solver how to constant fold the constrained intrinsics. Constant folding appears to be just as good as D115737 but much, much lower in code change impact as suggested by nikic.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/Utils/SCCPSolver.cpp | ||
---|---|---|
1195 | I don't think we need to check for constrained intrinsics here, we can always skip these, as also done here: https://github.com/llvm/llvm-project/blob/de1e911f02a0b4369287c7d056efc94c3f5dc0cd/llvm/lib/Analysis/InstructionSimplify.cpp#L6299 |
Comment Actions
Update for review comments: allow folding for more than constrained intrinsics.
I left the check for metadata in the same style as the check for struct types two lines up. To my eyes is reads nicer that way, but that's just one person's opinion.
I don't think we need to check for constrained intrinsics here, we can always skip these, as also done here: https://github.com/llvm/llvm-project/blob/de1e911f02a0b4369287c7d056efc94c3f5dc0cd/llvm/lib/Analysis/InstructionSimplify.cpp#L6299