andrew.w.kaylor (Andy Kaylor)
User

Projects

User does not belong to any projects.

User Details

User Since
Jan 2 2013, 1:50 PM (306 w, 1 d)

Recent Activity

Tue, Nov 13

andrew.w.kaylor abandoned D53678: Include llvm-config.h from Demangle/Compiler.h.
Tue, Nov 13, 4:53 PM

Thu, Nov 8

andrew.w.kaylor added a comment to D45616: [X86] Lower _mm[256|512]_cmp[.]_mask intrinsics to native llvm IR.

Agreed. Reverting this patch wouldn't move us forward on constrained FP handling. What I'm saying (and what I think @nastafev is saying) is that this patch is taking a built-in that allows the user to express specific signalling behavior and throwing away that aspect of its semantics. Granted we do say that FP environment access is unsupported, so technically unmasking FP exceptions or even reading the status flag is undefined behavior. But it seems like there's a pretty big difference between using that claim to justify enabling some optimization that might do constant folding in a way that assumes the default rounding mode versus using that claim to disregard part of the semantics of a built-in that is modeling a target-specific instruction.

Thu, Nov 8, 3:51 PM
andrew.w.kaylor added a comment to D45616: [X86] Lower _mm[256|512]_cmp[.]_mask intrinsics to native llvm IR.
can trigger arbitrary floating-point exceptions anywhere in your code

I believe this statement reflects the current state of many compilers on the market, I guess I just don't see the reason why making things worse. It seems the original intent of the commit was to add support for masked compares, and that could have been achieved without breaking what already worked.

I hope the patch is ultimately helping some performance optimization, but it is breaking the original intent of some legitimate programs that worked before, and introduces correctness regression. So to me it must be at least guarded by a flip-switch.

The reference to constrained floating-point intrinsics work is relevant, but it will obviously take time and extra effort to enable and then to unbreak all the cases that are made broken here. Instead one could postpone lowering of the particular instructions until it was possible without violation of the semantics...

Thu, Nov 8, 2:04 PM
andrew.w.kaylor added a comment to D53157: Teach the IRBuilder about constrained fadd and friends.

Craig Topper also raised some concerns with me (in person, his desk is right by mine) about the potential effect this might have on code size. He tells me that IRBuilder calls are intended to always be inlined and if we grow the implementation of these functions too much it could lead to noticeable bloat. It still seems to me like it might be worthwhile for the simplification it would allow in the front end, but I'm not really a front end guy so I definitely agree that we should get some input from front end people about what they want.

Thu, Nov 8, 11:39 AM

Wed, Nov 7

andrew.w.kaylor added a comment to D54121: [FPEnv] Add constrained FCMP intrinsic.
compareSignalingGreaterEqual(a,b) is equivalent to compareSignalingLessUnordered(b, a)
Wed, Nov 7, 4:34 PM
andrew.w.kaylor added a comment to D54121: [FPEnv] Add constrained FCMP intrinsic.

I think my preference would be to have the predicate in the function name. I briefly toyed with the idea of hacking AsmWriter to print a constant integer as the corresponding predicate string, but I think that would look too weird. Also, I don't think we should open the door to something trying to use the value that represents the predicate as if it were a real value. In this sense the predicate argument, if we had one, should really be a token but I don't think we want to add new token constants just for this.

Wed, Nov 7, 2:44 PM
andrew.w.kaylor added a comment to D53157: Teach the IRBuilder about constrained fadd and friends.

Rather than having separate methods to create the constrained versions of the intrinsics, why not have a way to set the constrained state in the IR builder and have the regular CreateFAdd et. al. functions use that to automatically create the constrained intrinsic versions? This would correspond to how fast math flags are handled.

Wed, Nov 7, 10:17 AM

Mon, Nov 5

andrew.w.kaylor added a comment to D54121: [FPEnv] Add constrained FCMP intrinsic.

This is definitely a tricky case. I don't really like any of the available solutions. I'll try to think more about it, and maybe someone else will have a brilliant suggestion.

Mon, Nov 5, 4:17 PM

Fri, Nov 2

andrew.w.kaylor accepted D53411: [FPEnv] Add constrained CEIL/FLOOR/ROUND/TRUNC intrinsics.

This looks good, except that I assume now you'll be removing the FMA checks from the tests.

Fri, Nov 2, 4:00 PM
andrew.w.kaylor accepted D53932: [NFCI][FPEnv] Split constrained intrinsic tests.

lgtm

Fri, Nov 2, 3:50 PM
andrew.w.kaylor added inline comments to D53773: [ExecutionEngine] Track objects using an abstract ObjectKey in JITEventListeners..
Fri, Nov 2, 3:46 PM
andrew.w.kaylor added a comment to D43142: Experimental pass to convert all floating point operations to the equivalent constrained intrinsics.

I think we both agree that it's undefined behavior. If that's correct, then it doesn't really matter what we do after we hit it. So any solution is acceptable...

Fri, Nov 2, 2:16 PM
andrew.w.kaylor added a comment to D43142: Experimental pass to convert all floating point operations to the equivalent constrained intrinsics.

The only thing we need to worry about is making sure that FP operations don't migrate across calls or other FP operations that would break these semantics. Using the intrinsics after inlining takes care of that.

I don't agree with this. This is changing the semantics if we choose to inline a function by converting some operations into constrained intrinsics. In other words, an executable will have different behavior if we choose to inline or not. That's not ok.

Fri, Nov 2, 12:07 PM
andrew.w.kaylor added a comment to D43142: Experimental pass to convert all floating point operations to the equivalent constrained intrinsics.
In D43142#1285565, @kpn wrote:

If all optimizations including constant folding, or at least optimizations on floating point, are delayed until after inlining then there's no problem.

I'll add that this is a ton of work. A binary Instruction can't currently have two Constant operands. So, ConstantFolding is baked into the Instruction implementation right now. If I'm mistaken, someone please correct me.

I'm not an expert on inlining, but I imagine there are challenges moving it to 1st in the pass order too. I could see it being difficult to analyze cost on an unoptimized, non-canonical IR.

Fri, Nov 2, 11:12 AM
andrew.w.kaylor added a comment to D43142: Experimental pass to convert all floating point operations to the equivalent constrained intrinsics.

I'm realizing that FENV_ACCESS is poorly designed.

Fri, Nov 2, 11:07 AM

Thu, Nov 1

andrew.w.kaylor added a comment to D43142: Experimental pass to convert all floating point operations to the equivalent constrained intrinsics.
In D43142#1284190, @kpn wrote:

...

It's unclear to me how LTO (or other cross file inlining) would work here. I haven't given it much though until now. My knee-jerk reaction is that we shouldn't be inlining from a FENV_ACCESS=OFF to FENV_ACCESS=ON location.

I'm pretty sure that we decided that we couldn't (because once you inline the regular FP ops, there's no way to restrict their movement relative to the constrained intrinsics at the IR level).

Thu, Nov 1, 5:48 PM

Thu, Oct 25

andrew.w.kaylor added inline comments to D53538: NFC: Reorganize the demangler a bit.
Thu, Oct 25, 10:55 AM

Wed, Oct 24

andrew.w.kaylor added a comment to D53678: Include llvm-config.h from Demangle/Compiler.h.

FYI: this will be fixed by https://reviews.llvm.org/D53538 when that lands.

Wed, Oct 24, 3:48 PM
andrew.w.kaylor created D53678: Include llvm-config.h from Demangle/Compiler.h.
Wed, Oct 24, 3:37 PM

Oct 9 2018

andrew.w.kaylor added inline comments to D52452: Change the timestamp of llvmcache-foo file to meet the thinLTO prune policy.
Oct 9 2018, 5:41 PM

Oct 1 2018

andrew.w.kaylor added a comment to D52709: Add -instcombine-code-sinking option.

Can you update this review with a summary that describes the problem your are trying to fix by disabling instruction sinking here?

Oct 1 2018, 9:37 AM

Sep 25 2018

andrew.w.kaylor added a comment to D50913: [FPEnv] Don't need copysign/fabs/fneg constrained intrinsics.

There hasn't been any strong objects, but I haven't seen many strong accepts either besides the few main stakeholders. I'm under the assumption that silence is a passive reject in situations like this.

Should I keep pushing for it? It felt like I was beating a dead horse...

Sep 25 2018, 8:39 AM

Sep 18 2018

andrew.w.kaylor added inline comments to D47858: [New PM] Introducing PassInstrumentation framework.
Sep 18 2018, 3:10 PM
andrew.w.kaylor added inline comments to D47858: [New PM] Introducing PassInstrumentation framework.
Sep 18 2018, 2:50 PM
andrew.w.kaylor added inline comments to D47858: [New PM] Introducing PassInstrumentation framework.
Sep 18 2018, 2:46 PM
andrew.w.kaylor added inline comments to D47858: [New PM] Introducing PassInstrumentation framework.
Sep 18 2018, 2:25 PM

Aug 23 2018

andrew.w.kaylor added a comment to D50913: [FPEnv] Don't need copysign/fabs/fneg constrained intrinsics.

This is more a question of lowering and not an IR semantics question. The fneg will be defined as having no side effects or trapping. If through some architectural specific quirk the expected instructions need something more to avoid this, then that is their issue to deal with. Since it should always be impleentable with bitwise operations, this shouldn't be an issue

Aug 23 2018, 2:53 PM
andrew.w.kaylor added a comment to D50913: [FPEnv] Don't need copysign/fabs/fneg constrained intrinsics.

Your argument here is compelling. If there's no guarantee that an FSUB and FNEG are disjoint, then this won't work. Although, an FSUB and FNEG aren't really the same operation. Perhaps we should only be doing the transformation under UnsafeMath conditions to begin with...

Aug 23 2018, 12:30 PM

Aug 21 2018

andrew.w.kaylor added a comment to D50913: [FPEnv] Don't need copysign/fabs/fneg constrained intrinsics.

I feel like it might be a bad idea to have floating point instructions that don't have constrained forms.

Aug 21 2018, 1:56 PM

Aug 2 2018

andrew.w.kaylor added a comment to D49403: More aggressively complete RecordTypes with Function Pointers.

Fair enough.

Aug 2 2018, 5:50 PM
andrew.w.kaylor added a comment to D49403: More aggressively complete RecordTypes with Function Pointers.

I hope I'm not coming across as too argumentative here. I don't really have strong feelings about this function pointer type patch and ultimately I see that you are right, but the objections you are raising here would equally apply to what I'm working on with the IR linker and if I find a way to fix that, I'll care a bit more about that case. (If you'd like a preview, here's the bug I'm trying to fix: https://bugs.llvm.org/show_bug.cgi?id=38408)

Aug 2 2018, 11:56 AM

Aug 1 2018

andrew.w.kaylor added a comment to D49403: More aggressively complete RecordTypes with Function Pointers.

The LLVM linker also seems to have a bunch of problems with resolving pointer types in structures. I'm looking into a couple of those now.

Aug 1 2018, 4:25 PM
andrew.w.kaylor added a comment to D49403: More aggressively complete RecordTypes with Function Pointers.

I've talked to Olga about this, and I think we have a way to handle the problem she was working on without this change.

Aug 1 2018, 11:37 AM

Jun 14 2018

andrew.w.kaylor added a comment to D47925: Add debug info for OProfile porifling support.

Great! Sorry but I do not have merge access, can you land this for me? Thanks!

Jun 14 2018, 3:53 PM

Jun 13 2018

andrew.w.kaylor accepted D47925: Add debug info for OProfile porifling support.

lgtm

Jun 13 2018, 2:32 PM

Jun 11 2018

andrew.w.kaylor added inline comments to D47491: Expand constrained FP operations.
Jun 11 2018, 4:26 PM

Jun 8 2018

andrew.w.kaylor added a comment to D47925: Add debug info for OProfile porifling support.

Thanks for the patch!

Jun 8 2018, 3:15 PM

Jun 7 2018

andrew.w.kaylor added a reviewer for D47491: Expand constrained FP operations: craig.topper.
Jun 7 2018, 10:50 AM
andrew.w.kaylor added a comment to D47491: Expand constrained FP operations.

I'm adding Craig Topper as a reviewer because he knows the vector selection DAG stuff better than I do. The constrained FP handling looks OK to me.

Jun 7 2018, 10:49 AM

May 21 2018

andrew.w.kaylor added inline comments to D46967: Vector constrained FP intrinsics.
May 21 2018, 5:18 PM
andrew.w.kaylor added a comment to D45576: [RFC] Allow target to handle STRICT floating-point nodes.

The reason that I originally implemented this the way I did, mutating the strict nodes to their non-constrained equivalents, was that I thought it would require too much duplication in the .td files to implement all the pattern matching for the strict nodes. The original plan was to find some other way to communicate the "strict" state to the target after instruction selection, but I never found a way to do that.

May 21 2018, 4:22 PM

May 18 2018

andrew.w.kaylor added a comment to D43515: More math intrinsics for conservative math handling.

At some point we should create a document that describes the entire flow of FP instructions through the instruction selection process. To be honest I don't remember how it all works, and that makes it difficult to review changes like this. It would also be nice to verify that we all have the same understanding of how it works. I don't mean to volunteer you to produce the entire document, but would you mind giving me a rough outline? I'm still concerned about the case that is not chained.

May 18 2018, 4:43 PM

Apr 23 2018

andrew.w.kaylor accepted D45947: [CodeGen] Do not allow opt-bisect-limit to skip ScalarizeMaskedMemIntrin..

lgtm

Apr 23 2018, 9:46 AM

Apr 4 2018

andrew.w.kaylor accepted D44464: allow custom OptBisect classes set to LLVMContext.

Thank you for your patience in addressing my concerns.

Apr 4 2018, 10:02 AM

Apr 3 2018

andrew.w.kaylor added inline comments to D44464: allow custom OptBisect classes set to LLVMContext.
Apr 3 2018, 1:39 PM
andrew.w.kaylor added inline comments to D44464: allow custom OptBisect classes set to LLVMContext.
Apr 3 2018, 12:07 PM

Mar 27 2018

andrew.w.kaylor added inline comments to D44464: allow custom OptBisect classes set to LLVMContext.
Mar 27 2018, 1:30 PM

Mar 26 2018

andrew.w.kaylor added a comment to D44821: [NFC] OptPassGate extracted from OptBisect.

I'm OK with this.

Mar 26 2018, 10:06 AM

Mar 23 2018

andrew.w.kaylor added inline comments to D44821: [NFC] OptPassGate extracted from OptBisect.
Mar 23 2018, 10:39 AM
andrew.w.kaylor added a comment to D44817: Fix a block color copying problem in LICM.

Sigh.
(a quick scan of things named Map in LLVM doesn't find any other obvious cases of this).

I wonder if we shouldn't have a debug/expensive checks mode where it moves all the memory on find and construct to make all these situations fail obviously and instantly so it could be found by bots.

Mar 23 2018, 9:57 AM

Mar 22 2018

andrew.w.kaylor created D44817: Fix a block color copying problem in LICM.
Mar 22 2018, 9:40 PM

Mar 20 2018

andrew.w.kaylor added a comment to D44464: allow custom OptBisect classes set to LLVMContext.

As long as you're OK with the fact that this will probably be replaced in the near future (and please add a comment indicating that above the setOptPassGate function), I'm OK with this being added. I do prefer OptPassGate as a name for the generalized functionality.

Mar 20 2018, 8:01 AM

Mar 19 2018

andrew.w.kaylor added a comment to D44464: allow custom OptBisect classes set to LLVMContext.

I would prefer not to overload the behavior of OptBisect. ...

Andrew, would it be ok to create an NFC extracting a pure virtual class OptPassGate from OptBisect? Then I could make use of the OptPassGate interface to implement context specific pass gates without referring to OptBisect.

Mar 19 2018, 5:14 PM

Mar 15 2018

andrew.w.kaylor added a comment to D44464: allow custom OptBisect classes set to LLVMContext.

I would like to stress that we consider OptBisect to be more than just "bisector", but rather the only
available way of skipping optimization passes with an arbitrarily complex control pattern.

Mar 15 2018, 10:20 AM

Mar 14 2018

andrew.w.kaylor added a comment to D44464: allow custom OptBisect classes set to LLVMContext.

I have some concerns about this patch, mostly centered around what the intended use cases are.

Mar 14 2018, 12:18 PM

Mar 7 2018

andrew.w.kaylor added a comment to D44216: [LangRef] make it clear that FP instructions do not have side effects.

Thanks for taking the initiative on this!

Mar 7 2018, 9:51 AM

Mar 6 2018

andrew.w.kaylor added inline comments to D43515: More math intrinsics for conservative math handling.
Mar 6 2018, 9:14 AM

Feb 28 2018

andrew.w.kaylor added inline comments to D43515: More math intrinsics for conservative math handling.
Feb 28 2018, 11:26 AM

Feb 21 2018

andrew.w.kaylor added inline comments to D43515: More math intrinsics for conservative math handling.
Feb 21 2018, 6:18 PM

Feb 20 2018

andrew.w.kaylor added inline comments to D43515: More math intrinsics for conservative math handling.
Feb 20 2018, 11:55 AM

Feb 9 2018

andrew.w.kaylor created D43142: Experimental pass to convert all floating point operations to the equivalent constrained intrinsics.
Feb 9 2018, 2:04 PM

Jan 30 2018

andrew.w.kaylor added a comment to D40524: Handle the case of live 16-bit subregisters in X86FixupBWInsts.

Cheers - did you create the bug report in the end? I can't seem to find it.

Jan 30 2018, 8:28 AM

Jan 25 2018

andrew.w.kaylor accepted D42533: [X86FixupBWInsts] Fix miscompilation if sibling sub-register is live..

Looks good!

Jan 25 2018, 11:16 AM
andrew.w.kaylor added a comment to D42533: [X86FixupBWInsts] Fix miscompilation if sibling sub-register is live..

BTW, thank you very much for this patch!

Jan 25 2018, 9:34 AM
andrew.w.kaylor added inline comments to D42533: [X86FixupBWInsts] Fix miscompilation if sibling sub-register is live..
Jan 25 2018, 9:33 AM
andrew.w.kaylor accepted D42531: [X86FixupBWInsts] Prefer positive checks in the test. NFC.

lgtm

Jan 25 2018, 8:21 AM

Jan 4 2018

andrew.w.kaylor added a comment to D41338: [CodeGen] lower math intrinsics to finite version of libcalls when possible (PR35672).

After thinking through this particular situation a bit more with regard to the STRICT_EXP node, I think what you've chosen to do here is probably correct. I'm not entirely certain what the exp_finite implementation does, but I would expect that with regard to rounding it will produce the same result as the normal function as long as the input is finite. Similarly, I think that the exception behavior of exp_finite should be the same as the non-finite version as long as the input is finite. If the input is non-finite, then I would expect that the appropriate exception was raised or status flag set by whatever produced the value. I don't think either exp or exp_finite will produce an exception for non-finite values. We'll get the wrong answer with exp_finite of course, but the user signed up for that when using the fast math flags.

Jan 4 2018, 11:16 AM

Jan 3 2018

andrew.w.kaylor added a comment to D41338: [CodeGen] lower math intrinsics to finite version of libcalls when possible (PR35672).

Does this make sense for ISD::STRICT_FEXP (the strict version of the node)?

I would guess strict and fast math don't really mix...

I agree.

Sorry for the delay. Let me address this comment first. I would agree too, but I was informed that there's a clang customer in the gaming world that wants to compile with -ffast-math and enable div-by-zero FP exceptions as a way to sanitize their data (at least in development builds).

I assume that we're still a long way from realizing this dream (optimized FP + some subset of FP exceptions enabled) in LLVM, but if there's no correctness issue with allowing this transform, then I think we should treat these nodes the same in this patch.

Jan 3 2018, 6:09 PM

Jan 2 2018

andrew.w.kaylor added a comment to D40524: Handle the case of live 16-bit subregisters in X86FixupBWInsts.

@andrew.w.kaylor What is happening with this patch, will you be able to commit it for Jan 3 to fix PR35240? What about the high 8-bit register issue - is there a bugzilla (and repro) for this?

Jan 2 2018, 9:42 AM

Dec 11 2017

andrew.w.kaylor added a comment to D40524: Handle the case of live 16-bit subregisters in X86FixupBWInsts.

I'm not sure if the following is possible/legal but it fails even with this patch:

body:             |
  bb.0:
    successors:
    liveins: %ch, %bl

    %cl = MOV8rr %bl, implicit-def %cx, implicit killed %ch, implicit-def %eflags
    ; CHECK-NOT: MOV32rr
    RETQ %cx

If that's a valid testcase than "a little more checking to do." (isLive before this patch) has to be fixed. If it's invalid - we'd need an assert for that too (or some mir-verify?). However, that should not be a part of this change, probably. Hence, just asking what's your opinion about that testcase.

Dec 11 2017, 3:32 PM

Nov 29 2017

andrew.w.kaylor updated the diff for D40524: Handle the case of live 16-bit subregisters in X86FixupBWInsts.

Death to the curlies!

Nov 29 2017, 12:37 PM
andrew.w.kaylor added inline comments to D40524: Handle the case of live 16-bit subregisters in X86FixupBWInsts.
Nov 29 2017, 11:20 AM

Nov 28 2017

andrew.w.kaylor updated the diff for D40524: Handle the case of live 16-bit subregisters in X86FixupBWInsts.

Updated the test case.

Nov 28 2017, 11:46 AM
andrew.w.kaylor added inline comments to D40524: Handle the case of live 16-bit subregisters in X86FixupBWInsts.
Nov 28 2017, 11:45 AM

Nov 27 2017

andrew.w.kaylor updated the diff for D40524: Handle the case of live 16-bit subregisters in X86FixupBWInsts.

-Refactored getSuperRegDestIfDead() to consolidate the liveness checking logic.
-Added a test case.

Nov 27 2017, 5:14 PM
andrew.w.kaylor added a comment to D40524: Handle the case of live 16-bit subregisters in X86FixupBWInsts.

FWIW At a first glance this feels to me as we should have the fixes in isLive() instead as that seems to roughly be "LivePhysRegs::contains() with tweaks" where the LivePhysRegs::contains() would check super registers.

Nov 27 2017, 3:14 PM
andrew.w.kaylor created D40524: Handle the case of live 16-bit subregisters in X86FixupBWInsts.
Nov 27 2017, 2:45 PM

Oct 26 2017

andrew.w.kaylor added inline comments to D39304: [IR] redefine 'reassoc' fast-math-flag and add 'trans' fast-math-flag.
Oct 26 2017, 12:25 PM

Oct 18 2017

andrew.w.kaylor added a comment to D38634: AMDGPU : Custom lowering constrained fps..

It isn't clear to me how your custom lowering interacts, if at all, with existing table-driven selection patterns. One of the goals in the implementation up to this point has been to have the instruction selection fall back on existing pattern matching as much as possible so that we don't need to duplicate all of the cases that are currently handled. Can you explain to me how this applies in the AMDGPU case?

Oct 18 2017, 12:49 PM

Oct 6 2017

andrew.w.kaylor requested changes to D38634: AMDGPU : Custom lowering constrained fps..
Oct 6 2017, 12:09 PM

Sep 20 2017

andrew.w.kaylor closed D38060: Remove offset size check in nullptr arithmetic handling.

This was committed as r313784. I put the wrong differential revision number in the comment for that check-in.

Sep 20 2017, 1:50 PM

Sep 19 2017

andrew.w.kaylor created D38060: Remove offset size check in nullptr arithmetic handling.
Sep 19 2017, 4:25 PM
andrew.w.kaylor added a comment to D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc.

This is breaking buildbots for 32-bit targets because the offset in 'nullptr + int8_t_N' is being implicitly cast to an int. That makes the sizeof(offset) == sizeof(ptr) check turn out differently than my tests were assuming.

Sep 19 2017, 2:14 PM

Sep 14 2017

andrew.w.kaylor updated the diff for D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc.

-Changed GNU idiom from extension to warning.
-Updated to ToT.

Sep 14 2017, 12:38 PM

Sep 13 2017

andrew.w.kaylor added inline comments to D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc.
Sep 13 2017, 2:48 PM
andrew.w.kaylor added inline comments to D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc.
Sep 13 2017, 2:42 PM
andrew.w.kaylor added a comment to D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc.

Does anything else need to be done for this to be ready to land?

Sep 13 2017, 12:57 PM

Sep 5 2017

andrew.w.kaylor added a comment to D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc.

Ping.

Sep 5 2017, 11:16 AM

Aug 30 2017

andrew.w.kaylor updated the diff for D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc.

Fixed value-dependent argument in isNullPointerConstant checks.
Added check for C++ zero offset in subtraction.
Added value-dependent test cases.

Aug 30 2017, 5:57 PM
andrew.w.kaylor added inline comments to D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc.
Aug 30 2017, 3:46 PM
andrew.w.kaylor updated the diff for D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc.

Refactored the GNU idiom check to be shared by Sema and CodeGen.
Refined the checks so that nullptr+0 doesn't warn in C++.
Added the zero offset qualification in the warning produced with C++.

Aug 30 2017, 2:25 PM

Aug 29 2017

andrew.w.kaylor added inline comments to D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc.
Aug 29 2017, 5:26 PM
andrew.w.kaylor added inline comments to D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc.
Aug 29 2017, 4:40 PM
andrew.w.kaylor added inline comments to D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc.
Aug 29 2017, 3:45 PM
andrew.w.kaylor updated the diff for D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc.

Added warnings for null pointer arithmetic.

Aug 29 2017, 12:21 PM

Aug 25 2017

andrew.w.kaylor added a comment to D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc.

I'd really like to see this done in some way such that we can issue a warning along with generating well-defined code. The warning can specifically state that the code is using an extension, etc.

Aug 25 2017, 9:52 AM

Aug 23 2017

andrew.w.kaylor accepted D36335: Add ‘llvm.experimental.constrained.fma‘ Intrinsic.

LGTM

Aug 23 2017, 4:21 PM
andrew.w.kaylor added a comment to D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc.

My intention here was to make this as strict/limited as possible while still handling the cases of interest. There are two different implementations I want to handle. You can see the first variation in the __BPTR_ALIGN definition being added here:

Aug 23 2017, 12:53 PM
andrew.w.kaylor added a comment to D36335: Add ‘llvm.experimental.constrained.fma‘ Intrinsic.

Can you revert the white space changes in the places you aren't otherwise modifying? In general, you shouldn't make formatting changes outside of the parts of the file your patch is modifying. It complicates the version control blame process without adding a lot of benefit.

Aug 23 2017, 11:58 AM
andrew.w.kaylor added inline comments to D36335: Add ‘llvm.experimental.constrained.fma‘ Intrinsic.
Aug 23 2017, 11:49 AM