llvm.org GIT mirror llvm / fdb230a
Don't try to zExt just to check if an integer constant is zero, it might not fit in a i64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154364 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 8 years ago
2 changed file(s) with 20 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
44304430
44314431 ConstantSDNode *COp0 = dyn_cast(Op0);
44324432 ConstantSDNode *COp1 = dyn_cast(Op1);
4433 if (COp0 && COp0->getZExtValue() == 0)
4433 if (COp0 && COp0->isNullValue())
44344434 Op = Op1;
4435 else if (COp1 && COp1->getZExtValue() == 0)
4435 else if (COp1 && COp1->isNullValue())
44364436 Op = Op0;
44374437 else
44384438 return false;
0 ; RUN: llc < %s
1
2 @c = external global i32, align 4
3
4 define void @foo(i160 %x) {
5 entry:
6 %cmp.i = icmp ne i160 %x, 340282366920938463463374607431768211456
7 %conv.i = zext i1 %cmp.i to i32
8 %tobool.i = icmp eq i32 %conv.i, 0
9 br i1 %tobool.i, label %if.then.i, label %fn1.exit
10
11 if.then.i:
12 store i32 0, i32* @c, align 4
13 br label %fn1.exit
14
15 fn1.exit:
16 ret void
17 }