[PATCH] D143255: [NFC] Remove isSafeToSpeculativelyExecute checks for casts
Sergei Kachkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 3 02:29:26 PST 2023
kachkov98 created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
kachkov98 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
isSafeToSpeculativelyExecute always return true for casts, so remove
this redundant checks.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D143255
Files:
llvm/lib/Analysis/PHITransAddr.cpp
Index: llvm/lib/Analysis/PHITransAddr.cpp
===================================================================
--- llvm/lib/Analysis/PHITransAddr.cpp
+++ llvm/lib/Analysis/PHITransAddr.cpp
@@ -26,12 +26,7 @@
cl::desc("Enable phi-translation of add instructions"));
static bool canPHITrans(Instruction *Inst) {
- if (isa<PHINode>(Inst) ||
- isa<GetElementPtrInst>(Inst))
- return true;
-
- if (isa<CastInst>(Inst) &&
- isSafeToSpeculativelyExecute(Inst))
+ if (isa<PHINode>(Inst) || isa<GetElementPtrInst>(Inst) || isa<CastInst>(Inst))
return true;
if (Inst->getOpcode() == Instruction::Add &&
@@ -182,7 +177,6 @@
// operands need to be phi translated, and if so, reconstruct it.
if (CastInst *Cast = dyn_cast<CastInst>(Inst)) {
- if (!isSafeToSpeculativelyExecute(Cast)) return nullptr;
Value *PHIIn = translateSubExpr(Cast->getOperand(0), CurBB, PredBB, DT);
if (!PHIIn) return nullptr;
if (PHIIn == Cast->getOperand(0))
@@ -373,7 +367,6 @@
// Handle cast of PHI translatable value.
if (CastInst *Cast = dyn_cast<CastInst>(Inst)) {
- if (!isSafeToSpeculativelyExecute(Cast)) return nullptr;
Value *OpVal = insertTranslatedSubExpr(Cast->getOperand(0), CurBB, PredBB,
DT, NewInsts);
if (!OpVal) return nullptr;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143255.494566.patch
Type: text/x-patch
Size: 1334 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230203/fdc6a29e/attachment.bin>
More information about the llvm-commits
mailing list