aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2024-05-21 20:49:21 +0200
committerGitHub <noreply@github.com>2024-05-21 20:49:21 +0200
commit8cb19ebd219668ef8efa9ffb4a72e39b18dd91d4 (patch)
tree86253b0ed0331239ac196edbfe3eec5ffff2f2a7
parentce1d28e645b53ba9518d295dad35a4578dd8e8dc (diff)
downloadllvm-8cb19ebd219668ef8efa9ffb4a72e39b18dd91d4.zip
llvm-8cb19ebd219668ef8efa9ffb4a72e39b18dd91d4.tar.gz
llvm-8cb19ebd219668ef8efa9ffb4a72e39b18dd91d4.tar.bz2
InstCombine: Stop handling bitcast in PointerReplacer (#92937)
These should be irrelevant since opaque pointers.
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index 4351a55..832f89e 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
@@ -332,7 +332,7 @@ bool PointerReplacer::collectUsersRecursive(Instruction &I) {
Worklist.insert(SI);
if (!collectUsersRecursive(*SI))
return false;
- } else if (isa<GetElementPtrInst, BitCastInst>(Inst)) {
+ } else if (isa<GetElementPtrInst>(Inst)) {
Worklist.insert(Inst);
if (!collectUsersRecursive(*Inst))
return false;
@@ -393,15 +393,6 @@ void PointerReplacer::replace(Instruction *I) {
NewI->takeName(GEP);
NewI->setIsInBounds(GEP->isInBounds());
WorkMap[GEP] = NewI;
- } else if (auto *BC = dyn_cast<BitCastInst>(I)) {
- auto *V = getReplacement(BC->getOperand(0));
- assert(V && "Operand not replaced");
- auto *NewT = PointerType::get(BC->getType()->getContext(),
- V->getType()->getPointerAddressSpace());
- auto *NewI = new BitCastInst(V, NewT);
- IC.InsertNewInstWith(NewI, BC->getIterator());
- NewI->takeName(BC);
- WorkMap[BC] = NewI;
} else if (auto *SI = dyn_cast<SelectInst>(I)) {
auto *NewSI = SelectInst::Create(
SI->getCondition(), getReplacement(SI->getTrueValue()),