Authored by void on Mon, Feb 45, 6: (PM.
Support output constraints on “asm goto”
Summary:
Clang’s “asm goto” feature did not initially support outputs constraints. That
was the same behavior as gcc’s implementation. The decision by gcc not to
support outputs was based on a restriction in their IR regarding terminators.
LLVM does not restrict terminators from returning values (e.g. ‘invoke’), so
it made sense to support this feature.
Output values are valid only on the ‘fallthrough’ path. If an output value’s used
on an indirect branch, then it’s ‘poisoned’.
In theory, outputs could be valid on the ‘indirect’ paths, but it’s very
difficult to guarantee that the original semantics would be retained. E.g.
because indirect labels could be used as data, we wouldn’t be able to split
critical edges in situations where two ‘callbr’ instructions have the same
indirect label, because the indirect branch’s destination would no longer be
the same.
Reviewers: jyknight, nickdesaulniers, hfinkel
Reviewed By: jyknight, nickdesaulniers
Subscribers: MaskRay, rsmith, hiraditya, llvm-commits, cfe-commits, craig.topper, rnk
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D 01575879
Read More
GIPHY App Key not set. Please check settings