This is an archive of the discontinued LLVM Phabricator instance.

[X86] Fix uninitialized variable warnings in cetintrin.h reported by #55224
ClosedPublic

Authored by pengfei on May 4 2022, 5:13 AM.

Diff Detail

Event Timeline

pengfei created this revision.May 4 2022, 5:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2022, 5:13 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
pengfei requested review of this revision.May 4 2022, 5:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2022, 5:13 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
RKSimon added inline comments.May 4 2022, 5:19 AM
clang/test/CodeGen/X86/sse-builtins-constrained.c
5 ↗(On Diff #426968)

Any reason you can't commit this separately and immediately?

pengfei added inline comments.May 4 2022, 5:25 AM
clang/test/CodeGen/X86/sse-builtins-constrained.c
5 ↗(On Diff #426968)

Good point! I'll do it.

pengfei updated this revision to Diff 426971.May 4 2022, 5:32 AM

Seperated unrelated change and rebase.

RKSimon accepted this revision.May 4 2022, 5:44 AM

LGTM - I'm intending to add -Wsystem-headers to the clang x86 builtins tests once everything is clean.

This revision is now accepted and ready to land.May 4 2022, 5:44 AM

LGTM - I'm intending to add -Wsystem-headers to the clang x86 builtins tests once everything is clean.

Thanks @RKSimon! That sounds great! I was thinking the headers will do diagnosis when -Wall.

craig.topper added inline comments.May 4 2022, 9:30 AM
clang/lib/Headers/cetintrin.h
45

The argument should also be (void).

58

Same here

craig.topper added inline comments.May 4 2022, 9:33 AM
clang/lib/Headers/cetintrin.h
48

So if CET isn't enabled this intrinsic returns a random value instead of 0 like _get_ssp?

pengfei marked an inline comment as done.May 4 2022, 8:05 PM
pengfei added inline comments.
clang/lib/Headers/cetintrin.h
45

Thanks! Done by rGaa25b55bde87.

48

Exactly! These intrinsics are used to reflect the exact instructions behavior, i.e., a nop operation. They are used for performance.