[PATCH] D26292: Discard @llvm.invariant.group.barrier in -O0 code generation
Richard Smith via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 7 08:57:13 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL286119: Add -O0 support for @llvm.invariant.group.barrier by discarding it if it gets… (authored by rsmith).
Changed prior to commit:
https://reviews.llvm.org/D26292?vs=76903&id=77044#toc
Repository:
rL LLVM
https://reviews.llvm.org/D26292
Files:
llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/trunk/test/CodeGen/Generic/intrinsics.ll
Index: llvm/trunk/test/CodeGen/Generic/intrinsics.ll
===================================================================
--- llvm/trunk/test/CodeGen/Generic/intrinsics.ll
+++ llvm/trunk/test/CodeGen/Generic/intrinsics.ll
@@ -1,4 +1,5 @@
; RUN: llc < %s
+; RUN: llc -O0 < %s
;; SQRT
declare float @llvm.sqrt.f32(float)
@@ -38,3 +39,9 @@
ret double %I
}
+declare i8* @llvm.invariant.group.barrier(i8*)
+
+define i8* @barrier(i8* %p) {
+ %q = call i8* @llvm.invariant.group.barrier(i8* %p)
+ ret i8* %q
+}
Index: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -1216,6 +1216,7 @@
updateValueMap(II, ResultReg);
return true;
}
+ case Intrinsic::invariant_group_barrier:
case Intrinsic::expect: {
unsigned ResultReg = getRegForValue(II->getArgOperand(0));
if (!ResultReg)
Index: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -5460,6 +5460,7 @@
}
case Intrinsic::annotation:
case Intrinsic::ptr_annotation:
+ case Intrinsic::invariant_group_barrier:
// Drop the intrinsic, but forward the value
setValue(&I, getValue(I.getOperand(0)));
return nullptr;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26292.77044.patch
Type: text/x-patch
Size: 1520 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161107/4c5a434c/attachment.bin>
More information about the llvm-commits
mailing list