[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:39:36 PST 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4e37f068dcf4: [NFC] Remove isSafeToSpeculativelyExecute checks for casts (authored by kachkov98).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143255/new/

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.494569.patch
Type: text/x-patch
Size: 1334 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230203/f6a6865c/attachment.bin>


More information about the llvm-commits mailing list