From 14359ef1b6a0610ac91df5f5a91c88a0b51c187c Mon Sep 17 00:00:00 2001 From: James Y Knight Date: Fri, 1 Feb 2019 20:44:24 +0000 Subject: [opaque pointer types] Pass value type to LoadInst creation. This cleans up all LoadInst creation in LLVM to explicitly pass the value type rather than deriving it from the pointer's element-type. Differential Revision: https://reviews.llvm.org/D57172 llvm-svn: 352911 --- llvm/unittests/Analysis/SparsePropagation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/unittests/Analysis/SparsePropagation.cpp') diff --git a/llvm/unittests/Analysis/SparsePropagation.cpp b/llvm/unittests/Analysis/SparsePropagation.cpp index 58f059f30a8..bab14a2d055 100644 --- a/llvm/unittests/Analysis/SparsePropagation.cpp +++ b/llvm/unittests/Analysis/SparsePropagation.cpp @@ -381,7 +381,7 @@ TEST_F(SparsePropagationTest, FunctionDefined) { BasicBlock *Else = BasicBlock::Create(Context, "else", F); F->arg_begin()->setName("cond"); Builder.SetInsertPoint(If); - LoadInst *Cond = Builder.CreateLoad(F->arg_begin()); + LoadInst *Cond = Builder.CreateLoad(Type::getInt1Ty(Context), F->arg_begin()); Builder.CreateCondBr(Cond, Then, Else); Builder.SetInsertPoint(Then); Builder.CreateRet(Builder.getInt64(1)); @@ -421,7 +421,7 @@ TEST_F(SparsePropagationTest, FunctionOverDefined) { BasicBlock *Else = BasicBlock::Create(Context, "else", F); F->arg_begin()->setName("cond"); Builder.SetInsertPoint(If); - LoadInst *Cond = Builder.CreateLoad(F->arg_begin()); + LoadInst *Cond = Builder.CreateLoad(Type::getInt1Ty(Context), F->arg_begin()); Builder.CreateCondBr(Cond, Then, Else); Builder.SetInsertPoint(Then); Builder.CreateRet(Builder.getInt64(0)); -- cgit v1.2.3