This is an archive of the discontinued LLVM Phabricator instance.

[CFLGraph] Add FAdd to visitConstantExpr.
ClosedPublic

Authored by craig.topper on Jun 1 2019, 9:51 PM.

Details

Summary

This looks like an oversight as all the other binary operators are present.

Accidentally noticed while auditing places that need FNeg handling.

Not sure how to test this.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Jun 1 2019, 9:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2019, 9:51 PM
Herald added a subscriber: hiraditya. · View Herald Transcript

Thanks for this!

I'm not super concerned about testing for this patch, since fadd can't operate on pointer types, so both assign edges would just get dropped anyway. It'd boil down to "let's not crash on this one known case," when we have many known cases in reality. :)

(If you really want a test, I'd assume it'd involve forcing an fadd to appear in $X in something like getelementptr inbounds ([50 x i8], [50 x i8]* @cs, i64 0, i64 $X). ConstProp/bitcast.ll creatively does that: ret i1 icmp eq (i32 ptrtoint (i16* @a to i32), i32 bitcast (float fadd (float bitcast (i32 ptrtoint (i16* @b to i32) to float), float 2.000000e+00) to i32)), but again, I'm happy without it.)

This revision is now accepted and ready to land.Jun 3 2019, 11:43 AM
This revision was automatically updated to reflect the committed changes.