[PATCH] D82794: [SystemZ] Add NoMerge MIFlag
Ilya Leoshkevich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 29 11:21:37 PDT 2020
iii created this revision.
iii added reviewers: uweigand, jonpa.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
This fixes ASan and MSan tests on SystemZ after
commit 6a822e20ce70 <https://reviews.llvm.org/rG6a822e20ce700f2f98e80c6ce8dda026099c39b7> ("[ASan][MSan] Remove EmptyAsm and set the CallInst
to nomerge to avoid from merging.").
Based on commit 80e107ccd088 <https://reviews.llvm.org/rG80e107ccd088a2705d0e776799a8815a58061cb3> ("Add NoMerge MIFlag to avoid MIR branch
folding").
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D82794
Files:
llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
llvm/test/CodeGen/SystemZ/nomerge.ll
Index: llvm/test/CodeGen/SystemZ/nomerge.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/SystemZ/nomerge.ll
@@ -0,0 +1,36 @@
+; RUN: llc < %s -mtriple=s390x-linux-gnu -o - | FileCheck %s
+
+define void @foo(i32 %i) {
+entry:
+ switch i32 %i, label %if.end3 [
+ i32 5, label %if.then
+ i32 7, label %if.then2
+ ]
+
+if.then:
+ tail call void @bar() #0
+ br label %if.end3
+
+if.then2:
+ tail call void @bar() #0
+ br label %if.end3
+
+if.end3:
+ tail call void @bar() #0
+ ret void
+}
+
+declare void @bar()
+
+attributes #0 = { nomerge }
+
+; CHECK-LABEL: foo:
+; CHECK: # %bb.0: # %entry
+; CHECK: # %bb.1: # %entry
+; CHECK: # %bb.2: # %if.then
+; CHECK-NEXT: brasl %r14, bar at PLT
+; CHECK: jg bar at PLT
+; CHECK: .LBB0_3: # %if.then2
+; CHECK: brasl %r14, bar at PLT
+; CHECK: .LBB0_4: # %if.end3
+; CHECK: jg bar at PLT
Index: llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
===================================================================
--- llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
+++ llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
@@ -1675,6 +1675,7 @@
if (IsTailCall)
return DAG.getNode(SystemZISD::SIBCALL, DL, NodeTys, Ops);
Chain = DAG.getNode(SystemZISD::CALL, DL, NodeTys, Ops);
+ DAG.addNoMergeSiteInfo(Chain.getNode(), CLI.NoMerge);
Glue = Chain.getValue(1);
// Mark the end of the call, which is glued to the call itself.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82794.274184.patch
Type: text/x-patch
Size: 1435 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200629/88d02f00/attachment-0001.bin>
More information about the llvm-commits
mailing list