[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
Mon Nov 13 13:31:40 PST 2017


asb updated this revision to Diff 122719.
asb edited the summary of this revision.
asb added a comment.

Thanks Reid, updated the patch with that change. I'll aim to commit tomorrow.


https://reviews.llvm.org/D39941

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


Index: include/llvm/Target/Target.td
===================================================================
--- include/llvm/Target/Target.td
+++ 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 {
Index: include/llvm/CodeGen/MachineInstr.h
===================================================================
--- include/llvm/CodeGen/MachineInstr.h
+++ 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;


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


More information about the llvm-commits mailing list