mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-23 12:11:58 +00:00
[ConstantFolding] Fix bitcast vector of i1.
Differential Revision: http://reviews.llvm.org/D21735 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273845 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
00fd9cb07c
commit
baa0bfe5d8
@ -81,7 +81,7 @@ Constant *FoldBitCast(Constant *C, Type *DestTy, const DataLayout &DL) {
|
||||
|
||||
// Now that we know that the input value is a vector of integers, just shift
|
||||
// and insert them into our result.
|
||||
unsigned BitShift = DL.getTypeAllocSizeInBits(SrcEltTy);
|
||||
unsigned BitShift = DL.getTypeSizeInBits(SrcEltTy);
|
||||
APInt Result(IT->getBitWidth(), 0);
|
||||
for (unsigned i = 0; i != NumSrcElts; ++i) {
|
||||
Constant *Element;
|
||||
|
@ -262,3 +262,10 @@ define <2 x i64> @test7(<2 x i8*>* %arg) nounwind {
|
||||
; CHECK: bitcast
|
||||
; CHECK: load
|
||||
}
|
||||
|
||||
define i8 @test8() {
|
||||
%res = bitcast <8 x i1> <i1 true, i1 true, i1 false, i1 true, i1 false, i1 true, i1 false, i1 true> to i8
|
||||
ret i8 %res
|
||||
; CHECK: @test8
|
||||
; CHECK: ret i8 -85
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user