[PATCH] D125296: [VP] vp intrinsics are not speculatable
Simon Moll via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 10 02:42:52 PDT 2022
simoll created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
simoll published this revision for review.
simoll added projects: VP, LLVM.
simoll added reviewers: frasercrmck, rogfer01, craig.topper.
Herald added subscribers: llvm-commits, StephenFan, jdoerfert.
VP intrinsics show UB if the %evl parameter is out of bounds - they must
not carry the speculatable attribute. The out-of-bounds UB disappears
when the %evl parameter is expanded into the mask or expansion replaces
the entire VP intrinsic with non-VP code.
This patch
a) Removes the speculatable attribute on all VP intrinsics.
b) Generalizes the isSafeToSpeculativelyExecute function to let VP
expansion know whether the VP intrinsic replacement will be
speculatable. VP expansion may only discard %evl where this is the
case.
c) Fixes the expand-vp.ll test to correctly check that %evl is not
discarded where the VP replacement has side effects.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D125296
Files:
llvm/include/llvm/Analysis/ValueTracking.h
llvm/include/llvm/IR/Intrinsics.td
llvm/lib/Analysis/ValueTracking.cpp
llvm/lib/CodeGen/ExpandVectorPredication.cpp
llvm/test/CodeGen/Generic/expand-vp.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125296.428320.patch
Type: text/x-patch
Size: 24864 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220510/7dae4fdd/attachment.bin>
More information about the llvm-commits
mailing list