Revert "[NFC][SROA] `speculateSelectInstLoads()`: play nice with typed pointers for...
authorMax Kazantsev <mkazantsev@azul.com>
Wed, 21 Dec 2022 04:17:49 +0000 (11:17 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Wed, 21 Dec 2022 04:21:56 +0000 (11:21 +0700)
This reverts commit 9f27f4536e19e93349b0662338408efe6d1cb2fd.

Supposed to be NFC, but broke buildbots (test addrspacecast.ll is failing).

llvm/lib/Transforms/Scalar/SROA.cpp

index 350e8bd..1bea80b 100644 (file)
@@ -1518,14 +1518,6 @@ static void speculateSelectInstLoads(SelectInst &SI, LoadInst &LI,
 
   assert(LI.isSimple() && "We only speculate simple loads");
 
-  if (auto *TypedPtrTy = LI.getType()->getPointerTo();
-      SI.getType() != TypedPtrTy) {
-    TV = BitCastInst::CreatePointerBitCastOrAddrSpaceCast(TV, TypedPtrTy, "",
-                                                          &LI);
-    FV = BitCastInst::CreatePointerBitCastOrAddrSpaceCast(FV, TypedPtrTy, "",
-                                                          &LI);
-  }
-
   IRB.SetInsertPoint(&LI);
   LoadInst *TL =
       IRB.CreateAlignedLoad(LI.getType(), TV, LI.getAlign(),