builtin expect passed to select instruction gets ignored. This patch fixes the issue.
Details
Details
Diff Detail
Diff Detail
Event Timeline
| lib/Transforms/Scalar/LowerExpectIntrinsic.cpp | ||
|---|---|---|
| 86–87 | Neat trick. :) | |
| 159–160 | Fix comment to indicate why we are using reverse iterator (and that we're also handling selects in this loop). | |
| 160–170 | Use 'auto' to avoid 80-col ugliness? | |
| test/Transforms/LowerExpectIntrinsic/basic.ll | ||
| 276–287 | Minimize test? define i32 @test10(i64 %t6) {
%t7 = call i64 @llvm.expect.i64(i64 %t6, i64 0)
%t8 = icmp ne i64 %t7, 0
%t9 = select i1 %t8, i32 42, i32 43
ret i32 %t9
} | |
Neat trick. :)
But can you add a comment and/or rename BI, so it is clear that this isn't strictly for a 'BI' (BranchInst) any more?