search for: speculat

Displaying 20 results from an estimated 74 matches for "speculat".

Did you mean: speculate
2013 Nov 01
0
[LLVMdev] Add a 'notrap' function attribute?
FYI, see also the previous discussion about "speculatable": http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064426.html I think such an attribute should be added. In the thread which lead up to that thread, I proposed using more fine-grained attributes and Michael rightly pointed out the problem with that: you'd need one for every p...
2020 Aug 13
3
Deterministic function return attribute
...merge two calls with the same parameters when the function is declared but not defined. (just like two stores). I'll call this property mergability. %1 := call @test(%0) %2 := call @test(%0) and the optimization would be something like (%2).replaceUsesWith((%1)). I think it's related to speculatable & readnone in LLVM, (if I understood well, it's the same as GCC's __attribute__((pure)), but I'm not sure whether there are edgecases where the mergability is not equivalent. I've seen somewhere that maybe malloc has these attributes, but it surely cannot be merged. This is...
2013 Jul 25
3
[LLVMdev] Does nounwind have semantics?
A patch is attached. Not sure I'm happy with this due to the aforementioned orthogonality concerns, but I really don't have any better ideas. If anyone does, feel free to offer them, I don't mind throwing this patch into the trash. (Also, not happy with the name, using "speculatable" as Nick suggested, for the lack of other options. If the name stays I'll add it to the documentation.) Regarding auditing the intrinsics - I'd prefer to do this in stages. Here I'm just preserving the current behavior by marking intrinsics that used to be explicitly handled i...
2013 Jul 25
0
[LLVMdev] Does nounwind have semantics?
Kuperstein, Michael M wrote: > A patch is attached. + const CallInst* CI = dyn_cast<CallInst>(Inst); + return CI->isSafeToSpeculativelyExecute(); "return cast<CallInst>(Inst)->isSafeToSpeculativelyExecute();"? Use cast<> instead of dyn_cast<>. See http://llvm.org/docs/ProgrammersManual.html#isa . Then I don't think it needs to be two lines. You can even remove the extra curly braces aroun...
2015 Dec 04
2
RFC: New function attribute HasInaccessibleState
...; with the same arguments which dominate the call-site at "X". However, there are some cases that this would not be able to optimize. For example, if we have two csecandidates ("X" and "Y") which do not dominate one another. This is solvable using another attribute: speculatable. This attribute would tell us that we can hoist the call out of arbitrary conditions. This would allow us to move our csecandidate call-site to the common dominator of "X" and "Y" and RAUW. On Fri, Dec 4, 2015 at 8:54 AM, Krzysztof Parzyszek via llvm-dev < llvm-dev a...
2013 Jul 22
0
[LLVMdev] Does nounwind have semantics?
...frontends are free to put attributes, but it would be nice if > optimizations actually used them. ;-) > My use case is that of proprietary frontend that happens to know some > library function calls - which are only resolved at link time - have no > side effects and are safe to execute speculatively, and wants to tell the > optimizer it can move them around however it likes. I'll gladly submit a > patch that uses these hints, but I'd like to reach some consensus on what > the desired attributes actually are first. The last thing I want is to add > attributes that are o...
2013 Jul 25
2
[LLVMdev] Does nounwind have semantics?
...o: Kuperstein, Michael M Cc: Nick Lewycky; llvmdev at cs.uiuc.edu; Tobias Grosser; echristo at gmail.com Subject: Re: [LLVMdev] Does nounwind have semantics? Kuperstein, Michael M wrote: > A patch is attached. + const CallInst* CI = dyn_cast<CallInst>(Inst); + return CI->isSafeToSpeculativelyExecute(); "return cast<CallInst>(Inst)->isSafeToSpeculativelyExecute();"? Use cast<> instead of dyn_cast<>. See http://llvm.org/docs/ProgrammersManual.html#isa . Then I don't think it needs to be two lines. You can even remove the extra curly braces around...
2020 Jul 16
2
LLVM 11 and trunk selecting 4 wide instead of 8 wide loop vectorization for AVX-enabled target
...BL.0042: ; preds = %BL.0005, %entry ret void } ; Function Attrs: norecurse readnone define dllexport void @burst.initialize(i8* (i8*)* nocapture readnone %callback) local_unnamed_addr #1 !ubaa. !0 { entry: ret void } ; Function Attrs: nounwind readnone speculatable willreturn declare float @llvm.pow.f32(float, float) #2 attributes #0 = { nofree } attributes #1 = { norecurse readnone } attributes #2 = { nounwind readnone speculatable willreturn } !ubaa.Burst.Compiler.IL.Tests.VectorsMaths\2FFloatPointer.0 = !{!0, !0, !0, !0} !0 = !{i1 false} !1 = !{i1 t...
2020 Aug 14
2
Fwd: Deterministic function return attribute
...t; I'll call this property mergability. >>  > >>  > %1 := call @test(%0) >>  > %2 := call @test(%0) >>  > >>  > and the optimization would be something like (%2).replaceUsesWith((%1)). >>  > >>  > I think it's related to speculatable & readnone in LLVM, (if I >>  > understood well, it's the same as GCC's __attribute__((pure)), but I'm >>  > not sure whether there are edgecases where the mergability is not >>  > equivalent. >>  > >>  > I've seen somewhere...
2013 Oct 31
6
[LLVMdev] Add a 'notrap' function attribute?
...erogeneous setting. At least CUDA comes to mind. What about OpenACC and the new OpenMP, does someone know offhand? It would help several optimizations if they could assume certain instructions do not trap. E.g., I was looking at the if-conversion of the loop vectorizer, and it seems to not support speculating stores, divs, etc. which could be done if we knew it's safe to speculatively execute them. [In this particular if-conversion case proper predicated execution (not speculative) would require predicates to be added for all LLVM instructions so they could be squashed. I think this was discusse...
2013 Jul 22
2
[LLVMdev] Does nounwind have semantics?
Of course frontends are free to put attributes, but it would be nice if optimizations actually used them. ;-) My use case is that of proprietary frontend that happens to know some library function calls - which are only resolved at link time - have no side effects and are safe to execute speculatively, and wants to tell the optimizer it can move them around however it likes. I'll gladly submit a patch that uses these hints, but I'd like to reach some consensus on what the desired attributes actually are first. The last thing I want is to add attributes that are only useful to myself...
2016 Feb 25
0
Possible soundness issue with available_externally (split from "RFC: Add guard intrinsics")
...we go by the langref, then optimizations that fold undef are also problematic (though most C/C++ programs resulting in such IR would have UB in practice). I think there are non-(non-deterministic) problematic cases too. The following won't happen today since `readnone` does not imply `safe_to_speculate`, but if we add a `safe_to_speculate` property some day: int foo(bool C) available_externally { if (C) ((int *) null)++; // UB ret 42; } void bar() { if (<some cond>) foo(true); } Now, normally you can just delete the `if (C)` branch in foo, and it...
2020 Jul 16
2
LLVM 11 and trunk selecting 4 wide instead of 8 wide loop vectorization for AVX-enabled target
...>> } >> >> ; Function Attrs: norecurse readnone >> define dllexport void @burst.initialize(i8* (i8*)* nocapture readnone >> %callback) local_unnamed_addr #1 !ubaa. !0 { >> entry: >> ret void >> } >> >> ; Function Attrs: nounwind readnone speculatable willreturn >> declare float @llvm.pow.f32(float, float) #2 >> >> attributes #0 = { nofree } >> attributes #1 = { norecurse readnone } >> attributes #2 = { nounwind readnone speculatable willreturn } >> >> !ubaa.Burst.Compiler.IL.Tests.VectorsMaths\2FFlo...
2020 Jul 19
2
Instrument intrinsic invalid
...l(dbglabelPtr, args, ""); } And before my pass finish, I print the IR, it shows I successfully add the intrinsic %5 = load i32 (i32, i32)*, i32 (i32, i32)** %1, align 8, !dbg !35, !ppp.load !36 call void @llvm.dbg.label(metadata !36), !dbg !37 ... ; Function Attrs: nounwind readnone speculatable willreturn declare void @llvm.dbg.label(metadata) #1 But, when I use llvm-dis to disassemble the .bc generated by opt, it ignore the code I insert: invalid llvm.dbg.label intrinsic variable call void @llvm.dbg.label(metadata !36), !dbg !37 !36 = !{!"dbg1", !"dbgfromLoad"...
2018 Feb 16
2
Missing attribute inference cases
...any of the gaps I noticed, but I figured someone else out there might be interested. Missing Attributes argmemonly - influences AA, particularly relevant for libraries which wrap build in functions which are annotated, but don't manually annotate the wrappers dereferenceable - influences speculation safety, this primarily drives LICM, but can also effect things like PRE -- probably best to implement as a deref_or_nuill analysis and then merge nonnull inference to promote dereferenceable_or_null - see previous nounwind - currently implemented in PruneEH, missing in new pass manager --...
2016 Nov 11
3
RFC: Killing undef and spreading poison
...ther* transforms that we ourselves want to do, where these "other transforms" pretend certain abnormal cases do not exist. Poison is a "stand-in" for these transforms, which are sometimes non-local. For instance, continuing the previous example, say we're interested in the speculatibility of t = K `udiv` (-1 + (sum.sext >> 32)) We don't _really_ care about doing something intelligent when sum.sext is provably poison. However, we do care about taking into the _possibility_ of sum.sext being poison, which is really just a more precise way of saying that we care abo...
2018 Feb 17
2
Missing attribute inference cases
...gt;> interested. >> >> Missing Attributes >> >> argmemonly - influences AA, particularly relevant for libraries which wrap >> build in functions which are annotated, but don't manually annotate the >> wrappers >> >> dereferenceable - influences speculation safety, this primarily drives LICM, >> but can also effect things like PRE -- probably best to implement as a >> deref_or_nuill analysis and then merge nonnull inference to promote >> >> >> dereferenceable_or_null - see previous >> >> nounwind - currentl...
2018 Feb 16
0
Missing attribute inference cases
...meone else out > there might be interested. > > *Missing Attributes* > > argmemonly - influences AA, particularly relevant for libraries which > wrap build in functions which are annotated, but don't manually > annotate the wrappers > > dereferenceable - influences speculation safety, this primarily drives > LICM, but can also effect things like PRE -- probably best to > implement as a deref_or_nuill analysis and then merge nonnull > inference to promote > > dereferenceable_or_null - see previous > > nounwind - currently implemented in PruneEH,...
2017 Apr 06
3
Dereferenceable load semantics & LICM
...ue then it is UB. > > But then you're saying dead code (code that would not actually execute > in the original program) can affect program behavior, and: "if (false) > X;" is not a no-op for some values of X. It is in this respect that > your proposal is similar to the speculatable proposal. > > -- Sanjoy > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
2017 Apr 06
3
Dereferenceable load semantics & LICM
2017-04-06 17:57 GMT+02:00 Sanjoy Das <sanjoy at playingwithpointers.com>: > Hi Piotr, > > On April 6, 2017 at 2:36:53 AM, Piotr Padlewski > (piotr.padlewski at gmail.com) wrote: > > I disagree, I find it different than the patch you mentioned. We don't > have > > any problems with code like this: > > > > ptr = load i8*, i8** %ptrptr,