1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
llvm-mirror/lib/Transforms
Juneyoung Lee 92f700c60b [llvm-extract] Add -keep-const-init commandline option
Summary:
This adds -keep-const-init option to llvm-extract which preserves initializers of
used global constants.

For example:

```
$ cat a.ll
@g = constant i32 0
define i32 @f() {
  %v = load i32, i32* @g
  ret i32 %v
}

$ llvm-extract --func=f a.ll -S -o -
@g = external constant i32
define i32 @f() { .. }

$ llvm-extract --func=f a.ll -keep-const-init -S -o -
@g = constant i32 0
define i32 @f() { .. }
```

This option is useful in checking whether a function that uses a constant global is optimized correctly.

Reviewers: jsji, MaskRay, david2050

Reviewed By: MaskRay

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73833
2020-02-03 14:30:28 +09:00
..
AggressiveInstCombine [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
CFGuard Add support for __declspec(guard(nocf)) 2020-01-10 16:04:12 +00:00
Coroutines [Coroutines] Remove corresponding phi values when apply simplifyTerminatorLeadingToRet 2020-01-05 18:26:30 -05:00
Hello Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InstCombine [InstCombine] Push negation through multiply (PR44234) 2020-01-31 20:58:55 +01:00
Instrumentation Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
IPO [llvm-extract] Add -keep-const-init commandline option 2020-02-03 14:30:28 +09:00
ObjCARC [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
Scalar [Transforms] Simplify with make_early_inc_range 2020-02-02 00:54:32 -08:00
Utils [Inliner][NoAlias] Use call site attributes too 2020-02-02 23:21:29 -06:00
Vectorize [LV] Hoist code to mark conditional assumes as dead to caller (NFC). 2020-01-28 08:50:44 -08:00
CMakeLists.txt Add Windows Control Flow Guard checks (/guard:cf). 2019-10-28 15:19:39 +00:00
LLVMBuild.txt Add Windows Control Flow Guard checks (/guard:cf). 2019-10-28 15:19:39 +00:00