ConstantInt has some getters which return ConstantInt's or ConstantVector's of

the value splatted into every element. Extend this to getTrue and getFalse which
by providing new overloads that take Types that are either i1 or <N x i1>. Use
it in InstCombine to add vector support to some code, fixing PR8469!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127116 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky
2011-03-06 03:36:19 +00:00
parent 511cab20cb
commit d01f50f42c
4 changed files with 65 additions and 28 deletions

View File

@@ -465,3 +465,13 @@ define i1 @test48(i32 %X, i32 %Y, i32 %Z) {
%C = icmp eq i32 %A, %B
ret i1 %C
}
; PR8469
; CHECK: @test49
; CHECK: ret <2 x i1> <i1 true, i1 true>
define <2 x i1> @test49(<2 x i32> %tmp3) {
entry:
%tmp11 = and <2 x i32> %tmp3, <i32 3, i32 3>
%cmp = icmp ult <2 x i32> %tmp11, <i32 4, i32 4>
ret <2 x i1> %cmp
}