This teaches the constant folder that an llvm.expect intrinsic with a constant as the first operand will return that constant.
This reduces the size of an LTO'd llc by over 1% due to branches which can be removed once the constant is propagated.
Differential D7168
Constant fold llvm.expect(c, ...) -> c pete on Jan 25 2015, 9:37 PM. Authored by
Details
This teaches the constant folder that an llvm.expect intrinsic with a constant as the first operand will return that constant. This reduces the size of an LTO'd llc by over 1% due to branches which can be removed once the constant is propagated.
Diff Detail Event TimelineComment Actions LGTM w/the addition of a negative test. (i.e. show constant fold not happening when the first operand isn't constant) |