[llvm] r318801 - [Hexagon] Make sure that RDF does not remove EH_LABELs
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 21 13:05:51 PST 2017
Author: kparzysz
Date: Tue Nov 21 13:05:51 2017
New Revision: 318801
URL: http://llvm.org/viewvc/llvm-project?rev=318801&view=rev
Log:
[Hexagon] Make sure that RDF does not remove EH_LABELs
Since EH_LABELs (and other labels) no longer have "side-effects", they
should be checked for separately.
Added:
llvm/trunk/test/CodeGen/Hexagon/rdf-ehlabel-live.mir
Modified:
llvm/trunk/lib/Target/Hexagon/RDFDeadCode.cpp
Modified: llvm/trunk/lib/Target/Hexagon/RDFDeadCode.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/RDFDeadCode.cpp?rev=318801&r1=318800&r2=318801&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/RDFDeadCode.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/RDFDeadCode.cpp Tue Nov 21 13:05:51 2017
@@ -58,7 +58,8 @@ private:
bool DeadCodeElimination::isLiveInstr(const MachineInstr *MI) const {
if (MI->mayStore() || MI->isBranch() || MI->isCall() || MI->isReturn())
return true;
- if (MI->hasOrderedMemoryRef() || MI->hasUnmodeledSideEffects())
+ if (MI->hasOrderedMemoryRef() || MI->hasUnmodeledSideEffects() ||
+ MI->isPosition())
return true;
if (MI->isPHI())
return false;
Added: llvm/trunk/test/CodeGen/Hexagon/rdf-ehlabel-live.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Hexagon/rdf-ehlabel-live.mir?rev=318801&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Hexagon/rdf-ehlabel-live.mir (added)
+++ llvm/trunk/test/CodeGen/Hexagon/rdf-ehlabel-live.mir Tue Nov 21 13:05:51 2017
@@ -0,0 +1,17 @@
+# RUN: llc -march=hexagon -run-pass hexagon-rdf-opt -o - %s | FileCheck %s
+
+# Check that EH_LABELs are not removed as dead (since they are no longer
+# marked as having side-effects):
+# CHECK-LABEL: fred
+# CHECK: EH_LABEL
+
+---
+name: fred
+tracksRegLiveness: true
+
+body: |
+ bb.0:
+ %r0 = A2_tfrsi 0
+ EH_LABEL 0
+...
+
More information about the llvm-commits
mailing list