[llvm-branch-commits] [llvm] 45de421 - AArch64: use correct operand for ubsantrap immediate.
Tim Northover via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Dec 9 02:21:33 PST 2020
Author: Tim Northover
Date: 2020-12-09T10:17:16Z
New Revision: 45de42116e3f588bbead550ab8667388ba4f10ae
URL: https://github.com/llvm/llvm-project/commit/45de42116e3f588bbead550ab8667388ba4f10ae
DIFF: https://github.com/llvm/llvm-project/commit/45de42116e3f588bbead550ab8667388ba4f10ae.diff
LOG: AArch64: use correct operand for ubsantrap immediate.
I accidentally pushed the wrong patch originally.
Added:
llvm/test/CodeGen/AArch64/GlobalISel/ubsantrap.ll
Modified:
llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp b/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
index 0834b0313453..4126017c6fbd 100644
--- a/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
+++ b/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
@@ -4879,7 +4879,7 @@ bool AArch64InstructionSelector::selectIntrinsicWithSideEffects(
break;
case Intrinsic::ubsantrap:
MIRBuilder.buildInstr(AArch64::BRK, {}, {})
- .addImm(I.getOperand(0).getImm() | ('U' << 8));
+ .addImm(I.getOperand(1).getImm() | ('U' << 8));
break;
}
diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/ubsantrap.ll b/llvm/test/CodeGen/AArch64/GlobalISel/ubsantrap.ll
new file mode 100644
index 000000000000..2b72381be35e
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/ubsantrap.ll
@@ -0,0 +1,11 @@
+; RUN: llc -mtriple=arm64-apple-ios %s -o - -global-isel -global-isel-abort=1 | FileCheck %s
+
+define void @test_ubsantrap() {
+; CHECK-LABEL: test_ubsantrap
+; CHECK: brk #0x550c
+; CHECK-GISEL: brk #0x550c
+ call void @llvm.ubsantrap(i8 12)
+ ret void
+}
+
+declare void @llvm.ubsantrap(i8)
More information about the llvm-branch-commits
mailing list