[PATCH] D23355: getInstSizeInBytes: sentinel value fix for AArch64, AMDGPU, MSP430

Diana Picus via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 03:59:31 PDT 2016


rovka added a subscriber: rovka.

================
Comment at: lib/Target/AArch64/AArch64BranchRelaxation.cpp:174
@@ +173,3 @@
+    // getInstSizeInBytes because here all instructions are seen for the first
+    // time.
+    if (InstSize == ~0U)
----------------
I'm not sure I understand this comment. Why wouldn't you check after every use of getInstSizeInBytes?

================
Comment at: lib/Target/AArch64/AArch64BranchRelaxation.cpp:176
@@ +175,3 @@
+    if (InstSize == ~0U)
+      llvm_unreachable("Failed to get instruction size");
+    Size += InstSize;
----------------
I think you can use an assert instead (here and everywhere else).


https://reviews.llvm.org/D23355





More information about the llvm-commits mailing list