Skip to content

Commit 83063c6

Browse files
committed
[X86] Remove unnecessary bitcast
1 parent 41fdaba commit 83063c6

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,9 @@ static Instruction *simplifyX86MaskedLoad(IntrinsicInst &II, InstCombiner &IC) {
6767
// The mask is constant or extended from a bool vector. Convert this x86
6868
// intrinsic to the LLVM intrinsic to allow target-independent optimizations.
6969
if (Value *BoolMask = getBoolVecFromMask(Mask, IC.getDataLayout())) {
70-
// First, cast the x86 intrinsic scalar pointer to a vector pointer to match
71-
// the LLVM intrinsic definition for the pointer argument.
72-
unsigned AddrSpace = cast<PointerType>(Ptr->getType())->getAddressSpace();
73-
PointerType *VecPtrTy = PointerType::get(II.getContext(), AddrSpace);
74-
Value *PtrCast = IC.Builder.CreateBitCast(Ptr, VecPtrTy, "castvec");
75-
7670
// The pass-through vector for an x86 masked load is a zero vector.
7771
CallInst *NewMaskedLoad = IC.Builder.CreateMaskedLoad(
78-
II.getType(), PtrCast, Align(1), BoolMask, ZeroVec);
72+
II.getType(), Ptr, Align(1), BoolMask, ZeroVec);
7973
return IC.replaceInstUsesWith(II, NewMaskedLoad);
8074
}
8175

0 commit comments

Comments
 (0)