[PATCH] D39941: Set hasSideEffects=0 for TargetOpcode::{CFI_INSTRUCTION, EH_LABEL, GC_LABEL, ANNOTATION_LABEL}

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 11:16:30 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL318174: Set hasSideEffects=0 for TargetOpcode::{CFI_INSTRUCTION,EH_LABEL,GC_LABEL… (authored by asb).

Changed prior to commit:
  https://reviews.llvm.org/D39941?vs=122719&id=122884#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D39941

Files:
  llvm/trunk/include/llvm/CodeGen/MachineInstr.h
  llvm/trunk/include/llvm/Target/Target.td


Index: llvm/trunk/include/llvm/CodeGen/MachineInstr.h
===================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstr.h
+++ llvm/trunk/include/llvm/CodeGen/MachineInstr.h
@@ -797,9 +797,14 @@
 
   bool isEHLabel() const { return getOpcode() == TargetOpcode::EH_LABEL; }
   bool isGCLabel() const { return getOpcode() == TargetOpcode::GC_LABEL; }
+  bool isAnnotationLabel() const {
+    return getOpcode() == TargetOpcode::ANNOTATION_LABEL;
+  }
 
   /// Returns true if the MachineInstr represents a label.
-  bool isLabel() const { return isEHLabel() || isGCLabel(); }
+  bool isLabel() const {
+    return isEHLabel() || isGCLabel() || isAnnotationLabel();
+  }
 
   bool isCFIInstruction() const {
     return getOpcode() == TargetOpcode::CFI_INSTRUCTION;
Index: llvm/trunk/include/llvm/Target/Target.td
===================================================================
--- llvm/trunk/include/llvm/Target/Target.td
+++ llvm/trunk/include/llvm/Target/Target.td
@@ -906,31 +906,31 @@
   let InOperandList = (ins i32imm:$id);
   let AsmString = "";
   let hasCtrlDep = 1;
-  let hasSideEffects = 1;
+  let hasSideEffects = 0;
   let isNotDuplicable = 1;
 }
 def EH_LABEL : Instruction {
   let OutOperandList = (outs);
   let InOperandList = (ins i32imm:$id);
   let AsmString = "";
   let hasCtrlDep = 1;
-  let hasSideEffects = 1;
+  let hasSideEffects = 0;
   let isNotDuplicable = 1;
 }
 def GC_LABEL : Instruction {
   let OutOperandList = (outs);
   let InOperandList = (ins i32imm:$id);
   let AsmString = "";
   let hasCtrlDep = 1;
-  let hasSideEffects = 1;
+  let hasSideEffects = 0;
   let isNotDuplicable = 1;
 }
 def ANNOTATION_LABEL : Instruction {
   let OutOperandList = (outs);
   let InOperandList = (ins i32imm:$id);
   let AsmString = "";
   let hasCtrlDep = 1;
-  let hasSideEffects = 1;
+  let hasSideEffects = 0;
   let isNotDuplicable = 1;
 }
 def KILL : Instruction {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39941.122884.patch
Type: text/x-patch
Size: 1949 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171114/be3cad18/attachment.bin>


More information about the llvm-commits mailing list