[llvm] e37b6a6 - [Hexagon] Some compound opportunities missed in presence of branches
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 6 14:20:33 PST 2022
Author: Colin LeMahieu
Date: 2022-01-06T14:16:23-08:00
New Revision: e37b6a67f8a75c2e6a5a69c03c8ffdb388bafa5f
URL: https://github.com/llvm/llvm-project/commit/e37b6a67f8a75c2e6a5a69c03c8ffdb388bafa5f
DIFF: https://github.com/llvm/llvm-project/commit/e37b6a67f8a75c2e6a5a69c03c8ffdb388bafa5f.diff
LOG: [Hexagon] Some compound opportunities missed in presence of branches
The lld testcase change from ddf1fb1f should take care of the build
breakage from before.
Added:
llvm/test/MC/Hexagon/bug28416.s
Modified:
llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCCompound.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCCompound.cpp b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCCompound.cpp
index 4bb078fb7ecb..3deef95df324 100644
--- a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCCompound.cpp
+++ b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCCompound.cpp
@@ -365,8 +365,10 @@ static bool lookForCompound(MCInstrInfo const &MCII, MCContext &Context,
MCI.begin() + HexagonMCInstrInfo::bundleInstructionsOffset;
B != MCI.end(); ++B) {
MCInst const *Inst = B->getInst();
- if (JumpInst == Inst)
+ if (JumpInst == Inst) {
+ BExtended = false;
continue;
+ }
if (HexagonMCInstrInfo::isImmext(*Inst)) {
BExtended = true;
continue;
diff --git a/llvm/test/MC/Hexagon/bug28416.s b/llvm/test/MC/Hexagon/bug28416.s
new file mode 100644
index 000000000000..237d577a7a48
--- /dev/null
+++ b/llvm/test/MC/Hexagon/bug28416.s
@@ -0,0 +1,11 @@
+# RUN: llvm-mc -arch=hexagon -filetype=obj -o - %s | llvm-objdump -d -
+# r0 = r6 and jump ##undefined should compound to J4_jumpsetr
+
+# CHECK: { immext(#0)
+# CHECK: r0 = r6 ; jump 0x0
+# CHECK: r1 = memub(r6+#21)
+# CHECK: memw(r9+#0) = r0 }
+{ memw(r9) = r0
+ r0 = r6
+ r1 = memub(r6+#21)
+ jump ##undefined }
More information about the llvm-commits
mailing list