Implement a trivial optimization to reduce the number of compares emitted.
For: register short X; if (!X) { We now produce: %tmp = load i16* %X ; <i16> [#uses=1] %tobool = icmp ne i16 %tmp, 0 ; <i1> [#uses=1] %lnot = xor i1 %tobool, true ; <i1> [#uses=1] br i1 %lnot, label %ifthen, label %ifend instead of: %tmp = load i16* %X ; <i16> [#uses=1] %tobool = icmp ne i16 %tmp, 0 ; <i1> [#uses=1] %lnot = xor i1 %tobool, true ; <i1> [#uses=1] %lnot.ext = zext i1 %lnot to i32 ; <i32> [#uses=1] %tobool1 = icmp ne i32 %lnot.ext, 0 ; <i1> [#uses=1] br i1 %tobool1, label %ifthen, label %ifend llvm-svn: 39560
Loading
Please register or sign in to comment