[PATCH] D51596: Fix bug in MachineInstr::hasPropertyInBundle

Mikael Nilsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 4 06:09:12 PDT 2018


mikael updated this revision to Diff 163794.
mikael retitled this revision from "Fixed bug in MachineInstr::hasPropertyInBundle" to "Fix bug in MachineInstr::hasPropertyInBundle".
mikael added a comment.

Updated the patch to include suggestions from @bjope


Repository:
  rL LLVM

https://reviews.llvm.org/D51596

Files:
  include/llvm/CodeGen/MachineInstr.h
  lib/CodeGen/MachineInstr.cpp


Index: lib/CodeGen/MachineInstr.cpp
===================================================================
--- lib/CodeGen/MachineInstr.cpp
+++ lib/CodeGen/MachineInstr.cpp
@@ -517,7 +517,7 @@
   return getFlags() | Other.getFlags();
 }
 
-bool MachineInstr::hasPropertyInBundle(unsigned Mask, QueryType Type) const {
+bool MachineInstr::hasPropertyInBundle(uint64_t Mask, QueryType Type) const {
   assert(!isBundledWithPred() && "Must be called on bundle header");
   for (MachineBasicBlock::const_instr_iterator MII = getIterator();; ++MII) {
     if (MII->getDesc().getFlags() & Mask) {
Index: include/llvm/CodeGen/MachineInstr.h
===================================================================
--- include/llvm/CodeGen/MachineInstr.h
+++ include/llvm/CodeGen/MachineInstr.h
@@ -584,6 +584,7 @@
   /// The second argument indicates whether the query should look inside
   /// instruction bundles.
   bool hasProperty(unsigned MCFlag, QueryType Type = AnyInBundle) const {
+    assert(MCFlag < 64);
     // Inline the fast path for unbundled or bundle-internal instructions.
     if (Type == IgnoreBundle || !isBundled() || isBundledWithPred())
       return getDesc().getFlags() & (1ULL << MCFlag);
@@ -1550,7 +1551,7 @@
   void AddRegOperandsToUseLists(MachineRegisterInfo&);
 
   /// Slow path for hasProperty when we're dealing with a bundle.
-  bool hasPropertyInBundle(unsigned Mask, QueryType Type) const;
+  bool hasPropertyInBundle(uint64_t Mask, QueryType Type) const;
 
   /// Implements the logic of getRegClassConstraintEffectForVReg for the
   /// this MI and the given operand index \p OpIdx.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51596.163794.patch
Type: text/x-patch
Size: 1611 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180904/79e1137c/attachment.bin>


More information about the llvm-commits mailing list