[llvm-commits] [llvm] r45073 - in /llvm/trunk: include/llvm/Support/CallSite.h lib/Transforms/Scalar/InstructionCombining.cpp lib/Transforms/Utils/InlineFunction.cpp lib/VMCore/Instructions.cpp test/CFrontend/2007-12-16-AsmNoUnwind.c test/Transforms/Inline/2007-04-15-InlineEH.ll test/Transforms/InstCombine/2007-12-16-AsmNoUnwind.ll
Chris Lattner
clattner at apple.com
Sun Dec 16 12:50:50 PST 2007
> URL: http://llvm.org/viewvc/llvm-project?rev=45073&view=rev
> Log:
> Make instcombine promote inline asm calls to 'nounwind'
> calls.
Nice.
> Remove special casing of inline asm from the
> inliner. There is a potential problem: the verifier
> rejects invokes of inline asm (not sure why).
Please restore the inliner to not do this or change the verifier to
not reject it. Right now you have broken the tree.
> +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Sun
> Dec 16 09:51:49 2007
> @@ -7972,6 +7972,19 @@
> }
> }
>
> + if (isa<InlineAsm>(Callee) && !CS.isNoUnwind()) {
> + // Inline asm calls cannot throw - mark them 'nounwind'.
> + const ParamAttrsList *PAL = CS.getParamAttrs();
> + uint16_t RAttributes = PAL ? PAL->getParamAttrs(0) : 0;
> + RAttributes |= ParamAttr::NoUnwind;
> +
> + ParamAttrsVector modVec;
> + modVec.push_back(ParamAttrsWithIndex::get(0, RAttributes));
> + PAL = ParamAttrsList::getModified(PAL, modVec);
> + CS.setParamAttrs(PAL);
> + Changed = true;
> + }
Should this go in a helper function? Something like
CS.addAttribute(ParamAttr::NoUnwind)
?
-Chris
More information about the llvm-commits
mailing list