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

Sven van Haastregt via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 6 03:27:08 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL341536: Fix argument type in MachineInstr::hasPropertyInBundle (authored by svenvh, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D51596?vs=163814&id=164180#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D51596

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


Index: llvm/trunk/include/llvm/CodeGen/MachineInstr.h
===================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstr.h
+++ llvm/trunk/include/llvm/CodeGen/MachineInstr.h
@@ -584,6 +584,8 @@
   /// The second argument indicates whether the query should look inside
   /// instruction bundles.
   bool hasProperty(unsigned MCFlag, QueryType Type = AnyInBundle) const {
+    assert(MCFlag < 64 &&
+           "MCFlag out of range for bit mask in getFlags/hasPropertyInBundle.");
     // Inline the fast path for unbundled or bundle-internal instructions.
     if (Type == IgnoreBundle || !isBundled() || isBundledWithPred())
       return getDesc().getFlags() & (1ULL << MCFlag);
@@ -1550,7 +1552,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.
Index: llvm/trunk/lib/CodeGen/MachineInstr.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp
+++ llvm/trunk/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) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51596.164180.patch
Type: text/x-patch
Size: 1760 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180906/ce8013a0/attachment.bin>


More information about the llvm-commits mailing list